NVIDIAGameWorks / Falcor

Real-Time Rendering Framework
https://developer.nvidia.com/falcor
Other
2.71k stars 496 forks source link

Invalid motion vectors for dynamic object in GBuffer / defaultVS #358

Open kopaka1822 opened 1 year ago

kopaka1822 commented 1 year ago

I was wondering why the motion vectors for animated scenes looked wrong when taken from the GBufferRaster, but they were correct in the VBufferRaster.

I replaced the respective code in the Source/Falcor/Scene/Raster.slang with the motion vector code from the VBuffer Before (Raster.slang ~97): uint prevVertexIndex = gScene.meshes[instance.geometryIndex].prevVbOffset + vIn.vertexID; After the fix: uint prevVertexIndex = gScene.meshes[instance.geometryID].prevVbOffset + vIn.vertexID;

and now it works.