Hi! I’m currently confused as to how I could modify an alpha cutout shader to ignore lighting. I’ve read that it’s something to do with using the surface pragma which enables interaction with Unity’s lighting effects, however adding fragment and vertex pragmas just breaks the program. I’ve been searching for hours and tried many different combinations but to no avail.
Basically, I am trying to merge this cutout effect (code below) with Unity’s in-built Unlit/Transparent shader. This is for a circular healthbar displayed on an in-game computer screen and thus it needs to appear like it’s lit-up (and not dark from lack of Unity lighting).
Below is the current shader I am using. Any help would be greatly appreciated!
There are two ways without use of light. The first is to write HLSL a shader. (an example see below). The second - to add function of processing of light to “surface” shader. Your shader, most likely, is used in mobile devices. Therefore I will write HLSL with for this purpose:
@GainPlay That happens because everything drawn by this shader does not write to the depth buffer (and therefore is not Z sorted). This is done by this line: ZWrite Off // don't write to depth buffer. Just comment it out.
PS: the unity login system is haywire on this answers platform. Even with 3rd party cookies disabled in chrome I can’t log in, and can’t post comments. It only logs me in when I click on Post Answer or Ask Question.