Cycles: Multi-scale Principled Hair Huang Model #116094

Merged
Weizhen Huang merged 4 commits from weizhen/blender:hair-nearfield into main 2024-02-22 18:18:24 +01:00

4 Commits

Author SHA1 Message Date
Weizhen Huang e3abd15692 Cycles: make Principled Hair Huang a near- and far-field model
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
for a camera ray, compute the actual range of the hair width that the
current pixel covers, and only integrate that subset, to prevent a
ribbon-like appearance in close-up looks.
When the hair covers less than one pixel on the screen or when the ray
is not camera ray, the model works the same as before.
2024-02-22 17:36:39 +01:00
Weizhen Huang 1081ad38d8 Cleanup: simplify computation of `h_to_gamma()` in Principled Hair Huang 2024-02-22 17:17:57 +01:00
Weizhen Huang bb42f9decf Refactor: pre-compute valid integration interval in Principled Hair Huang
The valid interval from incoming direction was shared between
`...eval_r()` and `...eval_residual()`, so compute that in `...eval()` instead.
The valid interval from outgoing direction was computed for
`...eval_r()` to further reduce the integration interval. This part is
removed because the check `dot(wo, wm) > 0` is relatively cheap inside the loop.
2024-02-22 17:17:57 +01:00
Weizhen Huang 504d23b720 Cycles: adjust normal in Principled Hair Huang to be orthogonal to the tangent
The geometry normal of the curve might not be precisely orthogonal to
the tangent due to interpolation. Previously, the tangent was adjusted
to be orthogonal to the normal. However, the normal is linearly
interpolated, which is less accurate than the tangent computed using Catmull-Rom.
This commit keeps the tangent and adjust the normal instead, besides
better accuracy, it ensures a smooth transition when the cross-section
shifts between circular and elliptical.
2024-02-22 17:17:57 +01:00