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 :
- Retrieve the standard shader,
- Retrieve a custom
Core.cginc
I included in theDEFERRED
pass of the custom shader, - Create a custom Editor script to handle the Shader and my custom parameters,
- Selecte
Fade
as the rendering mode of the shader to handle transparency, using the custom editor script, - Create a custom file replacing
UnityStandardInput.cginc
and changed the references in theCore.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 ofAlpha
declared inUnityStandardInput.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.
Thanks for your help in advance.