The Canvas Renderer has a checkbox labeled “cull transparent mesh”. The documentation says this allows geometry emitted by the renderer to be ignored when alpha is near zero.
What are the practical effects of this? Does it affect raycasting or user interactions? (e.g. does it make a button unclickable?) When should you use this or not use this?
I too was wondering about this. It appears to simply be a minor optimization option, to use when you need it. I found a tweet by a user who shows a screen shot of its practical effect (it can essentially save you a draw call).
I’m still unsure about any ramifications or consequences to using it (such as hit testing). I’d say it’s safe to just ignore it and leave it unchecked until you feel you need it (as a final optimization pass).
That doesn’t really help. Regardless of when during development you start checking that box on some objects, you need some rule for determining which objects should have it checked and which should not.
If the answer is either “all of them” or “none of them” then the checkbox shouldn’t exist in the first place; Unity should just do the right thing automatically because it’s always the same. So there must be some situations where it should be checked and some where it should not.
I assume this culling test has a cost, which is why it’s not enabled by default/done automatically.
You have to profile, find potential expensive renderings of transparent meshes that are not visible.
I just used it for a vignette that is only used in some situations but it was hidden the rest of the time by setting alpha to zero. It was taking 1.5ms to render in an older device (while being completely invisible) and now it’s virtually zero.
I wouldn’t bet my life on it but having been fiddling with ui shaders recently on 2018.4 the impression i got was that this checkbox toggles a shader feature to cull pixels in the fragment shader with very low alpha value