1
$\begingroup$

I'm trying to follow this Youtube tutorial about convert a material displacement input into a mesh for 3d printing.

This works by outputting the displacement as a .exr file which is used in a Displace modifier.

I can get this to work on a flat plane, but when I try to add the Displace modifier to a UV sphere, I get some weird artifacts. I think this is related to normals, since the weirdness happens in the XYZ direction.

Here it is looking alright when using the material displacement output:

material displacement

And here's the strange behaviour. You can see that in +X/+Y/+Z the displacement is going the right way, but in -X/-Y/-Z it is inverted, with the cross section having pretty much no displacement.

Displace modifier output

And here's what the rendered unwrapped texture looks like, if that helps.

texture output

I don't know if you need to know any other settings, let me know and I'll add them!

Edit: I've recreated the problem with a very simple texture applying convex lumps to a ball - you can see that the lumps are concave on the reverse side. The .blend file is at the bottom.

image recreated with lumps

$\endgroup$

1 Answer 1

1
$\begingroup$

The output of your shader's procedural 'lumps' cluster, before being plugged into the Displacement, is a height..., a scalar value.

A Displacement shader node, given that height as a parameter, looks up the normal found at the corresponding UV location, and scales it by the given height. That yields a vector, in the direction of the normal, with the length of the height. If set to 'Object' the vector is interpreted in Object-Space coordinates.

The Displacement shader-node returns the length and direction of the desired offset of the surface, measured in Object Space.

Whether you encode scalar-height, or vector-displacement in your image, it may contain negative values, and values greater than 1. So it's important that Color > 'Clamp' is not checked in any texture you might use in a Displacement modifier

If you want to use the vector-displacement image, you can bake it and use it like this:

enter image description here

The RGB to XYZ setting interprets the image as vectors.

If you wanted to use the scalar height along normals, you would do it like this:

enter image description here

The 'Normal' setting interprets you image as distance-along-existing-normals.

The reason for the existence of 'RGB to XYZ', is that it allows displacement along arbitrary directions, other than the normal.. (here , for example, the baked difference between 2 shape-keys..)

enter image description here

So you can include undercuts, using the Displace Modifier:

enter image description here

.. that's not possible, simply along normals.

Having said all that, these days, you get better and less fiddly control by using Geometry Nodes. Blender's legacy Texture system will be weeded out, eventually.

$\endgroup$
2
  • $\begingroup$ Thank you for your comprehensive, the RGB to XYZ setting has solved my problem. I'll have to investigate geometry nodes separately, and probably ask a follow-up! I am using a Minimum math node within the displace texture, but that doesn't seem to trigger the issue referred to by your emboldened note about Color > 'Clamp'. $\endgroup$
    – user977042
    Oct 23, 2023 at 6:54
  • $\begingroup$ Hi, @user977042.. Thanks! I emboldened 'clamp' because I thought that was the problem with your case, as shared. Also considered doing it via GN, but this answer was getting a bit long. The GN setup is very simple, at its root .. just 'Set Position' driven by a texture. You may have to split edges before deformation and weld afterwards to avoid falsely interpolating position over UV seams. $\endgroup$
    – Robin Betts
    Oct 23, 2023 at 7:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .