5

I'm trying to understand the Math and MixRGB's options and stuck at the easiest one. Addition.

The setup:enter image description here

The left term: enter image description here

The top row right term's X location is -0,5.

The bottom row result: enter image description here

And my question is why they are getting darker at the top? If I increase the midlevel, or decrease the scale I get the expected result, but why and how the displacement affects the texture's color?

Chris
  • 59,454
  • 6
  • 30
  • 84
Klorissz
  • 245
  • 1
  • 7

2 Answers2

6

If you look at it, it doesn't seem to make sense. However, you have to be aware that on a flat plane the Quadratic Sphere gradient looks 2-dimensional, but it is in fact a 3-dimensional gradient which goes in all directions in 3D space.

The brightest part, the value 1, is at the center of a sphere - not a circle. From there it decreases to 0. It's not the displacement that affects the color, it's the texture itself.

The Displacement node tries to map 2-dimensional textures into height. So if you now take the Quadratic Sphere texture at a certain level - at XYZ = 0 for example - the textures values there get added and the gradient goes from 0 on the outside to 2 in the center.

This means, the displacement will use a height of 2 at the center - the peak you can see. However, the gradient which gives the color is still a Quadratic Sphere. So the brightest part with a value of 2 is at the center of the peak's bottom. From there it gets darker down to 0 and wherever the mesh meets this gradient in 3D space, this is the color it shows.

Imagine it like this, the left one is your result, the planes to the right like reference images when you're modeling something from blueprints for front, right and top view. As you can see by the dotted yellow lines, this is where your mesh lies in the 3-dimensional gradient. That's why not even the brightest parts on the outside have a value of 2, not even 1.

quadratic sphere

By the way, if you want the color to represent what the Displacement node uses as height, you have to turn the 3-dimensional gradient into a 2-dimensional gradient: simply set the Z scale in the Mapping node to 0.

flattened texture

Or in the "blueprint" view:

flattened2

Gordon Brinkmann
  • 28,589
  • 1
  • 19
  • 49
5

First of all, thanks for a really nicely presented question.

This is just a side-note to @Gordon Brinkmann's equally nicely explained and illustrated answer.

Where Object Space is evaluated after displacement, Generated Space is evaluated before it.

So textures mapped in Generated space will follow the displaced surface around:

enter image description here

.. which can make complex combinations of procedural displacements much easier to handle, especially when you are displacing in more than one dimension, with Vector Displacement .

enter image description here

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • 1
    Nice addition. The only reason I'm not using Generated very often is that many times I'm taking gradients like Spherical or Quadratic Sphere which I want to calculate from the center. With Generated this means, I have to offset it in XYZ. If I then also don't have a square or circular plane, but rectangular or elliptical, I have to furthermore scale it differently on the axis to secure a circular shape. This often dampens some of the advantages of Generated. – Gordon Brinkmann Feb 18 '22 at 09:30
  • 1
    @GordonBrinkmann True. There's a reason all those Nodevember contestants kick off with a nice, symmetrical cube/sphere.. :D – Robin Betts Feb 18 '22 at 09:40