Sheen doesn't render on perpendicular faces in orthographic view. #115206

Closed
opened 2023-11-20 19:26:29 +01:00 by rosen genkov · 4 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.01

Blender Version
Broken: version: 4.0.1, branch: blender-v4.0-release, commit date: 2023-11-16 16:40, hash: d0dd92834a08

Short description of error
Sheen (in principle and sheen BSDF) renders as black, when the face is perpendicular to the camera or view.
Cycles render. Ortographic view (or camera). Shade flat object.

Exact steps for others to reproduce the error
Render Engine Cycles
Device GPU compute
Assign a Sheen BSDF shader (or sheen weight in Principle BSDF) to the default cube.
Go to top orthographic view in render mode.
The cube has to be shade flat.
When remesh modifier is used, perpendicular faces are black even in shade smooth mode.
When Subdivision Surface modifier is used in Simple mode, there are also some black faces.

If CPU is used as a device the problem is less prominent. The faces are not black. Just a bit darker than the others.

image

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.01 **Blender Version** Broken: version: 4.0.1, branch: blender-v4.0-release, commit date: 2023-11-16 16:40, hash: `d0dd92834a08` **Short description of error** Sheen (in principle and sheen BSDF) renders as black, when the face is perpendicular to the camera or view. Cycles render. Ortographic view (or camera). Shade flat object. **Exact steps for others to reproduce the error** Render Engine Cycles Device GPU compute Assign a Sheen BSDF shader (or sheen weight in Principle BSDF) to the default cube. Go to top orthographic view in render mode. The cube has to be shade flat. When remesh modifier is used, perpendicular faces are black even in shade smooth mode. When Subdivision Surface modifier is used in Simple mode, there are also some black faces. If CPU is used as a device the problem is less prominent. The faces are not black. Just a bit darker than the others. ![image](/attachments/f895a350-40ae-4a08-a790-2fe82cf4a2d2)
rosen genkov added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-11-20 19:26:29 +01:00
Iliya Katushenock added the
Interest
Render & Cycles
label 2023-11-20 19:33:41 +01:00

I reproduced a similar effect; it seems undesired. Steps:

  1. Default cube
  2. Orthographic projection
  3. Top orthographic view
  4. View Rendered
  5. Render Cycles
  6. Cube material = Sheen BSDF
  7. Light Power = 10000
  8. Mouse3-drag 1 pixel
  9. Sharp discontinuity of response from black to mid-gray

System Information
Operating system: Windows-10-10.0.23590-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 550.09

Blender Version
Broken: version: 4.0.1, branch: blender-v4.0-release, commit date: 2023-11-16 16:40, hash: d0dd92834a08
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-18 21:46, hash: 9eba3902c904

I reproduced a similar effect; it seems undesired. Steps: 1. Default cube 2. Orthographic projection 3. Top orthographic view 4. View Rendered 5. Render Cycles 6. Cube material = Sheen BSDF 7. Light Power = 10000 8. Mouse3-drag 1 pixel 9. Sharp discontinuity of response from black to mid-gray **System Information** Operating system: Windows-10-10.0.23590-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 550.09 **Blender Version** Broken: version: 4.0.1, branch: blender-v4.0-release, commit date: 2023-11-16 16:40, hash: `d0dd92834a08` Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-18 21:46, hash: `9eba3902c904`
Member

Hi, thanks for the report. Can confirm. Recent refactor and new layer structure have caused the bug.
Behavior changed between fca8df9415b1 - 264c3e7bd7a6

Hi, thanks for the report. Can confirm. Recent refactor and new layer structure have caused the bug. Behavior changed between `fca8df9415b1 - 264c3e7bd7a6`

@LukasStockner, can you check?

@LukasStockner, can you check?
Member

A quick comment for @brecht and/or @LukasStockner or anyone else if they want to look into this.

The issue is caused by make_orthonormals_tangent() as called by bsdf_sheen_setup() in /intern/cycles/kernel/closure/bsdf_sheen.h.

What's happening is two parallel vectors are being passed to make_orthonormals_tangent() (these vectors are bsdf->N and sd->wi).

make_orthonormals_tangent() then does some math (normalize(cross(bsdf->N, sd->wi))) which produces NaNs which cause issues later one. This is because the cross product of identical vectors are 0, and a normalized 0 vector is NaN.

Swapping normalize out for safe_normalize fixes a assert caused by the NaNs and fixes the black rendering issue, but now there's discontinuities in some areas since the vector is 0, 0, 0 in one region and 0.7, 0.7, 0.0 right beside it. Just for reference, this discontinuity can be seen in the test scenes on the two cubes that partially render correctly.

I'm not sure what the desired result would be for this case (bsdf->N == sd->wi) so I don't know how to fix it. But hopefully the informaiton helps.

A quick comment for @brecht and/or @LukasStockner or anyone else if they want to look into this. The issue is caused by `make_orthonormals_tangent()` as called by `bsdf_sheen_setup()` in `/intern/cycles/kernel/closure/bsdf_sheen.h`. What's happening is two parallel vectors are being passed to `make_orthonormals_tangent()` (these vectors are `bsdf->N` and `sd->wi`). `make_orthonormals_tangent()` then does some math (`normalize(cross(bsdf->N, sd->wi))`) which produces NaNs which cause issues later one. This is because the cross product of identical vectors are 0, and a normalized 0 vector is NaN. Swapping `normalize` out for `safe_normalize` fixes a assert caused by the NaNs and fixes the black rendering issue, but now there's discontinuities in some areas since the vector is `0, 0, 0` in one region and `0.7, 0.7, 0.0` right beside it. Just for reference, this discontinuity can be seen in the test scenes on the two cubes that partially render correctly. I'm not sure what the desired result would be for this case (`bsdf->N == sd->wi`) so I don't know how to fix it. But hopefully the informaiton helps.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-27 11:34:14 +01: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
5 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#115206
No description provided.