Page MenuHome

Shading looks different between Geo Nodes Displacement and Shader Displacement
Closed, ArchivedPublic

Description

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)

Shader Based Displacement (correct shading)


Event Timeline

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 only.

Bump added and GN.

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.

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

With attribute capture, no shader displacement.

Original, no shader displacement.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Needs Information from Developers.Nov 8 2021, 1:44 PM

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.

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.

@Jacques Lucke (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.

Brecht Van Lommel (brecht) closed this task as Archived.EditedNov 17 2021, 8:36 PM

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.

silex (silex) added a comment.EditedNov 17 2021, 11:38 PM

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.