Light clamping from Normal or Bump maps near shadow terminator in Cycles #107579

Open
opened 2023-05-03 15:26:27 +02:00 by Theo Bouvier · 3 comments

System Information
Operating system : Windows 11
CPU : AMD Ryzen 9 3900X
Graphics card : RTX 3090
RAM : 32GB
Has also been tested on a Ryzen 7 Laptop with Ubuntu.

Blender Version
Has been tested on every major release post 2.9, and on 3.6 build d5fc1b9ba4, identical behavior on all of them.
All provided screenshots of the test file (and the test file itself) were made with 3.5.1 Stable (build e1ccd9d4a1)

Short description of error
All normal information from a Height map passed through a Bump Node or from a Normal Map passed through a Normal Map node introduces some sort of light-clamping around the shadow terminator. The effect starts being visible at an angle of around 66° from the light source.
This is especially visible when the target object is Cylindrical and/or Spherical, and lit by a single Light source (Sun Lamp).
It looks like this behavior doesn't affect the Displacement node, since using it in Bump Only mode instead of the Bump node gives different results (they should both give identical results, as I understand it).

From looking at other renderers (and aesthetically speaking) it looks like the way the Displacement node does it is supposed to be the correct one.

Exact steps for others to reproduce the error
A test Blend file is provided.

Simplest way to reproduce it from scratch is to put a simple repeating height pattern on a smooth cylinder, using a bump node and a simple diffuse node, and lighting that cylinder from the side with a single Sun lamp.

The behavior of the Displacement node can be tested (and compared with the Bump/Normal) by plugging the same Height pattern into a Displacement node with the Shader Option set to "Bump Only", and plugging that displacement node into the Material Output.

I was initially thinking it to be related to (or the same issue as) this one :
#95729
But it has apparently been fixed (#105776), while the clamping is still clearly visible even in very recent builds.

**System Information** Operating system : Windows 11 CPU : AMD Ryzen 9 3900X Graphics card : RTX 3090 RAM : 32GB Has also been tested on a Ryzen 7 Laptop with Ubuntu. **Blender Version** Has been tested on every major release post 2.9, and on 3.6 build d5fc1b9ba4b8, identical behavior on all of them. All provided screenshots of the test file (and the test file itself) were made with 3.5.1 Stable (build e1ccd9d4a1d3) **Short description of error** All normal information from a Height map passed through a Bump Node or from a Normal Map passed through a Normal Map node introduces some sort of light-clamping around the shadow terminator. The effect starts being visible at an angle of around 66° from the light source. This is especially visible when the target object is Cylindrical and/or Spherical, and lit by a single Light source (Sun Lamp). It looks like this behavior doesn't affect the Displacement node, since using it in Bump Only mode instead of the Bump node gives different results (they should both give identical results, as I understand it). From looking at other renderers (and aesthetically speaking) it looks like the way the Displacement node does it is supposed to be the correct one. **Exact steps for others to reproduce the error** A test Blend file is provided. Simplest way to reproduce it from scratch is to put a simple repeating height pattern on a smooth cylinder, using a bump node and a simple diffuse node, and lighting that cylinder from the side with a single Sun lamp. The behavior of the Displacement node can be tested (and compared with the Bump/Normal) by plugging the same Height pattern into a Displacement node with the Shader Option set to "Bump Only", and plugging that displacement node into the Material Output. I was initially thinking it to be related to (or the same issue as) this one : https://projects.blender.org/blender/blender/issues/95729 But it has apparently been fixed (https://projects.blender.org/blender/blender/pulls/105776), while the clamping is still clearly visible even in very recent builds.
Theo Bouvier added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-05-03 15:26:28 +02:00
Iliya Katushenock added the
Interest
Render & Cycles
label 2023-05-03 15:41:56 +02:00
Member

Can't quite make sense of why is that, but I'd assume there's will be some differences between normal or bump map from a height map. Also, from a quick level adjustment on that screenshot, you can see the difference actually starts at the very beginning (as opposed to some 60 degrees position), it's just not that visible.

图片

Can't quite make sense of why is that, but I'd assume there's will be _some_ differences between normal or bump map from a height map. Also, from a quick level adjustment on that screenshot, you can see the difference actually starts at the very beginning (as opposed to some 60 degrees position), it's just not that visible. ![图片](/attachments/2efcf9e1-6269-4ca4-b8f1-4e543b9cf827)
Author

Can't quite make sense of why is that, but I'd assume there's will be some differences between normal or bump map from a height map.

Between a Normal map and a Height map, I'd agree (in theory, it should be identical, but some small degree of differences would be expected), but as I understand it, the same height map used in a Bump node and in a Displacement node in "Bump Only" mode should give identical results, as the operation done in the node should be the same, barring some normal-space shenanigans necessary for displacement maps. And for the most part, at angles perpendicular (or close) to the light-vector, it is the case.

By the looks of it though I don't think the issue stems from the way the Normal/Height information is interpreted/converted, but rather from the way the shader somehow deals with it. Using a Bump node and a Normal map Node passes the information through the shader node, which the displacement (if I understand it correctly) does not, which could be where the issue comes from.

A rather dramatic example of the issue (and the way I found out about it) :
image
It's clearly visible here that, when using the Displacement node, a set angle (after the Bump has been accounted for) from the light always gives the same "lightness" level, while it looks like the current "lightness" level is calculated only using the geometry, and not the Normal/Bump info, resulting in something that looks like clamping...

Also, from a quick level adjustment on that screenshot, you can see the difference actually starts at the very beginning (as opposed to some 60 degrees position), it's just not that visible.

That is correct, using extreme Gamma it starts being noticeable around 33° from the light, but it is likely present at all angles...
image

> Can't quite make sense of why is that, but I'd assume there's will be _some_ differences between normal or bump map from a height map. Between a Normal map and a Height map, I'd agree (in theory, it **should** be identical, but some _small_ degree of differences would be expected), but as I understand it, the same height map used in a Bump node and in a Displacement node in "Bump Only" mode should give identical results, as the operation done in the node should be the same, barring some normal-space shenanigans necessary for displacement maps. And for the most part, at angles perpendicular (or close) to the light-vector, it is the case. By the looks of it though I don't think the issue stems from the way the Normal/Height information is interpreted/converted, but rather from the way the shader somehow deals with it. Using a Bump node and a Normal map Node passes the information through the shader node, which the displacement (if I understand it correctly) does not, which could be where the issue comes from. A rather dramatic example of the issue (and the way I found out about it) : ![image](/attachments/b92b53c4-b606-4677-945c-e681cfaf9828) It's clearly visible here that, when using the Displacement node, a set angle (after the Bump has been accounted for) from the light always gives the same "lightness" level, while it looks like the current "lightness" level is calculated only using the geometry, and not the Normal/Bump info, resulting in something that looks like clamping... > Also, from a quick level adjustment on that screenshot, you can see the difference actually starts at the very beginning (as opposed to some 60 degrees position), it's just not that visible. That is correct, using extreme Gamma it starts being noticeable around 33° from the light, but it is likely present at all angles... ![image](/attachments/db52ce1e-1d29-4150-bf8f-c45b263ec0f2)
2.6 MiB
443 KiB
YimingWu added
Module
Render & Cycles
Status
Needs Info from Developers
and removed
Status
Needs Triage
labels 2023-05-04 08:26:09 +02:00
Author

Please note that, while #110271 's issue may be fixed in the current version, i'm still seeing the same erroneous behavior on the Bump node in the latest 3.6.1 stable release, so #105776 likely wasn't the culprit.
image

Please note that, while #110271 's issue may be fixed in the current version, i'm still seeing the same erroneous behavior on the Bump node in the latest 3.6.1 stable release, so #105776 likely wasn't the culprit. ![image](/attachments/8be14439-80dc-43db-853f-d8095c95f87b)
1.3 MiB
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
2 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#107579
No description provided.