Creating a hair shader

Node-based Shader Editor

Creating a hair shader

Postby SecretAnorak » 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:
Image
2 - The fade shader looks wonderful with soft alpha blending of hair, BUT has Z-sorting problems (notice the fringe)
Image
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)
Image
(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
SecretAnorak
 
Posts: 2
Joined: Sat Jan 28, 2017 11:10 am

Re: Creating a hair shader

Postby Ricardo Teixeira » Fri Feb 10, 2017 12:01 pm

Hello,

Thank you for using the Amplify Shader Editor, we really appreciate the support. Unfortunately, we currently don't have a specific hair example that we can share. We will definitely include one in future updates, I'll be sure to let you know as soon as it's available.

I will pass this on to the ASE developer and, since you already posted it on the official thread, we will get back to you there.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Creating a hair shader

Postby SecretAnorak » Fri Feb 10, 2017 12:30 pm

Thanks for the answer.

Turns out I could achieve what I wanted by making both shaders in ASE and a using little bit of judicial Cut and Paste afterwards.

Great product, can't wait to see where it goes.
SecretAnorak
 
Posts: 2
Joined: Sat Jan 28, 2017 11:10 am

Re: Creating a hair shader

Postby Ricardo Teixeira » Fri Feb 10, 2017 1:06 pm

SecretAnorak wrote:Thanks for the answer.

Turns out I could achieve what I wanted by making both shaders in ASE and a using little bit of judicial Cut and Paste afterwards.

Great product, can't wait to see where it goes.


Thanks, happy to hear it ;)
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Creating a hair shader

Postby 3d artist1987 » Wed May 03, 2017 4:53 am

Any update?
3d artist1987
 
Posts: 36
Joined: Wed May 03, 2017 4:51 am

Re: Creating a hair shader

Postby Ricardo Teixeira » Wed May 03, 2017 9:17 am

dev19872014 wrote:Any update?


On hair related shader samples? Unfortunately, not at the moment. We will register your interest and contact you as soon as we add any.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Creating a hair shader

Postby 3d artist1987 » Mon Jun 12, 2017 7:18 am

Thanks for reply
3d artist1987
 
Posts: 36
Joined: Wed May 03, 2017 4:51 am

Re: Creating a hair shader

Postby miecz » Thu Sep 06, 2018 12:26 pm

Hello,
Is there a possibility to use temporal AA dither in Amplify Shader Editor? There is a well known concept of using temporal AA and dithering for creating semi transparent objects (like hair). I believe that Unreal's standard hair shader uses it.

I've managed to create a hair shader with very simple alpha dithering. It gives 50% opacity. It's a quite dirty trick using post process (CTAA from Livenda). I simply dither the hair alpha (add a "dithered border" on top of regular alpha cutout). My shader inverts the dither pattern every 1/30th second. This way it gets blended with previous frames via TAA and creates an illusion of transparency. Please see the attached image.

I was wondering if there is any way of replicating Unreal's hair shader in Amplify Shader Editor (maybe when combined with a dedicated post processing?).
Attachments
Hair Example.jpg
Hair Example.jpg (184.21 KiB) Viewed 4904 times
miecz
 
Posts: 4
Joined: Thu Sep 06, 2018 12:08 pm

Re: Creating a hair shader

Postby Ricardo Teixeira » Thu Sep 06, 2018 12:50 pm

miecz wrote:Hello,
Is there a possibility to use temporal AA dither in Amplify Shader Editor? There is a well known concept of using temporal AA and dithering for creating semi transparent objects (like hair). I believe that Unreal's standard hair shader uses it.

I've managed to create a hair shader with very simple alpha dithering. It gives 50% opacity. It's a quite dirty trick using post process (CTAA from Livenda). I simply dither the hair alpha (add a "dithered border" on top of regular alpha cutout). My shader inverts the dither pattern every 1/30th second. This way it gets blended with previous frames via TAA and creates an illusion of transparency. Please see the attached image.

I was wondering if there is any way of replicating Unreal's hair shader in Amplify Shader Editor (maybe when combined with a dedicated post processing?).


Grettings,

In addition to common shader types ASE also provides a Template System for increased flexibility, definitely something to consider if you are comfortable with shader development.

We do include a Dither node to get you started; I recommend looking into the Post-Processing stack Temporal AA solution.

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Creating a hair shader

Postby miecz » Thu Sep 06, 2018 1:25 pm

Hi!

I'm not that good at writing shaders, I'm afraid :-). Yes, I am using Dither node provided by Amplify Shader Editor (that example was done with Amplify Shader Editor). It gives really promising results.

I think the only element I'm missing is to be able to move the dither pattern across the screen. If I would have something like a panner for the Dither node, it would most probably work (with CTAA post processing - it doesn't seem to work with Unity's build in TAA).

I will give it a try and do a UV based dither with a panner, it may work as well (but screen-space dither will probably always look better).

Thanks!
miecz
 
Posts: 4
Joined: Thu Sep 06, 2018 12:08 pm

Next

Return to Amplify Shader Editor

Who is online

Users browsing this forum: Google [Bot] and 6 guests