- Home /
Question by
LTonon · May 17, 2019 at 04:33 PM ·
2dshaderoptimizationshader programmingart
How to make Standard Shader _Color property be Per Instance Data?
I've been working in a 2D game that uses the standard shader in a material to simulate lighting, and there are a lot of instances of objects using this material with different colors. Since my game is going to be a mobile one I want to optimize it as much as I can and I've seen that different colors in a material actually creates new instances of the material unless I'm using MaterialPropertyBlock and a Shader that declares the _Color property as a Per Instance Data... The problem is: How to change Standard Shader to do so? I have no prior experience with shaders, so I'll be glad with any help, thanks!
Reference to where I've seen the optimization tip: https://docs.unity3d.com/Manual/GPUInstancing.html
Comment