Creating a hair shader
Posted: Fri Feb 10, 2017 9:01 am
Hi there,
I'm very new to the world of shaders, but am loving the sudden power that ASE has given me. I'm trying to achieve something which I am unsure is possible in ASE as it stands: Making an effective hair shader.
If anyone has played with adding hair to characters, they will have come across these problems:
1 - The cutout shader (Masked in ASE) looks simply awful, nasty hard edges to hair:
2 - The fade shader looks wonderful with soft alpha blending of hair, BUT has Z-sorting problems (notice the fringe)
What I'm trying to achieve is to render the faded version then layer the cutout version on top. The idea being that the fade version will give nice soft edges whereas the cutout will fix the z-sort problems in more solid parts of the hair. Something like this: (this is a mock up using 2 models with different shaders on them)
(The Fade pass is 2 sided, the cutout pass is 1-sided)
Of course if there was some way to make a fade shader respect z-sorting then none of this would be necessary.
If anyone could let me know if this is possible, or of a better solution, I would be most grateful.
Thanks
I'm very new to the world of shaders, but am loving the sudden power that ASE has given me. I'm trying to achieve something which I am unsure is possible in ASE as it stands: Making an effective hair shader.
If anyone has played with adding hair to characters, they will have come across these problems:
1 - The cutout shader (Masked in ASE) looks simply awful, nasty hard edges to hair:
2 - The fade shader looks wonderful with soft alpha blending of hair, BUT has Z-sorting problems (notice the fringe)
What I'm trying to achieve is to render the faded version then layer the cutout version on top. The idea being that the fade version will give nice soft edges whereas the cutout will fix the z-sort problems in more solid parts of the hair. Something like this: (this is a mock up using 2 models with different shaders on them)
(The Fade pass is 2 sided, the cutout pass is 1-sided)
Of course if there was some way to make a fade shader respect z-sorting then none of this would be necessary.
If anyone could let me know if this is possible, or of a better solution, I would be most grateful.
Thanks