I’ve been doing something which requires quite a lot of rendering transparent objects to texture.
These objects are used directly in the scene with standard alpha blending (“Blend SrcAlpha OneMinusSrcAlpha”). In order to get the correct alpha when rendering to texture, I need to use pre-multiplied alpha (“Blend One OneMinusSrcAlpha”).
Is there any way to change the blend mode from a script, so I don’t have to duplicate every single shader just to change one line?
The standard shader has properties called _DstBlend and _SrcBlend which you can modify to get what you want. It’s basically exactly like @Juho_Oraveinen answer, but it’s built-in.