It’s been a while since I last posted. Whilst I have a break from consultancy projects I’ve been looking into real-time hair, specifically for VR. Hair is a complex issue but there does seem to be some interesting progress by Nvidia (HairWorks) and AMD (TressFX). At the moment most public real-time applications don’t have support for either of these tools but I wanted to get a flavour of what might be possible..
Just by chance I stumbled across Hair-Farm’s ability to export hair splines to hair strips! This is a great way to export out complex hair models from 3DSMax into any real-time application, Marmoset Toolbag 2.0, Unity, UE4, CryEngine etc
Converted to polygon strips
It’s more of a hack though sadly, as the polygon strips wont camera face along their original spline, so from some angles they will appear as flat planes. Which will also impact on any kind of anistropic hair shading that you might want to do. This exercise was really to see what is possible, what the speeds are like displaying up to 1,000,000 polygons ..in stereo.
Rendering traditionally in mono is a synch with regards to FPS. Thanks to modern PC’s and GPU’s now that VR has hit the scene everything has to be rendered twice, which has an impact on speed.
On average I’ve been getting around 20-30 fps in stereo. 60-70fps in mono, rendering hair models with exported polygon strips totalling on average about 1,000,000 polygons. It’s amazing to see such complex strands rendered in VR and at fairly useful frame rates. I don’t have access to any decent anistropic hair shaders for Unity that suits this method of rendering polygon strips (nothing on the Asset store held up) Until I can find a way to re-render the polygons or find a way to make them face the camera’s viewpoint along their generated spline, anistropic shading wont work anyway.
Hopefully at some point Unity or UE4 will be able to properly integrate HairWorks or TressFX into their tools set, which will enable real-time culling, proper strand generation on the GPU with some more advanced hair shading. Plus per strand ambient occlusion, inter-reflections and self shadowing. I would love to get my hands on such tools, once integrated.
For now these shots are just slight glimpses of what is possible in Unity, minus any kind of decent shading. The multi coloured map helps bug fix any issues with strand generation, plus I’m sure it could be used for anistropic control? Vector direction? Each polygon strip has a UV map for full root to tip controls.
Currently I’m not interested in simulation, just being able to display hair in stereo, realistically! at around 60fps is the goal. Both HairWorks and TressFX should offer hair simulation, if you can supply some decent hair splines to work with.
Tip of the iceberg, hopefully more to come.