Jump to content
  • Advertisement
Sign in to follow this  

(Physically based) Hair shading

This topic is 929 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys.

I'm playing around with hair rendering these days and have implemented the shading model that is used in AMD's Tress FX sample which I believe is the kajiya-kay model.

However having done that I'm not really satisfied with the results. Especially after using a physically based GGX for my regular shading.

UE4 has recently worked and presented something that can be seen in this Video here:

 which looks really nice.

I've also no idea how to use my image-based-lighting with this Kind of BRDF since using my ggx convoluted probes the normal way looks very wrong.


Since the kajiya-kay diffuse term uses something like

float cosTL = saturate(dot(hairTangent, LightDirection)); // dot(T, L) instead of dot(N, L)

I was thinking maybe use the Tangent as the lookup vector for the irradiance map and something similar for the glossy env map but that also didn't seem to work out of the box.


Brian Karis told me on Twitter he was using an approximation that square-enix uses however I could not find anything about that on the Internet.

Does anyone know of a physically based hair model (marschner?) that can be used for realtime shading ?

And does somebody have an idea how to solve the IBL Problem ?


Update: After watching the Video again I found the paper his shading model is based on (not sure I'll be able to translate that into Code but I'll try)


Edited by lipsryme

Share this post

Link to post
Share on other sites

Not hair exactly, for for anisotropic materials in general:

IIRC the Disney BRDF paper that all the game PBR papers seem to cite, includes two forms of GGX -- the common (isotropic) one, but also an anisotropic version.

I'm using that at the moment, but yeah, now IBL is a problem. I allow importance sampling at runtime, which solves it, but it's not really feasible except as an "Uber" detail option.


IIRC (again), the frostbite PBR presentation introduced a nice hack, which just bends the IBL lookup vector based on the anisotropy data, which is a completely empirical model rather than physically-based... but it creates the right impression for the viewer and is better than doing nothing. You can also fiddle with using an anisotropic texture filter and passing your own ddx/ddy values into TextureCube::SampleGrad to try and blur your IBL probe along the anisotropy direction (just more hacks though).

Share this post

Link to post
Share on other sites



In fact, I did not solve the IBL problem yet. In my knowledge The Order uses tangent irradiance maps



We didn't end up shipping with that, since we removed all usage of SH from the game towards the end of the project. Instead we applied specular from the 9 spherical gaussian lobes stored in our probe grid.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!