Transparent Material see through/bleed through related to additive forward passes

Hey everyone, I searched around the net for this issue to no avail. The issue is regarding transparent materials bleeding though when more than 1 light is illuminating an object. I attached an image illustrating the effect. I don’t know if this is a limitation of Unity’s standard lighting model, but it is definitely related to it.

In the first image, a hair object with the standard shader set to fade mode with an alpha channel made of multiple polygon planes is lit with 1 directional light, and the effect is as intended.

In the second image the same object is lit instead by 2 directional lights at half the intensity, which should give the exact same image as the first, instead there is a lot of bleed through.

This issue doesn’t seem to be related to Z-sorting, as I combined the hair plane objects in a particular order so that they were layered correctly, and that shows since the first image is correct. The issue seems to be related to how unity applies lighting to an object on any additive lighting pass other that the main directional light, as i can also achieve the same effect with only 1 point light illuminating the object as well.

I am very surprised I haven’t been able to find any other people mentioning this issue, as it would effect any character hair made with layered polygon planes, that has more than 1 light illuminating it, or any other situation with overlapping transparent objects with more that 1 light.

Any help/insight would be appreciated.

Even on the first screenshot, you can see the same issue, although it isn’t as noticeable.

To be it looks like some of the hair planes are passing through each other. You need to make sure none of the hair planes intersect each other

Thanks for the response TTTTTa. You are right in that when 3 separate plane objects all have the same transparent material and are spaced out, unity will render them correctly with any number of lights, however this is because unity knows the distance to each individual object. However, if the same 3 planes are combined as one object in a 3d package, and imported, they only behave correctly when there is just one directional light in the scene. adding one other light or changing the one light to a point light reveals the same artifacts. Ill have to make another screenshot illustrating that when I get a chance.

Here is an image which I hope clearly shows the issue.

You really need to use a proper hair shader for this. Having multiple layers of transparent will give you problems.

The free Blacksmith asset from Unity has a hair shader you can use:

I actually did look into the blacksmith shader when I was trying to find a solution, but it seemed silly to get a custom shader for polygon hair with is so standard and basic. I made this post not only to see if there was an obvious solution to this, but to make others aware that out of the box, there seems to be no way to properly light a character that uses standard layered polygon hair with anything other than 1 directional light.

TLDR: If there are any shader/lighting gurus out there: additive light passes seem to incorrectly add their light to any transparent object within a merged polygon group, even if they are completely obscured. This happens on both the standard shader with transparency/fade enabled, and even transparent legacy shaders.