I am trying to create a lit shader, that behaves just like always, but - under some conditions - is pure black.
I created a surface shader and adapted the surf function:
if (condition < 0.5) {
o.Albedo = 0;
o.Metallic = 0;
o.Smoothness = 0;
o.Alpha = 1;
} else {
o.Albedo = c.rgb;
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
The result looks like this:
As you can see, it kind of works, but the black area is still influenced by lighting.
What is the simplest way to achieve a pure black that is not influenced by lighting? Do I have to use vertex+fragment shaders or can surface shaders do this?
I’m using the deferred rendering path.
(does the answer differ for forward rendering?)