Progress update & Simulation imprecision


The past days i’ve been working quite a lot on the new tressfx renderer and started testing tressfx with characters and animation.

When doing those animation tests, i immediately ran into a very annoying issue that is fixed now.
If you try to import hair in “normal” scale (1 unit = 1 meter) you will see tressfx simulation just failing, all hair will just fall down when starting play. It will lose its shape.

I could not track down the real problem that is causing this (most likely floating point imprecision on asset import and simulation local shape constraints), but i fixed this problem by letting the simulation run in another world space.

The simulation now ALWAYS uses the hair in uniform 1 scaling, while the render settings can be set was you want.
So, for my example i got normal sized human hair modeled with blender, i import it with scale 100x.
Now i prepare the gameobjects for my scene and set the scale of the tressfx gameobject to 0.01.

What happens now on simulation is it takes the tressfx gameobject’s model rotation matrix with uniform 1 scaling (so, the hair is 100x scaled up from the import) and on rendering i transform all hair vertices from world to local space, scale them up and transform them back into the world space.

This works quite well, simulation runs stable and rendering looks like it would be simulation in the 0.01 scaling 🙂


So, for the general update part of this post i updated the TressFX repository on github, it now got partial tressfx 3 feature integration and this simulation fixup i mentioned before.

Skinning will be delayed for later, at the moment my priorities are improving the hair rendering and skinning will be a bit more complex than i thought due to the integration into unity without much overhead. No fixed date here yet, just wait and get some tea. Sorry 🙁

The new tressfx renderer is almost done, the integration into unity’s lighting system is pretty much completed, there are only some shadow functions missing, but i guess it’ll be relased soon.
I have not decided yet if it will be open source, im still trying to figure out which licensing model will be the best (but most likely it will be free for personal use and only commercial use will need a license).

This renderer will support the following features:

  • Full integration with unity lighting (spot, point and directional lights)
  • Up to 4 shadow casting lights
  • Unlimited amount of non-shadow casting lights
  • Custom shadow mapping for directional lights with very high-resolution
  • Self-Shadowing
  • Order independent transparency
  • Level of detail, Hair density control
  • Multiple hairs per scene without much rendering overhead
  • Whole hair rendered in 2 drawcalls, no more overhead :3

Most of this stuff is already implemented and im only doing final tweaks and performance improvements, so again get some tea if you’re waiting for that rendering 🙂

To finish this dev post here’s a new screenshot from the current version of the new renderer:


1 thought on “Progress update & Simulation imprecision

Leave a Comment