-
Notifications
You must be signed in to change notification settings - Fork 855
Fixes for Hair Reference and Multiple Scattering Approximation #5832
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
…ion). To allow easier reference matching.
…the furnace test. Test for more roughness terms
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 SRP Core 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.
@johnpars could you also update the documentation. In your various PR description there is a lot of informatoin which should be also in documentation. Could you add a new pages in doc about the path tracing hair and how to test the white furnace for example.
i.e overall we need users to be able to understand what the model provide :) can be done in a separate PR, thanks
…crepancy between reference and approximation. Now fully matching reference for Bn = 0.7!
…Technologies/Graphics into HDRP/hair-bsdf-validation
…e for multiple scattering
For QA: the testing is covered by demo team. |
* Add the various color parameterization modes (color, melanin, absorption). To allow easier reference matching. * Add the BSDFData conversion to absorption * Clean up the hair reference and add the longitudinal scattering * Add fiber attenuations for each path * Add the azimuthal scattering from trimmed logistic * Compute the BSDF * Add Hair BSDF Reference Furnace Test * Fix many subtle issues in the reference and improve the stability of the furnace test. Test for more roughness terms * Add importance sampling. Now matching ground truth renders * Add some inverse absorption mappings * Make the approximation better fit the reference * More reference matching * Match the dual scattering to the reference * Various DS and preintegration fixes * Fix near/far field reference, fix low variance nans * Fix the azimuthal scattering preintegration * Disable symbols, furnace test * mend * Revert "mend" This reverts commit ef07fe8. * Remove the unused common function I added * hide the color mode for now * Precompue all azimuthal distributions, finally fix the absorption discrepancy between reference and approximation. Now fully matching reference for Bn = 0.7! * Remove the azimuthal scattering toggle as it's now always enabled * Update reference images and tweak the graph to ensure we have coverage for multiple scattering * Fix reference images for Vulkan * Suppress all the warnings Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
Purpose of this PR
This PR includes various fixes for our physically based hair shading, namely:
This work began with the intent to fix some discrepancies I observed between our dual scattering approximation and our pathtraced reference. However I realized that even our reference itself had some issues, which made it an unreliable multiple scattering reference. As such, I began a process of validating our reference, so that we may ultimately validate our multiple scattering approximation. This PR is a culmination of everything that was necessary to achieve that goal.
Ground Truth
The pathtraced reference was fixed with the help of this PBRT supplemental listing which shared helpful implementation details on the same model we use. Following that paper, we now are in good agreement with PBRT:
Importance Sampling
Importance sampling was also added, drastically reducing the variance we otherwise experience from uniform sampling.
64 SPP, BM = 0.8, BN = 0.7

Near/Far
Fixed an issue where the offset fiber term from tube intersection was being incorrectly calculated, causing incorrect results of the near field model. The D'Eon far field model was also removed and we "fake" a far field by choosing a random offset for every sample (instead of integrating over the fiber width).
Furnace Test
I added a furnace test to confirm that the reference is now energy conserving. The test is performed by setting up a theoretical fiber with zero absorption and confirming that the outgoing energy is close to 1 for uniform incident lighting. This is done for varying intervals of roughness. I added this test via our test runner framework but I leave it disabled for now (only enabled it locally for testing).
Color Modes
I added some other helpful color parameterization modes. Specifically: Absorption and Melanin Concentration. The absorption mode was added so that we can directly submit absorption coefficients to the model to reference our results against other papers. The melanin mode was added as an alternative but intuitive way to define the absorption in terms of pigmentation. I will keep these modes hidden in the UI from now, but can easily be enabled after some further discussion with artists (it will default to the normal color mode).
Dual Scattering Fixes
Ultimately the above work made it easier to iterate on our multiple scattering approximation and easily determine if there were issues. Numerous issues were discovered and corrected. Overall the approximation should be much closer in agreement with the reference.
There are however still some unresolved problems:
Testing status
~
Comments to reviewers
~