Cycles: Fix inconsistencies in Principled Subsurface Scattering SVM/OSL #113192
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113192
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Alaska/blender:fix-osl-subsurface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Subsurface Scattering part of the Principled BSDF SVM was using
the wrong IOR in some situations (Random Walk when IOR level != 0.5).
OSL for Subsurface Scattering was also setup in a way that made
comparisons between SVM and OSL confusing/inconsistent.
@ -827,7 +827,7 @@ ccl_device void osl_closure_bssrdf_setup(KernelGlobals kg,
/* create one closure per color channel */
bssrdf->albedo = closure->albedo;
bssrdf->N = closure->N;
bssrdf->alpha = sqr(closure->roughness);
No other closure does
sqr(closure->roughness)
so I removed it here for consistency sake, both with other OSL closures and SVM. Comment if you'd like this change reverted. I mainly did this because when investigating the code, I was confused why SVM usedsqr(roughness)
while OSL didn't.Note: Only the Principled BSDF and Subsurface Scattering nodes use the
bssrdf
closure.Both of them are unaffected by this change (Principled now passes through
sqr(roughness)
instead ofroughness
(similar to SVM which passes throughsqr(roughness)
), and the Subsurface Scatting node always sets roughness to 1.0)Fix incorrect Subsurface Scattering in Principled BSDF OSLto Cycles: Fix incorrect Subsurface Scattering in Principled BSDF OSL@blender-bot build
I originally left the Roughness as-is since theoretically a user-defined OSL shader could also use
bssrdf
. But yeah, we probably want this to be consistent, and we're making breaking changes anyways.As for the IOR: Hmm, I'm actually not sure whether IOR Level should have influence here. Arguably the main specular reflection comes from the same layer interface that also defines the SSS entry, so they probably should be coupled together? In that case, it'd be the SVM code that needs to be changed.
No strong opinion from me either way, anyone else?
The "Specular IOR Level" name suggests it only impacts the specular aspect of the material. As such I feel it's better if SSS isn't impacted by the "Specular IOR level".
But you are right. If the Specular and SSS entry are the same layer interface, then for physical correctness, they should have the same IOR.
What about using the Subsurface IOR instead of re-using the standard IOR?
If we think of IOR Level as just a way to texture the IOR, then I think it should affect the SSS entry direction. And then SVM should be changed.
Layers affect other layers below, I think that is expected. With transmission it's justifiable to have no effect because it's blending with a different component instead of layering, but here I think there should be an impact.
I prefer to keep the basic Random Walk compatible with Standard Surface and OpenPBR.
Requesting changes.
Cycles: Fix incorrect Subsurface Scattering in Principled BSDF OSLto Cycles: Fix incorrect Subsurface Scattering in Principled BSDF SVMCycles: Fix incorrect Subsurface Scattering in Principled BSDF SVMto Cycles: Fix inconsistencies in Principled Subsurface Scattering SVM/OSL@blender-bot build