- Home /
Custom shader remove shine
I'm quite new to shaders and have written a very simple one for low-poly terrain, however when viewed at an angle the faces get a sort of white shine. After some research, people have said that if you set alpha to none on a texture, unity just interprets that as white alpha. I don't want any sort of brightness added to my textures at an angle, only shadow. It is my understanding that smoothness and metallic are set to 0 unless specified in a custom shader, so I'm not sure how to go about fixing this. Would it have something to do with alpha cutoff? I have no idea.
Answer by Namey5 · May 15, 2020 at 03:42 AM
Assuming this is a surface shader, it will probably be using the Standard lighting model by default, which is physically based. As part of this, in reality no object is perfectly diffused, so a small amount of specular lighting is allowed to pass through at grazing angles like you see here. To fix this, you'll need to use a different lighting model;
//Change this
#pragma surface surf Standard
//To this
#pragma surface surf Lambert
...
//Also need to use a different output struct;
void surf (Input IN, inout SurfaceOutput o)
{
Answer by milamila · Nov 03, 2020 at 06:11 AM
thank you! worked for me, thanks so much , finally found out what to do - only with your help