cancel
Showing results for 
Search instead for 
Did you mean: 

Transparency Best Practices for Universal Render Pipeline on Oculus Quest

scottmichaud
Explorer
In the "Down the Rabbit Hole w/ Oculus Quest" post for the Oculus Quest, the following is mentioned:
Finally, discarding a fragment in the middle of a fragment shader (via discard, alpha test or clip()) causes the GPU to re-render the entire tile, and should be avoided in all shaders.

I'd normally post the link but my account is too new, so you'll need to Google for it. It should be the top result for "down the rabbit hole oculus quest".


How would you go about conditionally rendering fragments with the URP and Shader Graph?


Specifically, the game's design has regions where objects are not rendered.


Imagine you have a plane. That plane can move. All shaders receive that position and only draw whatever is on one of the two sides. This is currently done in an Opaque PBR shader graph with an alpha clip value of 0.5. The shader sets the alpha to 0 or 1 depending on the world position relative to the plane's world position.


Don't worry about the holes that are caused by looking through partially-rendered objects and out the back face. The rendering artifacts actually play into the art style.

  • What's the optimal way to design that?
  • Is it better to use a transparent material than an opaque material with a clip value?
  • What does "in the middle of a fragment shader" mean?
Again, we already have a look that we like, and it seems fairly high performance on the Quest, but is there a better way?


1 REPLY 1

AyhanRoutine
Explorer

I know this is pretty old, but did you find out something regarding the "transparency vs. opaque with clip value" matter?