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.

  • Add test files.

  • 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.

  • Fix shadow transparency
    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.

  • Add entries in

    • manual
    • release notes.
  • Add support for EEVEE

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

  • Add support for near-field (#116094)

- [x] Implement the original hair model from [A Microfacet-based Hair Scattering Model](https://doi.org/10.1111/cgf.14588) (6f8011edf76bf7d6ce7411609aee188c9f9f6fd3) - [x] Compensate the energy loss due to single microfacet scattering and discarding lobes beyond TRT. (https://projects.blender.org/blender/blender/pulls/105600#issuecomment-934862, 91562e880ec8d8cc6df2d501ef9cf682c09bd3c3, 9fd0c502d6e6f401570930ba23571dce02e55c2c) - [x] Make it a variant of the current Principled Hair BSDF. *The previous model is named as Chiang, the new model is named as Huang.* - [x] Add test files. - [ ] Better default for hair orientations (9039f76928b3dd098fdcf936ead0c7a614f6786b) *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.* - [ ] Fix shadow transparency *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.* - [x] Add entries in - [x] manual - [x] release notes. - [ ] Add support for EEVEE - [x] Put the non-physical modulations (R, TT, TRT) in a panel - [ ] Add support for near-field (#116094)
Weizhen Huang added the
Type
To Do
label 2023-08-18 11:39:25 +02:00
Weizhen Huang added this to the Render & Cycles project 2023-08-18 11:39:27 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111257
No description provided.