SamSuka
xyth24
xyth24

patreon


Working progress[11/4] and about hair shaders

Cheers for the hair, because it stuck me for 3 whole days and nearly drove me mad. I was nearly in despair just this morning...

The hair has 835 pieces, and the order of transparency is a mess. So according to our usual method, I have to tell the game engine PIECE BY PIECE in which order they should be rendered. That's insane....

DoA hairs typically only have much less than 100 pieces, while DW9 typically 2 to 3 hundred. But this, nearly 1000, and they are all intertwined. That means, at this end, one piece is on top, while at the other end, the same piece is down below. So what is the order?????!

If I use the usual method, it may take me hundreds of years to finish and not necessarily generate good result...

So I struggled for 3 days, and before I gave up, I found a decent way to get around the problem and make myself satisfied.

Instead of using the PBRsp_alpha shader for hair, I use the unlit-alpha shader. But that will sacrifice the color-customization of the hair, and the hair will not change color according to the environment. I think compared to the bad appearance of hair with PBRsp_alpha shader, all this is tolerable.

Though fluffy, using that shader will still lead to some other transparency problem, so that some inner hair are rendered without showing the outer hair at all.... You will look through some of the hair while they should not be transparent.

So I use another layer of hair with the plain old PBRsp_alpha shader, and change the cutoff parameter to 1, so all of the semi-transparent region are cut off, leaving only the non-transparent part as the background for the unlit-alpha shader result, so that you cannot look through.

This way, the whole thing is done.

Just a log for what I've been working hard on these days....

Working progress[11/4] and about hair shaders

More Creators