-
-
Notifications
You must be signed in to change notification settings - Fork 476
Motion Vectors
MVs are rendered using Camera Motion Vectors (CMVs), and then Per Object Motion Vectors (OMVs)
They are needed for motion blur and for AA solutions such as TAA, and DLSS which I'm hearing very positive things about.
Sadly, water does not get included in CMVs, because they are computed from camera velocity and scene depth, which does not incude water. I cant get any combination of shadergraph settings to work.
Even more sadly, the situation is worse for OMVs. Water can be coerced to render into it by changing OceanBuilder to set the motion vector setting to per object, then enabling "Transparent Renders MVs" in the SG. Unfortunately the per-object MVs take the change in transform into account, and when the ocean moves or changes scale the MVs get huge spikes, visible as 1 frame glitches. We'd probably need to change our meshing solution to fix this i think.
Possible solutions:
- Write out MVs ourselves, using a render hook? We just need our water to be included in CMVs, i.e. using the correct depth. UPDATE: its not obvious where this hook can be done. https://docs.unity3d.com/Packages/[email protected]/manual/Custom-Pass-Injection-Points.html
- Somehow fix the aforementioned spikes. Probably changing the meshing approach.