Displacement Auto-Size?

I made a quick displacement map, but I’m not finding how to auto-size it to my object:

EDIT: that is, how do I make the bitmap FIT the mesh?

How are you displacing it? True displacement in nodes, or displace modifier? For the modifier, adjust strength. For true displacement, adjust scale on the displacement node.

1 Like

The bitmap should fit ONCE across the square mesh, not the strength of the displacement.

Okay. And how are you displacing? True displacement in nodes or displacement modifier? (One way to do it for either is to use UV mapping, but that might not be as automatic as you’d prefer, although it is very, very simple for a mesh like this.)

1 Like

Displacement Modifier.

I’m afraid I don’t know the best way to do that. Well, okay, the best way is to not edit the plane in edit mode, and just scale it object mode to adjust its dimensions (possibly, scaling in local XY only to avoid changing the height.)

But there ought to be a way to map the displacement texture to generated coordinates. I just don’t know how. Probably.

In general, without using UVs, how are images/Textures sized to a given object?

In Lightwave, for image textures there is an “AutoSize” button, that scales & centers an image to the bounds of the material (‘Surface’ in LW parlance), so it doesn’t fit the Object the Surface is attached to, but the min/max usage of that particular material. EG, it fits the canvas, not the frame the canvas is in.

I don’t understand what editing the plane would have to do with this, versus sizing in Object mode (???) If I’ve modeled, say, a “television set” , how would one size the texture to make it correctly fit the screen? (And I know that UVs answer everything, but surely there’s a simple way to do this?)

In the Displacement modifier settings, you can switch Texture Coordinates from ‘Local’ to ‘Object’, add a control object to your scene (i.e. an Empty) and assign that in the modifier. Then you’ll be able to move, rotate and scale that Empty and it will effectively be the transform of the texture coordinates for the modifier. Not sure if there’s a way to auto-fit it though.

‘Local’ texture coordinates are generated in local space, without taking object’s transform into account, so if you were to scale in object mode, the object would just get bigger, but texture mapping won’t change.

‘Global’ coordinates do take transform into account, and if you scale the object the mapping will change as well.

1 Like

Ah hah! Good explanation.

FWIW, I think an “AutoSize” addon would be welcomed by many. It would have to essentially generate a bounding box for materials, and hand that off to a given texture. The LW version didn’t handle rotation, just projection along axes, which in the majority of cases was adequate, if not optimum. For the case in hand, sizing a rectangular image to a rectangular mesh, it sure made life easier.

But, I think I’m missing a workflow step if this hasn’t been driving others crazy. For instance, this is a 1200x1200pxl displacement map for a 1000x1000 unit rectangle. It sounds like most people don’t have difficulty matching such things up, so I suspect I’m approaching it wrong. ??

1200 pixels is not a problem. 1000 units is. An (image) texture’s dimension is typically fully mapped in just 0 to 1 range and repeated. For an object 1000 units wide, generated texture coordinates would mean 1000 repetitions. So if your plane is 1000x1000, I guess a control object would need to be scaled down to 0.001 up 1000 times to map the image exactly once. (up, it’s up, I always keep forgetting which way is which, duh :flushed: )

Oh, and I just remembered there’s also a UV Project modifier which should be able to actually, well, project UVs (if I understand your description of how LW works in that regard), i.e. from one or more simple planes.