Unity-Technologies / EditorXR

Author XR in XR
Other
928 stars 166 forks source link

Graphics.DrawProcedural not working in EditorXR view #491

Closed obviousjim closed 6 years ago

obviousjim commented 6 years ago

Congrats on EditorXR- it's amazing!

I'm using it in conjunction with @keijiro's Pointcloud viewer PCX (https://github.com/keijiro/Pcx). The Compute Buffer based pointcloud drawing does not work in EditorXR + Oculus.

To reproduce, import the Pcx package into an EditorXR project and open the Swirl.unity scene (https://github.com/keijiro/Pcx/tree/master/Assets/Test).

When entering Window > EditorXR and looking in the headset, the points seem to have some strange depth buffer occlusion glitch happening and do not show up correctly. By contrast, the mesh-based renderer works well.

My hunch is it has something to do with Graphics.DrawProcedural() used to render the points. Perhaps command buffers are required for procedural render paths to to work with EditorXR?

The scene works in playmode in VR and also appears correct inside of the 2D EditorXR preview window.

I'm running:

Thank you!

obviousjim commented 6 years ago

For anyone else experiencing this issue, i was able to solve it by enabling Shared Depth Buffer on Player Settings > XR Settings > Virtual Reality SDKs > Oculus under the disclosure triangle.

Easy fix!

shareddepthbuffer