diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index bd794ecbbeb..a9d7e0fce71 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -357,6 +357,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Reduced the number shader variants for the volumetric clouds. - Fixed motion vector for custom meshes loaded from compute buffer in shader graph (like Hair) - Fixed incorrect light list indexing when TAA is enabled (case 1352444). +- Fixed Additional Velocity for Alembic not taking correctly into account vertex animation ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl index b9dd586bfdb..914c40b2fc9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl @@ -141,9 +141,6 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu #endif float3 effectivePositionOS = (hasDeformation ? inputPass.previousPositionOS : inputMesh.positionOS); -#if defined(_ADD_PRECOMPUTED_VELOCITY) - effectivePositionOS -= inputPass.precomputedVelocity; -#endif @@ -170,6 +167,10 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu previousMesh.positionOS -= GetCustomVelocity(previousMesh); #endif +#if defined(_ADD_PRECOMPUTED_VELOCITY) + previousMesh.positionOS -= inputPass.precomputedVelocity; +#endif + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.positionOS); #else @@ -177,6 +178,10 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu effectivePositionOS -= GetCustomVelocity(inputMesh); #endif +#if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= inputPass.precomputedVelocity; +#endif + float3 previousPositionRWS = TransformPreviousObjectToWorld(effectivePositionOS); #endif