OpenXR + Meta Application Spacewarp + Entities.Graphics - Warping/Tearing issue on non static entities. Any tips?

Hello people ,

Does anybody knows if Meta’s Application Spacewarp for standalone quests conflicts in some way with Entities.Graphics ?
I have 1000 physic bodies driven by ecs systems, reacting to the player hand tracking (ECS physic hands runing on OpenXR with Meta features) It works awesomly well but I’m limited by gpu ressources. I’m looking into Application spacewarp to increase the numbers.

ASW works for everything set to static in the subscene. It seems to also work with normal gameobjects moving too. But everything else gets really warped and teared up like crazy resulting in a big jittery blob. Even objects not moving at all (but not set to static).

Here’s what it looks like : https://www.youtube.com/shorts/WA5jhJyV8cE
The non moving spheres are normal gameobjects. But if I set them in the subscene for baking, the issue is there on these too.

It feels like the motion vectors aren’t registered correctly by the shaders. The warping/tearing looks like the pixels are trying to reach the origin of the world sometimes. Like if the motion vectors were all pointing to 0, 0, 0.
The shaders comes from the URP fork as advised in the Meta documentation. And I double checked the compiled shaders, I can see references to Application SpaceWarp and Motion Vectors registering passes in there.
Spacewarp works for sure, the framerate is 90 without it and it fall to 45 once it kicks in, the environment and normal gameobjects are smoothly rendered.

Any idea ?

Aight, as always, after days digging everywhere to find a solution, it’s only after posting that I find something. :sweat_smile:
Putting the solution here for people stumbling accross the same issue :
In RenderMeshUtility.cs in the Entities Graphics package, delete the first and 3rd lines so USE_HYBRID_MOTION_PASS is always declared.

#if HDRP_10_0_0_OR_NEWER || URP_16_0_0_OR_NEWER
#define USE_HYBRID_MOTION_PASS
#endif

Source : Motion Vector is broken for entities

Damn Application spacewarp is impressively efficient. For 1000 physic entities each with 3 vfx graphs trails roaming and colliding around, I went from 99% gpu usage at level 4 on Quest 3 to 50-60% usage at level 3. Allowing me to crank up the number to 2000 entities. So smooth !

2 Likes