TressFX 4.0 hair rendering

Hi all!

For any that doesn’t know what TressFX is, TressFX is AMD’s hair rendering library and it was used in the new Tomb raider game (the one before the last one) and Deus Ex: Mankind Divided.

And it is open sourced.

Github page

I wanted to integrate it for about 3 years now and about 3 weeks ago version 4.0 came out in a form that allows integration into UE.

Current status of the integration:

  1. Import .tfx assets.
  2. basic component.
  3. Modified UE’s D3D11RHI to add missing DirectX capabilities.
  4. basic ShortCut rendering.

https://preview.ibb.co/fbGvGQ/Highres_Screenshot00002.png
https://preview.ibb.co/nJbUbQ/Highres_Screenshot00003.png
https://preview.ibb.co/cbUt35/Highres_Screenshot00004.png

The next step would be adding simulation and “skinning” it to a skeletal mash.

Oh one last thing…
I am keeping open sourced!

You can follow the progress here

Please note:

  1. The project is in is very initial steps and going in without debugger attached is not recommended :stuck_out_tongue: (RenderDoc too).
  2. It is not a plugin and it requires a custom engine build, currently creating a plugin is impossible due to the D3D11RHI modification needed for it to work.

That is really awesome! Good to see someone giving some of the AMD libraries some love :stuck_out_tongue: Keep it up!

What sort of performance metrics are there? Roughly, does it run pretty smoothly? Even in it’s infancy, I’d be curious if it was running nicely on a current-gen / mid-spec rig.

I’ve been focusing mostly on modifying the RHI and haven’t gotten to profiling yet.

Someday everything will be plugins, leaving only engine core as the base;
If the RHI changes aren’t too big maybe could pull request and try to convert this to a plugin?!

What I changed requires changes to all of the other RHIs.
Making a pull request is something I consider doing but I need to implement those changes first (most of them are simply ignored when not implemented but I need to double check that).

Also currently it requires changes to the scene render targets and the deferred renderer itself.
I am designing a system that will allow adding custom passes and that is what will really allow rendering plugins.

Hi @lion032 is there a chance for exporter for Blender cause AMD only have exporter for Maya?

No plans for blander plugin at this point

Awesome project, definitely will keep track of this! I wish more ppl would start to get into the outstanding libs offered by AMD, unlike this ressource raping Nvidia stuff which only is playable on 1080TIs, and even then doesnt look all too good.

Very nice! Do you have a video of how it looks like in UE4?

No video yet.

Quick update:

  1. I managed to leverage the forward rendering lighting system to light the hair model while still using the deferred renderer.
  2. The frame work for simulation is there and what is left is to stitch it all together.

You are a god sir, keep it up, finally there will be an alternative to hairworks.

Hi Lion,

I’ve cloned your branch and started looking into it. I was hoping you could give me a small explanation on how to get the hair onto the screen. I’ve imported my .tfx and .tfxbone files, filled in their required parameters and put them into the TressFXComponent, however there is no hair on screen. It appears that the proxy won’t get created unless the resource isn’t NULL, however it creates the resource after it tries to create the proxy.

Your assistance would be appreciated.
Thanks

Hello Mayne!

It is a bug, I just fixed it and will push it.

I am working on a different approach based on how apex cloth is implemented.

So quick update simulation integration is almost done!

Wow! Very good! Thanks for the update.

I’m so excited to see that someone is finally working on this. Keep up the good work

Quick update:

  1. Simulation is fully functional.
  2. Porting to 4.16.
  3. Asset rendering is now implemented using UE4 RHI interface only (should allow multi platform support out of the box, no third party graphics api dependent function calls).

Thanks for the update :slight_smile:

Hello, very good work, can you explain how you did the integration of TressFX to Unreal 4?, no plugin for 3ds Max? Thanks