Hey,
I’m currently trying to implement a very efficient vignette effect that doesn’t require post-processing to make it work on mobile VR. My general idea how it should work is a full-screen mesh (basically a quad but with a hole in it). This way I can just rescale the mesh to adjust the strength of the vignette. The mesh would feature 2 materials. One fully opaque material for the outer part of the mesh and one transparent material for the inner part of the mesh. My idea would be to write to the Z-Buffer for the outer part to basically have everything else rejected. This gives me enough of a performance boost to make up for the overdraw caused by the inner transparent part of the mesh.
So far I managed to make this work but I ran into many problems with sorting. It wasn’t enough to set a low render queue and world space UI also ruined everything again…
I came up with adding Offset -999999999, -999999999 in the shader and that fixed it. From what I understand this is not reliable and going to fall apart because I’m abusing a feature that isn’t supposed to be used like this.
Should I look into a stencil shader instead? Are they efficient on mobile? Or is my hacky approach actually a good enough solution? Any other ideas?