Shading looks different between Geo Nodes Displacement and Shader Displacement #92798

Closed
opened 2021-11-03 19:22:47 +01:00 by Jakub Jaszewski · 16 comments

Blender Version
Broken: 3.1.0 Alpha a2f0f98271 master

Shading with SSS (Cycles) looks different between two displacements. Shading on object with displacement made with Geometry nodes looks much brighter than Displacement made with Shader node drived by attribute from Geometry Nodes.

Exact steps for others to reproduce the error

  • Open attached blend file. Switch to rendered viewport (Cycles) and look how shading looks.
  • In Geometry Nodes Editor connect geometry input directly to geometry output, and in Shader Editor connect Displacement and Output nodes.
  • Watch how shading changes.

Geometry Nodes Displacement (wrong shading)
DISPL_GEO.png

Shader Based Displacement (correct shading)
DISPL_SHADER.png
DISPLACEMENT_TEST.blend

**Blender Version** Broken: 3.1.0 Alpha a2f0f982710d master Shading with SSS (Cycles) looks different between two displacements. Shading on object with displacement made with Geometry nodes looks much brighter than Displacement made with Shader node drived by attribute from Geometry Nodes. **Exact steps for others to reproduce the error** - Open attached blend file. Switch to rendered viewport (Cycles) and look how shading looks. - In Geometry Nodes Editor connect geometry input directly to geometry output, and in Shader Editor connect Displacement and Output nodes. - Watch how shading changes. Geometry Nodes Displacement (wrong shading) ![DISPL_GEO.png](https://archive.blender.org/developer/F11700219/DISPL_GEO.png) Shader Based Displacement (correct shading) ![DISPL_SHADER.png](https://archive.blender.org/developer/F11700232/DISPL_SHADER.png) [DISPLACEMENT_TEST.blend](https://archive.blender.org/developer/F11700159/DISPLACEMENT_TEST.blend)

Added subscriber: @silex

Added subscriber: @silex

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

I don't think the difference is due primarily to the method of the the displacement, I think it is the bump. You have set the shader settings to Displacement and Bump.

Displacement and Bump.
DISPLACEMENT_and_BUMP.png

Displacement only.
DISPLACEMENT_ONLY.png

Bump added and GN.
BUMP_GN.png

Inverting the Bump will flip it back to the lighter shade, allowing you to do the same effect in EEVEE as well.

It might be that the reason the shading isn't a perfect match is due to the plane not being at 1.00 scale, and some issues involving the object space to world space conversion or something along those lines.

I don't think the difference is due primarily to the method of the the displacement, I think it is the bump. You have set the shader settings to Displacement and Bump. Displacement and Bump. ![DISPLACEMENT_and_BUMP.png](https://archive.blender.org/developer/F11710968/DISPLACEMENT_and_BUMP.png) Displacement only. ![DISPLACEMENT_ONLY.png](https://archive.blender.org/developer/F11710970/DISPLACEMENT_ONLY.png) Bump added and GN. ![BUMP_GN.png](https://archive.blender.org/developer/F11710972/BUMP_GN.png) Inverting the Bump will flip it back to the lighter shade, allowing you to do the same effect in EEVEE as well. It might be that the reason the shading isn't a perfect match is due to the plane not being at 1.00 scale, and some issues involving the object space to world space conversion or something along those lines.

Added subscriber: @ktdfly

Added subscriber: @ktdfly
Member

Capturing the distance attribute helps with the colors (see green tip) but displacement is still shaded differently.

With attribute capture, no shader displacement.
image.png

Original, no shader displacement.
DISPL_GEO.png

Capturing the distance attribute helps with the colors (see green tip) but displacement is still shaded differently. With attribute capture, no shader displacement. ![image.png](https://archive.blender.org/developer/F11729374/image.png) Original, no shader displacement. ![DISPL_GEO.png](https://archive.blender.org/developer/F11700219/DISPL_GEO.png)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

In the Spreadsheet we can see that the "distance" output values change if you directly connect the geometry to the output.
It's as if these values are updated along with the geometry and not just when the node is linked.

I'm not sure what the behavior should be here.

In the Spreadsheet we can see that the "distance" output values change if you directly connect the geometry to the output. It's as if these values are updated along with the geometry and not just when the node is linked. I'm not sure what the behavior should be here.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

The Attribute Capture node that Charlie inserted is indeed necessary to get the same result in both cases.
When I replace the Principled BSDF node with an Emission node, the result seems to be identical when comparing geometry nodes vs cycles displacement. This indicates to me that this is probably a bug or limitation in Cycles and not a geometry nodes issue.

The Attribute Capture node that Charlie inserted is indeed necessary to get the same result in both cases. When I replace the Principled BSDF node with an Emission node, the result seems to be identical when comparing geometry nodes vs cycles displacement. This indicates to me that this is probably a bug or limitation in Cycles and not a geometry nodes issue.

@JacquesLucke, did you put Displacement Only in the material's Displacement settings ? With that the result is identical in my case.
I think this report can be closed.

@JacquesLucke, did you put `Displacement Only` in the material's Displacement [settings ](https://docs.blender.org/manual/en/dev/render/cycles/material_settings.html#bpy-types-cyclesmaterialsettings-displacement)? With that the result is identical in my case. I think this report can be closed.

Added subscriber: @brecht

Added subscriber: @brecht

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

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

I think geometry nodes and Displacement Only are closer to correct, and would not consider this a bug.

What Displacement & Bump does is instead of using the vertex normal, compute a bump mapped normal from the displacement map at every shading point (and not every vertex). That allows for more detail, if you use e.g.a procedural or image textures that has resolution higher than the geometry. In this case with a vertex attribute at the same resolution as the geometry, so it's not adding more detail.

In fact it's worse than that, all the faces end up flat shaded, which you can see in the normal render pass. Bump mapping requires C2 continuity to get a smooth normal, but linearly interoplated vertex attribute are only C1. It's not obvious but I'm also not sure if there exists a practical solution to this.

I think geometry nodes and Displacement Only are closer to correct, and would not consider this a bug. What Displacement & Bump does is instead of using the vertex normal, compute a bump mapped normal from the displacement map at every shading point (and not every vertex). That allows for more detail, if you use e.g.a procedural or image textures that has resolution higher than the geometry. In this case with a vertex attribute at the same resolution as the geometry, so it's not adding more detail. In fact it's worse than that, all the faces end up flat shaded, which you can see in the normal render pass. Bump mapping requires C2 continuity to get a smooth normal, but linearly interoplated vertex attribute are only C1. It's not obvious but I'm also not sure if there exists a practical solution to this.

Thank you for explanation.

I guess than that with 'atomized' Geometry Nodes design there is much more corner cases like this and putting them in manual would be impractical.
This probably is not of the highest priority, but maybe in the future adding a properly set nodegroup-material combo to Blender Asset Bundle could become a method to communicate good practices in Geometry Nodes when it comes to commonly used high-level functions that don't have dedicated node. Just a thought.

Thank you for explanation. I guess than that with 'atomized' Geometry Nodes design there is much more corner cases like this and putting them in manual would be impractical. This probably is not of the highest priority, but maybe in the future adding a properly set nodegroup-material combo to Blender Asset Bundle could become a method to communicate good practices in Geometry Nodes when it comes to commonly used high-level functions that don't have dedicated node. Just a thought.
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#92798
No description provided.