Fast Fur Render Pipeline options

From Warren's Fast Fur Shader
Revision as of 18:52, 4 July 2023 by Warren (talk | contribs) (Describes the 3 render pipeline options)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

index.php?title=File:Main_Render_Settings.jpgFast Fur Render Pipeline options

WFFS currently uses the Unity Built-in Render Pipeline (BiRP). This graphics pipeline consists of 4 programmable shader stages: Vertex, Hull+Domain, Geometry, and Fragment.

(NOTE: WFFS does not currently support Unity's other render pipelines, namely the Universal Render Pipeline (URP), High Definition Render Pipeline (HDRP), and Scriptable Render Pipeline (SRP). Future support for these pipelines is planned, but not until the shader is more polished, reliable, and feature-complete.)

WFFS has 3 options for which BiRP stages to use, and how it will use them:

Fallback Pipeline (Slow)
The Fallback Pipeline relies on slow Geometry shaders to discard all non-visible fur.

The Fallback Pipeline is the slowest pipeline, and will also have the lowest quality. It can render up to 32 layers of fur.

These limitations are because it relies on Geometry shaders to discard all non-visible triangles. Geometry shaders are unfortunately relatively slow to load into GPU memory. Even if no fur is being rendered (because it is too far away, or is backwards-facing, or is outside the visible screen area), the Geometry shader must still load everything into GPU memory before discarding it.

The Fallback Pipeline is not recommended. It is still faster than other fur shaders that use the same approach, such as XSFur, but the only reason it is included is for compatibility reasons. It doesn't use Hull + Domain shaders, which may not be allowed with some games.

Turbo Pipeline (Fast)
The Turbo pipeline uses fast Hull + Domain shaders to discard most non-visible fur.

Depending on view range, the Turbo Pipeline is typically 25% to 100% faster than the Fallback Pipeline, despite also having much higher quality. It can render up to 32 layers of fur.

This speed comes from its use of Hull + Domain shaders to discard any fully non-visible triangles before the Geometry shader stages, which prevents the relatively slow Geometry shaders from even loading into GPU memory.

Hull + Domain shaders are typically used for tesselation, and are thus built for speed. The Turbo Pipeline does not use tesselation, though. Instead, it uses the Hull + Domain shaders as a very fast all-or-nothing kill-switch. When it wants to discard an entire triangle, the Hull shader specifies a multiplier of 0, which discards it. Otherwise it specifies a multiplier of 1 and the triangle is then passed completely as-is by the Domain shader to the Geometry shader. The Geometry shader is then resposible for making copies of the triangle for each visible fur layer.

The Turbo Pipeline is the recommended pipeline.


Super Pipeline (Fastest, but unreliable on AMD GPUs)

The Super Pipeline uses fast Hull + Domain shaders to make the fur layers.

The Super Pipeline is typically 30% faster than the Turbo Pipeline, and it can also produce pixel-perfect screenshots with no visible gaps in the hairs. It can render up to 264 layers of fur.

Its speed and resolution comes from using the Hull + Domain shaders to make only as many copies of each triangle as-needed. This means that the vast majority of un-needed triangles do not need to be discarded because they are never created in the first place.

Offloading most of the copying workload from the much slower Geometry shaders gives the Super Pipeline a huge performance boost. Unfortunately, it also runs afoul of AMD driver bugs. The 5600xt, 5700xt, and 5800xt are all confirmed to crash during the Hull + Domain shader stages. Unlike the Turbo Pipeline, the Super Pipeline makes copies and modifies the data coming from the Vertex shader before sending it to the Geometry shaders. This is where the AMD driver bugs strike, typically after about ~10 seconds.

Until it can be made reliable on AMD GPUs, the Super Pipeline will not be available except as an experimental Beta version.

The Super Pipeline is not recommended.