Hair Rendering Simulation test

Looks very promising. Are you using a specific paper to implement all of this or are you rolling your own stuff here?

Its based on AMDs TressFX technology. With a few differences here and there so that it will work within UE4. I am not a big fan of the simulation code that AMD is using, so I am thinking of using NVidia’s solution there, or roll my own.

Is TressFX open source? Or how does that work? Don’t you have to license it?

AFAIK its open source aslong as you give them a tag line you are using it. You can download it here.

Hi everybody. I’m a developer technology engineer at AMD. I just wanted to offer my help to , if you have any questions regarding TressFX.

Latest TressFX info is here, from the recent AMD & Microsoft Developer Day in Sweden:
http://developer.amd.com/resources/documentation-articles/conference-presentations/
TressFX: The Fast and The Furry

I’d be interested to hear what you would like to see improved in the simulation code. Also, there is a new version of the TressFX sample that will be released soon that has simulation improvements.

Hi ,

Thats awesome, I am glad to have an AMD developer here. I wouldn’t mind some tips on how I would go about making TressFX work in a deferred pipeline properly. I noticed in the GDC presentation, it was touched on in one of the slides. I had major issues getting it to work in UE4’s deferred pipeline and ended up Rendering the ABuffer and KBuffer during the translucency stage (So I sort the hair with the translucent objects so they are rendered in the correct order), and then composite it into the scene color (So all lighting/shading is done during the KBuffer pass as you would do in a forward renderer).

I would also love to get my hands on the new sample at some point, it looks like, if I am reading the latest presentation correctly, that tessellation has been implemented, which I was planning to do anyways. Plus I am interested to see the updated simulation code.

The improvements I would like to see with the simulation (If it hasn’t been done already) is gravity having more impact. I am thinking of situations where the character is swimming, you could turn off gravity, have the hair move freely around, then when exiting the water you turn gravity back on and up the stiffness and spec, to make it look wet. (The second part can already be done). And maybe some wind improvements because right now it just looks really odd and artificial, but this could be improved at the wind end, by feeding in a better wind function, so that may be sufficient.

Thanks,
.

UPDATE

Current simulation code complete except for Collisions:

[video]https://drive.google.com/file/d/0BzqpBc4MrAMXb1oxenk0VzVqRU0/edit?usp=sharing[/video]

Very nice!

Couple more pictures, just playing around with some assets made in 3dsmax:


Just a test to see how rendering some foliage would go


Full body fur consisting of 200,000 strands.

And a video of my new and better furball in motion: https://drive.google.com/file/d/0BzqpBc4MrAMXaDFMZ25tcTR0dGM/edit?usp=sharing

soo awesome work!!!

Regarding proper integration with deferred, doing it forward as you have done actually feels like the right answer to me. Trying to shoehorn everything down the deferred path can be problematic. and from the UE4 rendering team touched on this a little during a Twitch broadcast a couple of months ago.
http://www.twitch.tv/unrealengine/b/518420018

At the 9:15 mark, they start talking about opaque vs. translucent (and the related topics of deferred vs. forward). Later in that same section, at the 12:04 mark, mentions how the current plan is to move the current deferred solution to be “more hybrid”. While few details were given, typically in this context “hybrid” means “send deferred-friendly materials down the deferred path, and do the rest forward”. And, in my opinion, hair would typically fall into the “do the rest forward” bucket.

At the 32:45 mark, actually talks a bit about how hair lighting would probably be done in the translucency system (and then right after that, talks a bit about the complications with integrating many lighting models into a deferred renderer).

All that is to say, your current forward solution sounds pretty sensible to me.

Regarding tessellation, the latest presentation mentions tessellation only to discuss how it should be avoided, as it will negatively impact performance. A “pure” vertex shader solution for hair geometry is much faster. In practice, you rarely get curvature issues unless the hair is very close. And if that use case is important in a particular game, it would still be better just to author more vertices per strand rather than use hardware tessellation.

Outstanding!

Only thing with the sim that I think could use a little work is the slightly over-damped feel of the hair movement. Its got a slightly underwater feel to me.

But I seem to remember the TressFX in Tomb Raider being like this too, so it might be a limitation of the technology.

Hi , thanks for clearing that up. The one twitch stream video I did not watch appears to answer my questions, I will give it a watch asap. As for the tessellation, I have to say I quickly thumbed through the presentation during a work meeting, so I was under the impression that it was saying to avoid the Geometry Shader, did not realize it was Tessellation as well, so thanks for clarifying that. I will have to give it a more in depth look at some point.

I have to say I actually prefer the way TressFX loads in the data, especially for authoring, I was able to whip up a quick script in 3dsmax to export the strands from the Hair and Fur modifier.

That may also be due to the settings set for local/global shape matching, stiffness and damping. For the hair I left it as default from the TressFX demo, for the furball I deliberately gave it a low gravity like effect, but you can increase the stiffness and such to give it a more realistic result.

This is actually fantastic. Well done on the great work…it’s really improving quickly.

Do you plan on releasing this?

Eventually, I am planning on building some in editor tools first and the ability to use materials with the hair with some special hair specific material functions. Then I will release the source. It won’t be in a due to additions to the main rendering pass.

Hi . Congratulations for your job. It´s very great.

You will provide tutorials teaching us to make this realistic hair? Thanks

Thanks, I’ll be doing one better, when I have completed the Editor components, and implemented some optimizations, I will release the entire source code, and include the tool to extract the hair from the Fur modifier in 3dsmax and a short document on how to produce the hair, not that I am an expert at authoring the hair, far from it.

Wow!
This just looks amaizing!
Looking forward to it :smiley:

Thanks , Yes , use the enw TressFX 2.0 the one provided to you, it willl be the best solution because the consoles use it and it runs like charm on them (Tomb Raider Remastered Edition). It would be wiser to use it.

Well I need to wait for the new sample to be released, I will update the code when its released.