Unity-Technologies / com.unity.demoteam.hair

An integrated solution for authoring / importing / simulating / rendering strand-based hair in Unity.
Other
710 stars 96 forks source link

Unreal like non physics Static mesh LOD and Auto Hair Card LOD #94

Closed Aydindeveloper closed 1 month ago

Aydindeveloper commented 1 month ago

image

hair has 2 costs. Rendering and Physics. Physics is currently never turned off even though it is LOD. I see that it always runs compute pass. It should not be a static mesh with completely closed physics.

The cost of curve sampling is to reduce the curve sample points. And I think their root meshes should be loaded as separate meshes. There seems to be a LOD pass right now. As far as I can see in render stats, the tris number does not change. They are all the same high polygon mesh. I don't know what is being calculated behind the scenes with compute shader. But it feels like LOD is not very useful.

fuglsang commented 1 month ago

Hi. So, this package contains a strand-based LOD system that is supported uniformly by both physics and rendering, featuring seamless transitions, minimal authoring setup. The goal here is to offer a LOD solution that is both fast and physical, and which "just works", without requiring artists to think about strands or cards. Going back to cards is not something planned.

Future improvements to the LOD system are planned of course, some of which will enable further rendering optimizations. You are correct that currently the dispatched index count is the same also for lower LODs, which is a waste of the vertex stage, despite most segments never reaching the fragment stage. The planned improvement in this case is to place a LOD-based upper bound on that dispatch. If you dig a little bit more, I think you'll be able to spot where. :)