Skip to content

Fix incorrect additional velocity for alembic #5304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand All @@ -170,13 +167,21 @@ 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

#if defined(_ADD_CUSTOM_VELOCITY) // For shader graph custom velocity
effectivePositionOS -= GetCustomVelocity(inputMesh);
#endif

#if defined(_ADD_PRECOMPUTED_VELOCITY)
effectivePositionOS -= inputPass.precomputedVelocity;
#endif

float3 previousPositionRWS = TransformPreviousObjectToWorld(effectivePositionOS);
#endif

Expand Down