# Microfacet-based PrincipledHairBSDF #111257

Open
opened 2023-08-18 11:39:25 +02:00 by Weizhen Huang · 0 comments
Member
• Implement the original hair model from A Microfacet-based Hair Scattering Model (`6f8011edf7`)

• Compensate the energy loss due to single microfacet scattering and discarding lobes beyond TRT. (#105600 (comment), `91562e880e`, `9fd0c502d6`)

• Make it a variant of the current Principled Hair BSDF.
The previous model is named as Chiang, the new model is named as Huang.

• Better default for hair orientations (`9039f76928`)
The shading model uses the geometry normal for orientating the elliptical cross-section. The default mode is minimal twist, but minimal energy should be a better default, to align with the curvature vector.

• Use a better approximation of the pdf
The pdf introduced in the original paper is a very expensive approximation. Currently we just use `pdf = 1.0f` for simplicity.

The decrease in projected radius as a result of eccentricity is not visible in the shadow, this can cause energy loss. There are currently 4 possible solutions:
1. Make the intersection routine aware of the change in the projected radius. This is difficult as there is currently no good algorithm for intersecting curves with elliptical cross-sections and is not directly supported by the backends.
2. Use the available shadow transparency for curves, by computing the averaged transparency (`1 - projected_radius`) from all directions. This results in the complete elliptic integral of the second kind, and may be approximated by `M_PI_2_F - 1.0f - (0.56699f - 0.1990795f * logf(sqr(aspect_ratio))) * sqr(aspect_ratio)` https://math.stackexchange.com/a/1094997.
3. Store the aspect ratio in `KernelShader` (for uniform aspect ratio along the curve) or as an attribute for variable aspect ratio (which we do not expect to be practical), and compute the transparency on the fly in `intersection_curve_shadow_transparency()`, by using the normal attribute, the ray direction, and `dPdu` as computed by `catmull_rom_basis_derivative()`.
4. Same as above, but reject the intersection if `h` lies outside of the projected radius.

• manual
• release notes.

• Put the non-physical modulations (R, TT, TRT) in a panel

• Add support for near-field (#116094)

added the label 2023-08-18 11:39:25 +02:00
added this to the Render & Cycles project 2023-08-18 11:39:27 +02:00
No Label
No Milestone
No project
No Assignees
1 Participants