I’m rendering particles in a compute shader in XR.
For performance, we’re doing cpu-side frustum culling using
GetStereoProjectionMatrix to transform the particles into clip space then cull against -1:1.
For Single-Pass rendering, this doesn’t work because we would need a union of the projectview matrices in order to not overcull on one of the eyes by assuming a shared projection. Is there a way to get this unioned frustum? If not, is there a recommended approach for cpu-side culling?
That looks perfect, thanks. Does it work with Built-In RP? That’s what we’re currently using.
One more question: What is the culling matrix, vs the projection matrix In the ScriptableCullingParameters? The docs just say ’ cullingMatrix The matrix for the culling operation.’
I am not familiar with BiRP to make a comment. The API is an XRSDK system API, which should work in BiRP. However, I am not sure about the workflow there, and I am not sure how to configure the pipeline to use that culling data.
Hopefully someone who is more knowledgeable with BiRP can make a comment.
After having tried it out, it works just fine with BiRP.
Only thing I’m unsure of is whether passing in 0 for the cullingPassIndex is valid for XRDisplaySubsystem.GetCullingParameters, but it seems to be working well-enough.
1 Like