Making a "flashlight"

You should always use discard with great caution, as it alters the GPU’s ability to optimise. To be on the safe side it’s best to not use discard at all. If you really need it, you should check if it results in any perf loss on the target platform. You can do this quite easily by commenting out the discard; statement in the shader, hot-reload it, take it back in, hot-reload etc.

Google search for discard and perf

2 Likes