Author Topic: Is there a way to seperate masks, and can i align maps to them?  (Read 1026 times)

Hi! I'm new to SD, but I've watched a bunch of tutorials and gotten quite a good hang of the workflow, but I feel like I've only scratched the surface of what's possible.

Right now I'm working on some modular designs, where I wanna bring some different heightmaps together randomly, so I'm trying to do everything procedurally.
I'd like to take some height design and place it based on the position of a mask.

So far the best solution I've come up with is making luminance variation in the tile sampler and splitting the tiles up according to value, and then tiled whatever elements I wanted inside over the whole map and applied the mask.
This does not allow for a lot of changes to the pattern before this method becomes unusable, and the tiling won't be aligned properly with the borders.
I've made this illustration for the two problems I had in mind, I'm not sure there's any way of doing it, but here's to hoping, thanks!. :)

That’s actually a really interesting question - and a pretty cool workflow (if it could be done).

It may be possible to use a pixelProcessor node to find out the positions of the white corner pixels, and use these values to calculate the scale and offset in a transform node.

Not sure I’ll have time outside of work for a little while - but I’ll give it a go at some point.

Hey ho! I might be misunderstanding the question, but how about this?

Am I mistaken in assuming the one from your images is actually a Tile Random, not a Tile Sampler?
Tile Sampler doesn't support the whole thing with splitting the shapes while keeping the shapes from overlapping, right? So if you want that, we'd need to use Tile Random.

There is the Input-Image-option, however Tile Random doesn't seem to support more than one custom input so that won't work just like that... How about this option? It assumes that all used Tile-Samplers have the same general settings of course:

This squatches and stretches the inputs of course. If you don't want that, maybe use a Tile Sampler with multiple inputs as above in the image?

the flood fill node gives you size in both dimensions and can fairly easily give you center position of your mask shapes. don't remember exactly which channel has the gradients, but make a mask of the center value of both x and y gradients and multiply them with each other to give you the center.

once you have the center pixel, multiply by position in a pixel processor and subtract (0.5,0.5) to get the distance to center (assuming your shape is actually centered). fill the shape with the resulting values with a distance node and in a new pixel processor offset the actual shape with that information.

gonna be a bit more effort to solve all of the details, but it's certainly possible.

you could probably also have it automatically pick the shape from your library that best fits the shape you want to fill, but that might be a bit more involved.