# Change alpha value of the Standard Shader

I want to edit the Standard shader provided by Unity in order to change the alpha value of a fragment (pixel) according to given parameters I pass to the shader.

For now, thanks to this link, I have been able to :

2. Retrieve a custom Core.cginc I included in the DEFERRED pass of the custom shader,
3. Create a custom Editor script to handle the Shader and my custom parameters,
4. Selecte Fade as the rendering mode of the shader to handle transparency, using the custom editor script,
5. Create a custom file replacing UnityStandardInput.cginc and changed the references in the Core.cginc file.

But now, I can't seem to figure where to change the alpha value of the fragment. I've tried a ton of possibilities in the Core.cginc file. Changing the color and the map of the Albedo works, but I can't find where the final alpha value is set.

I've browsed the files in the CGIncludes folder in the builtin shaders of Unity.

• UnityStandardCore.cginc : Already tried many possibilities (including the returned value of Alpha declared in UnityStandardInput.cginc
• CustomInput.cginc : Alpha function, no effect

Since the files are huge, I don't feel it will be useful to copy-paste them here.

I have been able to solve it myself. In the end, you will need at least 6 files :

In all these files, replace all the references to the UnityStandardXXX by your custom files. Don't miss any !
Then, in the Core.cginc file, I've edited the FragmentSetup function to change the value of the alpha variable : half alpha = Alpha(i_tex.xy) ;