Cycles: Principled BSDF: materials with Sepcular within close proximity to 12.5 are completely black #96719

Closed
opened 2022-03-22 22:55:24 +01:00 by tamooz br · 17 comments

System Information
Operating system: Arch Linux with kernel 5.16.15-arch1-1.
Graphics card: Intel HD graphics 5500.

Blender Version
Broken: at least since the release of 2.79.
Worked: unknown, potentially never.

Short description of error

If the "Specular" value of a Principled BSDF is set to a value within a small margin of error from the value 12.5, then no specular reflection will occur.

Exact steps for others to reproduce the error
Set the "Specular" value of a Principled BSDF shader to 12.5, and render in cycles.

**System Information** Operating system: Arch Linux with kernel 5.16.15-arch1-1. Graphics card: Intel HD graphics 5500. **Blender Version** Broken: at least since the release of 2.79. Worked: unknown, potentially never. **Short description of error** If the "Specular" value of a Principled BSDF is set to a value within a small margin of error from the value 12.5, then no specular reflection will occur. **Exact steps for others to reproduce the error** Set the "Specular" value of a Principled BSDF shader to 12.5, and render in cycles.
Author

Added subscriber: @Koopa512

Added subscriber: @Koopa512
tamooz br changed title from Cycles: Principled BSDF: metallic materials with Sepcular within close proximity to 12.5 are completely black to Cycles: Principled BSDF: materials with Sepcular within close proximity to 12.5 are completely black 2022-03-22 22:55:34 +01:00
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I can confirm the issue.

System Information
Operating system: Linux-5.16.0-4-amd64-x86_64-with-glibc2.33 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 510.54
Blender version: 3.2.0 Alpha, branch: master, commit date: 2022-03-22 07:07, hash: 47451af027

I can confirm the issue. **System Information** Operating system: Linux-5.16.0-4-amd64-x86_64-with-glibc2.33 64 Bits Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 510.54 Blender version: 3.2.0 Alpha, branch: master, commit date: 2022-03-22 07:07, hash: `47451af027`

Added subscriber: @ktdfly

Added subscriber: @ktdfly

Added subscriber: @Harvester

Added subscriber: @Harvester

Is this really a bug, or simply a misuse of this parameter in the Principled BSDF, being the Specular value a trick to play with the IOR within plausible values for dielectric materials? The Pixar paper on Principled BSDF, v3, states this for the Specular parameter: The specular parameter may be pushed beyond one to reach higher IOR values but should be done with caution.
A value of 12.5 seems far from being plausibile and within cautious values. Am I wrong?

Is this really a bug, or simply a misuse of this parameter in the Principled BSDF, being the Specular value a trick to play with the IOR within plausible values for dielectric materials? The Pixar paper on Principled BSDF, v3, states this for the Specular parameter: The specular parameter may be pushed beyond one to reach higher IOR values but should be done with caution. A value of 12.5 seems far from being plausibile and within cautious values. Am I wrong?
Author

It is a bug. It doesn't appear black when using OSL nor EEVEE, and the "Specular" value to IOR converter returns 0, which is not physically possible, but does not return a specular value of 0, but rather a 1.

It is a bug. It doesn't appear black when using OSL nor EEVEE, and the "Specular" value to IOR converter returns 0, which is not physically possible, but does not return a specular value of 0, but rather a 1.

Added subscriber: @deadpin

Added subscriber: @deadpin

Yeah, this is not really a bug. See the "Specular" section of https://docs.blender.org/manual/en/3.2/render/shader_nodes/shader/principled.html#inputs

A value of 12.5 has no solution to the equation listed there and is well outside the range of all known dielectric IOR values. Natural titanium dioxide peaks at ior=2.6 for a specular of ~2.5 and artificial meta-materials peak at ior=38.6 for a specular of 11.27. https://www.desmos.com/calculator/0tlhy6wymf

Perhaps we should hard-cap the slider at 12.

Yeah, this is not really a bug. See the "Specular" section of https://docs.blender.org/manual/en/3.2/render/shader_nodes/shader/principled.html#inputs A value of 12.5 has no solution to the equation listed there and is well outside the range of all known dielectric IOR values. Natural titanium dioxide peaks at ior=2.6 for a specular of ~2.5 and artificial meta-materials peak at ior=38.6 for a specular of 11.27. https://www.desmos.com/calculator/0tlhy6wymf Perhaps we should hard-cap the slider at 12.

For completeness, yeah there does seem to be a difference between OSL and not. Though it's by accident it looks like. Both are kind of wrong really.

OSL's kernel\osl\shaders\node_principled_bsdf.osl:93 calculation of (2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0, is different to the below (can't debug through to get actual value right now).
CPU's kernel\svm\closure.h:313 calculation of bsdf->ior = (2.0f / (1.0f - safe_sqrtf(0.08f * specular))) - 1.0f produces a floating point "inf" value due to the div by 0

For completeness, yeah there does seem to be a difference between OSL and not. Though it's by accident it looks like. Both are kind of wrong really. OSL's `kernel\osl\shaders\node_principled_bsdf.osl:93` calculation of `(2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0,` is different to the below (can't debug through to get actual value right now). CPU's `kernel\svm\closure.h:313` calculation of `bsdf->ior = (2.0f / (1.0f - safe_sqrtf(0.08f * specular))) - 1.0f` produces a floating point "inf" value due to the div by 0
Author

Both are (2/(1-√(0.08 * specular) - 1, so the difference is how they handle division by 0.
BTW with the IOR to specular formula with IOR 0, we get ((0-1)/(0+1))**2*0.08, which is 12.5, and by removing the *0.08 part, which yeilds an f0 value, we get of 1.

Both are (2/(1-√(0.08 * specular) - 1, so the difference is how they handle division by 0. BTW with the IOR to specular formula with IOR 0, we get ((0-1)/(0+1))**2*0.08, which is 12.5, and by removing the `*0.08` part, which yeilds an f0 value, we get of 1.

Refractive index of a transparent medium is always greater than 1 (it cannot be less than 1) because speed of light in any medium is always less than that in vacuum. IOR 1,00028 (approx) which is for Air should be the lowest value to be used.

Refractive index of a transparent medium is always greater than 1 (it cannot be less than 1) because speed of light in any medium is always less than that in vacuum. IOR 1,00028 (approx) which is for Air should be the lowest value to be used.
Member

Added subscriber: @LukasStockner

Added subscriber: @LukasStockner
Member

I wouldn't call this a bug, specular is supposed to be treated as a fraction. Going a bit beyond 1 for artistic control might make sense in some cases, but 12.5 is so far outside the intended range that I'm not even sure what the behavior should be.

Generally, the principled BSDF is intended for perceptually uniform, intuitive control. If you find yourself manually inverting the IOR mapping function to find the appropriate input for a given material, you probably don't want to be using the Principled BSDF in the first place.

It's probably best to just hard-clamp the input at something like 5 or even 2.

I wouldn't call this a bug, `specular` is supposed to be treated as a fraction. Going a bit beyond 1 for artistic control might make sense in some cases, but 12.5 is so far outside the intended range that I'm not even sure what the behavior should be. Generally, the principled BSDF is intended for perceptually uniform, intuitive control. If you find yourself manually inverting the IOR mapping function to find the appropriate input for a given material, you probably don't want to be using the Principled BSDF in the first place. It's probably best to just hard-clamp the input at something like 5 or even 2.
Author

this should be closed, it's a clone of #63938

this should be closed, it's a clone of #63938
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:03:13 +01:00
Member

this should be closed, it's a clone of #63938

Indeed, closing.
Also this seems to be fixed after: 2ac0b36e4e

> this should be closed, it's a clone of #63938 Indeed, closing. Also this seems to be fixed after: 2ac0b36e4e
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-08-24 06:16:34 +02:00
Pratik Borhade added
Status
Duplicate
and removed
Status
Archived
labels 2023-08-24 06:17:46 +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 project
No Assignees
7 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#96719
No description provided.