Thank you for your very quick reply guys.
Let me make sure i have this right.
I work best with visual stimulus and context to these theories. So i’ve taken part of a node graph from a more complex material where i was faking the self shadowing of a volume.
- The absolute world position node is the world position for every visual pixel of the object that the shader is applied to (effectively the visual surface of the object).
For instance here i am taking the blue channel (Z Axis) of every single visual pixel for this cube in world position (this operation run millions of times a second). As the cube is at world 0,0,0 in the material editor and it’s origin is at the meshes centre it gives half positive z and half negative z values and looks like this.
I then subtract this from the object’s z position to localise the gradient so that even when the object moves in the world the gradient stays in the same place.
So if i were to visualise some of these vectors they would look like this. Straight lines coming from the objects centre to the visible pixels (or more simply the visible surface) of the object in world space.(Abs world position)
I am then taking the object radius. Which is the vector between an objects centre to the side of it’s bounding box ( which in the case of this cube the bounding box matches the shape) and using that to divide the abs world position and object position. To provide a fall off to the self shadowing.
Multiplying that over a colour value and lerp to white to control the amount of self shadowing gives this effect.
Are my concepts of absolute world position right? Please correct me on anything that I’ve said that may be wrong or misleading. I am defiantly not the authority on this i am just trying to give context and examples to the theories.
Hope to hear back soon