-
Notifications
You must be signed in to change notification settings - Fork 846
Add BCSDF Approximation for Second Hair Material Type #4935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…F, ShaderGraph, etc.)
… to post evaluate BSDF
...nity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairPropertyBlocks.cs
Outdated
Show resolved
Hide resolved
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted, it's worth texting to make sure the include
s work properly. Added some changes to the docs too.
...ender-pipelines.high-definition/Documentation~/snippets/shader-graph-blocks/cuticle-angle.md
Outdated
Show resolved
Hide resolved
...r-pipelines.high-definition/Documentation~/snippets/shader-graph-blocks/smoothness-radial.md
Outdated
Show resolved
Hide resolved
...nition/Documentation~/snippets/shader-properties/advanced-options/allow-radial-smoothness.md
Outdated
Show resolved
Hide resolved
....high-definition/Documentation~/snippets/shader-properties/advanced-options/geometry-type.md
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.high-definition/Documentation~/master-stack-hair.md
Show resolved
Hide resolved
@johnpars All good. Can you update the documentation as mention by Vic and we are ready to go with this PR (before further improvement) |
Also be sure to merge master and update screenshots |
This PR introduces a Marschner-based BSDF (technically, BCSDF, as this is a far-field model which assumes that the fibers are viewed from a distance at which the near-field variations can be ignored) model to the HDRP hair shader (as a second model option, not a replacement). It is a follow up to this PR.
Currently, HDRP’s hair shader already supports a dual-specular lobed Kajiya-Kay model, with an additional specular transmission lobe. It is a phenomenological model, rather than physically based. This creates a challenge for artists, as there are many parameters to tune the model, and it is their responsibility to balance the energy between specular lobes.
This Marschner-based model takes a physically based approach, by analyzing the scattering events that occur within a hair fiber. It offers a much simpler parameterization for artists, with the added benefit of conforming well to HDRP’s physically based lighting by default.
Usage
Users can access the new model through the following steps:
Usage is otherwise very similar to the existing Kajiya-Kay model, and for the most part a user should be able to safely defer to the existing documentation regarding this (namely the usage of hair strand direction, proper use of which is crucial for getting correct results with the model)
Parameterization
The table below specifies the properties of note for controlling the model. This model shares one mutual parameter with the Kajiya model, Hair Strand Direction. It behaves in the exact same way.
Note, @SebastienLa have organized this hair analysis document that goes in depth on parameterization. This PR does not currently address everything proposed there, but we are discussing on how to improve it.
Performance
Overall, performance is comparable to HDRP’s other forward-based shading models (Kajiya, Fabric, etc.). Performance metrics were captured from a standalone Windows built with an NVIDIA GTX 1070 (Max-Q, Laptop Card), at a 1920x1080 resolution, no MSAA.
Scenario #1: Two screen-aligned quads (Marschner, Kajiya), each taking up 50% of the viewport. Illuminated by one point, one spot, one directional, one environment light.
Scenario #2: Two hair groom files (7000 strands represented with screen-aligned strips). Illuminated by three spot lights.
NOTE: These metrics were also taken 2X MSAA.
Light Loop Integration
Reference
This PR also includes a reference BSDF, which the approximation is based on. It can also be used by the path tracer, but right now is uniformly sampled.
[TODO IMAGE]
Additional Notes
Testing status
Updated Graphics Test 1401 to also test for the new model. Launching a Yamato to confirm everything checks out on the various platforms.
The original reference implementation was verified by plotting the various distribution curves and referencing them to the original papers I derived this model from. During the approximation process, I used the reference to make informed optimization decisions at the cost of quality / accuracy.