GPUOpen-Effects / TressFX

DirectX 12 and Vulkan libraries that provide convenient access to realistically rendered and simulated hair and fur
MIT License
766 stars 129 forks source link

support inverted depth #10

Open mrgreywater opened 8 years ago

mrgreywater commented 8 years ago

TressFX currently uses D3D11_COMPARISON_LESS_EQUAL for z-order comparison. [Reference]

The z-ordering should be optionally D3D11_COMPARISON_GREATER_EQUAL; either via preprocessor definition or TressFX_Desc option. This also requires changes to make sure the ordering of transparent hair strands works correctly.

rationale: Many engines used in popular games (including GTA V, Witcher 3, Just Cause 2) use inverted (and sometimes logarithmic) depth buffers to increase depth precision. See

jstewart-amd commented 8 years ago

Good point. We will add this to the backlog.

mrgreywater commented 7 years ago

Since I haven't heard back from you but need this feature for my next project, I started implementing it here: https://github.com/mrgreywater/TressFX/commit/116150b37358b0fd6b9f61b6cf9a5741d279ee6f (F5 to toggle inverse depth)

Inverse depth is working for the default configuration, but it doesn't yet support ShortCut or inverting the shadow maps.