I have Questions about Standard - Transparent shader and Mobile/Alpha Blended Shader (actually Mobile/Particles/AlphaBlended is collect.)
I’m making mobile game and Try to choose one for making transparent object.
object is just a quad (literally quad). texture is a ring image with no color (just black and white). with this I can draw a ring.
Here are my questions.
- Does Standard shader (with Transparent Rendering Mode) costs a lot much than Mobile/Particles/AlphaBlended ? (I want to tell whether it does or not but I don’t know shader code at all hmm…)
- Is there a simple shader which supports GPU-Instancing? Simple means light (need less cost)
- Is there a way to figure out which shader is heavy or not ? If there is a simple technique, I want to know it
1.) Yes, standard shader is huge, but it’s also pretty well optimized. But the Particle Transparent is ridiculously simple, so it tends to run fast.
2.) I believe just about all shaders support instancing unless you stop them. You just have to make sure you use the sharedMaterial property on the renderer instead of the material property.
3.) The easiest way is to look at the source and see how complicated it is. Lines of code isn’t a bad metric, but a 30 line addition shader will typically run faster than a two-line shader with a square root.
Finally, two more points to consider:
1.) The shader’s performance isn’t a fixed thing. It’s more like a performance modifier on your assets. If you have poorly-optimized assets, no shader will make them render quickly.
2.) See here, courtesy of XKCD.