Extreme Normal editing causes flat shading #88170

Open
opened 2021-05-10 10:53:22 +02:00 by 炎臻 · 10 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.27

Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-08 23:52, hash: 3c7b80ae2c
Worked: 2.92.0

Caused by 1c22b551d0


Short description of error:

Extreme Normal editing(like flipping the normal and using other normal editing modifiers) causes flat shading.
2.92.0.png

2.93.png
In the image above,the sphere has a Data Transfer modifier which is receiving the Normals of the plane.
As in the upper image(2.92.0),the sphere is shaded smooth while in the lower image(2.93 beta) it gets flat shading at some faces.


Exact steps for others to reproduce the error

{icon fa-plus} OS Conditon: WIN 10 |Blender: 2.93.0 Beta

  • Default scene with default cube deleted.
  • Add a sphere object and a plane,add a Data Tansfer modifier to the sphere which transfers the normals of the plane to the sphere.
  • Have the sphere some negative Z axis transformation then observe its normal,the flat shading should be appearing at some angle.
    {icon bicycle spin} Below is a blend file with the setup above with an additional shading node in the material:
    This is the additional node which filps the normals of the geometry:
    shader node.png And the results in the respective versions:
    2.92.0(2).png

2.93 beta.png
NormalFlatShadingBug.blend


From #111805:

2.92 2.93
image.png image.png

shadingBug.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.27 **Blender Version** Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-08 23:52, hash: `3c7b80ae2c` Worked: 2.92.0 Caused by 1c22b551d0 --- ## Short description of error: Extreme Normal editing(like flipping the normal and using other normal editing modifiers) causes flat shading. ![2.92.0.png](https://archive.blender.org/developer/F10074818/2.92.0.png) ![2.93.png](https://archive.blender.org/developer/F10074764/2.93.png) In the image above,the sphere has a Data Transfer modifier which is receiving the Normals of the plane. As in the upper image(2.92.0),the sphere is shaded smooth while in the lower image(2.93 beta) it gets flat shading at some faces. --- ## Exact steps for others to reproduce the error {icon fa-plus} OS Conditon: **WIN 10** |Blender: **2.93.0 Beta** - Default scene with default cube deleted. - Add a sphere object and a plane,add a Data Tansfer modifier to the sphere which transfers the normals of the plane to the sphere. - Have the sphere some negative Z axis transformation then observe its normal,the flat shading should be appearing at some angle. {icon bicycle spin} Below is a blend file with the setup above with an additional shading node in the material: This is the additional node which filps the normals of the geometry: ![shader node.png](https://archive.blender.org/developer/F10074849/shader_node.png) And the results in the respective versions: ![2.92.0(2).png](https://archive.blender.org/developer/F10074857/2.92.0_2_.png) ![2.93 beta.png](https://archive.blender.org/developer/F10074859/2.93_beta.png) [NormalFlatShadingBug.blend](https://archive.blender.org/developer/F10074867/NormalFlatShadingBug.blend) --- From #111805: | 2.92 | 2.93 | | --- | --- | | ![image.png](attachments/9115479c-715e-4144-97cb-af6acf63bb8b) | ![image.png](attachments/c1b7140a-bd63-49c7-8d1d-353e2b790d3f) | [shadingBug.blend](attachments/aeee05e6-9f12-4062-a280-99996f44df82)
Author

Added subscriber: @PrettyFireNOI7

Added subscriber: @PrettyFireNOI7

#88400 was marked as duplicate of this issue

#88400 was marked as duplicate of this issue
Member

Added subscribers: @fclem, @lichtwerk

Added subscribers: @fclem, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

I can confirm the change in behavior since 1c22b551d0, so in most situations this is an improvement and an intentional change.

However, I am a bit confused here, since Cycles and Eevee dont seem to behave the same (as the commit message promised), see e.g. this file:
repro.blend

Changing Cycles <> Eevee shows a clear difference here.

This might all be expected behavior, but to be sure, I would kindly ask @fclem to have a look.

I can confirm the change in behavior since 1c22b551d0, so in most situations this is an improvement and an intentional change. However, I am a bit confused here, since Cycles and Eevee dont seem to behave the same (as the commit message promised), see e.g. this file: [repro.blend](https://archive.blender.org/developer/F10075408/repro.blend) Changing Cycles <> Eevee shows a clear difference here. This might all be expected behavior, but to be sure, I would kindly ask @fclem to have a look.

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

This is due to a difference between Cycles and EEVEE.

EEVEE applies ensure_valid_reflection on glossy normal input where Cycles only applies it on normal mapped & bump node output.

Here is an example of the same behavior in cycles.

Capture d’écran du 2021-05-12 14-53-15.png

Unfortunately, we need to use ensure_valid_reflection to avoid nasty artifacts on glossy BSDF even without bump/normal mapping (see #81070 & #78501).

We keep the same behavior when SSR is off to keep consistency.

Note that EEVEE won't distort the normals for diffuse.

This is due to a difference between Cycles and EEVEE. EEVEE applies `ensure_valid_reflection` on glossy normal input where Cycles only applies it on normal mapped & bump node output. Here is an example of the same behavior in cycles. ![Capture d’écran du 2021-05-12 14-53-15.png](https://archive.blender.org/developer/F10087831/Capture_d_écran_du_2021-05-12_14-53-15.png) Unfortunately, we need to use `ensure_valid_reflection` to avoid nasty artifacts on glossy BSDF even without bump/normal mapping (see #81070 & #78501). We keep the same behavior when SSR is off to keep consistency. Note that EEVEE won't distort the normals for diffuse.
Author

In #88170#1159717, @fclem wrote:
This is due to a difference between Cycles and EEVEE.

EEVEE applies ensure_valid_reflection on glossy normal input where Cycles only applies it on normal mapped & bump node output.

Here is an example of the same behavior in cycles.

Capture d’écran du 2021-05-12 14-53-15.png

Unfortunately, we need to use ensure_valid_reflection to avoid nasty artifacts on glossy BSDF even without bump/normal mapping (see #81070 & #78501).

We keep the same behavior when SSR is off to keep consistency.

Note that EEVEE won't distort the normals for diffuse.

Thanks for elaborating.I had already found out how the fixed reflection( #81070 & #78501 ) improved my own scene too thanks to Philipp Oeser's reply.
I just would like to have a way to make the flatten shading smooth.
I used to use these normal editing tricks(like the report above) to realize some of my rendering ideas.2.92.0.png
And now it looks like this:2.93beta.png


Nodes and files:
NodeSetUp.png

Sample.blend


So if the reflecion fix must come with this normal shading behavior change then I would look for other way to build my shader.

> In #88170#1159717, @fclem wrote: > This is due to a difference between Cycles and EEVEE. > > EEVEE applies `ensure_valid_reflection` on glossy normal input where Cycles only applies it on normal mapped & bump node output. > > Here is an example of the same behavior in cycles. > > ![Capture d’écran du 2021-05-12 14-53-15.png](https://archive.blender.org/developer/F10087831/Capture_d_écran_du_2021-05-12_14-53-15.png) > > Unfortunately, we need to use `ensure_valid_reflection` to avoid nasty artifacts on glossy BSDF even without bump/normal mapping (see #81070 & #78501). > > We keep the same behavior when SSR is off to keep consistency. > > Note that EEVEE won't distort the normals for diffuse. Thanks for elaborating.I had already found out how the fixed reflection( #81070 & #78501 ) improved my own scene too thanks to __Philipp Oeser__'s reply. I just would like to have a way to make the flatten shading smooth. I used to use these normal editing tricks(like the report above) to realize some of my rendering ideas.![2.92.0.png](https://archive.blender.org/developer/F10090331/2.92.0.png) And now it looks like this:![2.93beta.png](https://archive.blender.org/developer/F10090346/2.93beta.png) --- Nodes and files: ![NodeSetUp.png](https://archive.blender.org/developer/F10090351/NodeSetUp.png) [Sample.blend](https://archive.blender.org/developer/F10090353/Sample.blend) --- So if the reflecion fix must come with this normal shading behavior change then I would look for other way to build my shader.
Member

Added subscriber: @jk137574

Added subscriber: @jk137574
Member

We keep the same behavior when SSR is off to keep consistency.

In a way, this removes a whole range of shading possibilities (maybe not do it when SSR is OFF?)

> We keep the same behavior when SSR is off to keep consistency. In a way, this removes a whole range of shading possibilities (maybe not do it when SSR is OFF?)
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:13:42 +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
4 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#88170
No description provided.