Maybe it just needs to be tested on target devices. For example, I recently ran an example with hundreds of models using discard in the shader on a mid-priced 2017 phone and it worked quite well. Depending on the graphics and the required sharpness of the image for optimisation, sometimes it is more efficient to reduce the render resolution and render to a texture and then upscale it to the screen than to load a low-performance device with calculations for a retina screen.
As an example with discard
, if
, for
loops and double rendering because of shadows you can look at GitHub - Dragosha/defold-light-and-shadows: Pack of shaders to make light and shadows in Defold. (online example: Light and Shadows 0.3).