3
$\begingroup$

The Blender implementation of Cycles displacement is still experimental in version 2.79, and there are some gaps in the documentation. The manual advises the use of the Vector>Displacement node or the Vector>Vector Displacement node for the 'displacement' input of the Material Output node. In my build, I haven't found these nodes.

In a recent answer to a BSE question about masking a displacement texture, Anton S used a node tree which (if I've read it correctly,) resulted in a vector in the range (0,0,-0.5)->(0,0,0.5) being used as the 'displacement' input.

A lot of other tutorials / answers seem to shove in a value in the range 0->1. Are they wrong? What space is Anton's vector in? Can the range be changed? I'd lke to take the guesswork / trial and error out of using displacement.

$\endgroup$
  • $\begingroup$ BTW there's no blame implied for the gaps in documentation: they're understandable. (Maybe one day if I've learned enough, I'll be able to submit contributions myself.) $\endgroup$ – Robin Betts Mar 20 '18 at 7:30
6
$\begingroup$

The confusion is probably stemming from the fact that this output was changed post-2.79. More confusingly, the later builds are still officially labeled as a form of 2.79 due to how Blender versioning works. For clarity, the rest of this answer will use "2.79" to refer to the stable release and previous versions, and the term "nightlies" to refer to the post-2.79 versions available in the buildbot. So:

In 2.79 and earlier, the displacement output was a float output (gray socket). The values expressed a displacement along the normal in decimeters. Yes, 1/10th of a meter. I don't know why this particular scale was chosen, maybe it was considered more artist friendly? In any case, this system was always a little unfinished and many people (myself included) have warned that it may change behavior in a later release.

Well, in the latest development trees those changes are here. The displacement socket has been replaced with a vector3 (purple) output. It now describes a world space transformation from one location to another, rather than along the normal. If you do need to simply displace along the existing normal, the new Vector>Displacement node you linked will do that. It takes a scalar heightfield and calculates a position along the normal based on the values. It outputs a world-space vector of the new mesh shape which you can feed to the displacement output. This works similar to the old displacement, but the scale is now in meters. So a value of 1 results in 1 meter of displacement instead of 0.1 meters.

There is also a Vector>Vector Displacement node. Since the new displacement is just a world-space position, it is now possible to describe more complicated shapes, such as baked down sculpts. The input itself only supports world space vectors. The Vector>Vector Displacement node can convert other formats, such as a tangent space, into the world space format needed for the output.

$\endgroup$
  • 1
    $\begingroup$ Thank you for your comprehensive and helpful answer. You certainly earn your moniker. Can the average user glean this kind of information, or is it best found by rifling through the code? $\endgroup$ – Robin Betts Mar 20 '18 at 7:17
  • $\begingroup$ Well, I'd say I'm a regular user, as I certainly can't code. This sort of thing is just info you pick up over time. The nice thing about Blender Stack Exchange is it's a good way to find out some specific information you haven't come across yet. $\endgroup$ – JtheNinja Mar 21 '18 at 17:00
-2
$\begingroup$

The attached blender file shows how the current (2.79a) Displacement input impacts the actual mesh displacement. This may not accurately or scientifically answer the question (as @JtheNinja did) but still allows to answer it visually and in a practical manner. It also interestingly allows to visualize the values of the different procedural textures.

enter image description here

$\endgroup$
  • $\begingroup$ This does not really answer the question. It's just an interesting use of displacement. $\endgroup$ – JtheNinja Mar 19 '18 at 23:57
  • $\begingroup$ Not directly but I think demonstrating the direct effect is useful. Specially when noted that as of 2.79a (stable official as of today) does not offer any of the Vector Displacement node discussed. $\endgroup$ – Bruno Mar 21 '18 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.