Skip to content

Commit efd64a0

Browse files
CA-Tatamiclaude
andcommitted
DepthパスにVertex Deformationを追加
DepthNormals/DepthOnlyパスでVertex Deformationが 適用されていなかった問題を修正。 Forward/ShadowCasterパスと同じ実装を追加。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 01bc07f commit efd64a0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ VaryingsDrawDepth vert(AttributesDrawDepth input)
177177
SETUP_CUSTOM_COORD(input)
178178
TRANSFER_CUSTOM_COORD(input, output);
179179
#endif
180+
181+
// Vertex Deformation
182+
#ifdef _VERTEX_DEFORMATION_ENABLED
183+
float2 vertexDeformationUVs = TRANSFORM_TEX(input.texcoord.xy, _VertexDeformationMap);
184+
vertexDeformationUVs.x += GET_CUSTOM_COORD(_VertexDeformationMapOffsetXCoord);
185+
vertexDeformationUVs.y += GET_CUSTOM_COORD(_VertexDeformationMapOffsetYCoord);
186+
float vertexDeformationIntensity = _VertexDeformationIntensity + GET_CUSTOM_COORD(_VertexDeformationIntensityCoord);
187+
vertexDeformationIntensity = GetVertexDeformationIntensity(
188+
_VertexDeformationMap, sampler_VertexDeformationMap,
189+
vertexDeformationIntensity,
190+
vertexDeformationUVs,
191+
_VertexDeformationMapChannel,
192+
_VertexDeformationBaseValue);
193+
input.positionOS.xyz += normalize(input.normalOS) * vertexDeformationIntensity;
194+
#endif
180195
InitializeVertexOutputDrawDepth(input, output);
181196

182197
#ifdef _USE_BASE_MAP_UV

0 commit comments

Comments
 (0)