Skip to content

Commit bcce886

Browse files
authored
Merge pull request #157 from CyberAgentGameEntertainment/fix/parallax-map-progress
Fix parallax map progress mode switching
2 parents b318d11 + 84033cc commit bcce886

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis
188188
output.parallaxMapUVAndProgress.xy = TRANSFORM_PARALLAX_MAP(input.texcoord.xy)
189189
output.parallaxMapUVAndProgress.x += GET_CUSTOM_COORD(_ParallaxMapOffsetXCoord);
190190
output.parallaxMapUVAndProgress.y += GET_CUSTOM_COORD(_ParallaxMapOffsetYCoord);
191-
float parallaxMapProgress = _ParallaxMapProgress + GET_CUSTOM_COORD(_ParallaxMapProgressCoord);
192-
output.parallaxMapUVAndProgress.z = FlipBookProgress(parallaxMapProgress, _ParallaxMapSliceCount);
191+
#ifdef _PARALLAX_MAP_MODE_2D_ARRAY
192+
output.parallaxMapUVAndProgress.z = FlipBookProgress(_ParallaxMapProgress + GET_CUSTOM_COORD(_ParallaxMapProgressCoord), _ParallaxMapSliceCount);
193+
#elif _PARALLAX_MAP_MODE_3D
194+
output.parallaxMapUVAndProgress.z = FlipBookBlendingProgress(_ParallaxMapProgress + GET_CUSTOM_COORD(_ParallaxMapProgressCoord), _ParallaxMapSliceCount);
195+
#endif
193196
#endif
194197

195198
// Transition Map UV

0 commit comments

Comments
 (0)