Cycles: NaN pixels in Glossy and Transmissive Passes with roughness values near 0.0266 #125750
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#125750
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Quadro K5100M/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 426.78
Blender Version
Broken: version: 4.2.0, branch: blender-v4.2-release, commit date: 2024-07-16 06:20, hash:
a51f293548ad
Worked: Unknown. I've checked as far back as 3.6
Short description of error
In the Cycles engine, Roughness values between 0.026592 and 0.026679 cause Not a Number pixels to appear in the Direct and Indirect Glossy and Transmissive passes.
Similar to blender/blender#108125. Unlike that bug, this one appears in both CPU and GPU rendering. It appears in the Glossy passes with or without Transmission>0, but only appears in the Transmission passes when Transmission>0.
Exact steps for others to reproduce the error
Open attached .blend file. (Glossy Glitch Test.blend)
Render Image
Open Compositing tab
A large number of pixels are NaN, as shown by the node network.
I tested a few different configurations and here are my observation.
CPU Rendering on Windows with a AMD Ryzen 5 5600: Has the issue
GPU Rendering on Windows with a AMD RX 7800XT: Has the issue
CPU Rendering on Linux with a AMD Ryzen 5 5600: No issue
CPU Rendering on macOS with a M1 Pro: No issue
GPU Rendering on macOS with a M1 Pro: No issue
GPU rendering on Windows with a NVIDIA RTX 4090: No issue
GPU Rendering on Windows with a Intel Arc A750: No issue
If there is a configuration that could be tested but that isn't listed (E.g. GPU rendering on Linux, it just means I didn't test it)
I've done some debugging into this.
The issue originates from this line of code:
The code gets there through the path of:
I should note that
bsdf_D
is only called if the material is!m_singular
. Andm_singular
is basicallyalpha_2 < 5.0e-7
. Considering thatalpha_2
is right on the verge of this threshold, I think that increasing the threshold may be the way to fix this issue.Edit: Increasing the threshold probably isn't the best approach. The minimum threshold I found that worked without issues was
8e-7
, which is high enough to create a sudden change when transitioning from low roughness to something higher than that value.For these particular values the NaN can be avoided by rewriting that line as:
return alpha2 / (M_PI_F * sqr((1.0f - cos_NH2) + alpha2 * cos_NH2));
That looks like an overall improvement to floating point precision in any case, but I don't know if that is enough. I don't have access to a system with the issue at the moment.
@david494 Thanks for the suggestion. We've identified the main thing for the fix (cos_NH2 should be 1.0 at the maximum). Once that is merged, feel free to open a new pull request for increased precision.
@david494 I believe your suggestion would fix #114940, would you like to make a PR and change
BSDF_ROUGHNESS_SQ_THRESH
to2e-10
?