Page MenuHome

Sculpt Tiling Feature
AbandonedPublic

Authored by Antonis Ryakiotakis (psy-fi) on Jul 20 2015, 10:46 PM.

Details

Summary

Adds 3D-Tiling options to the sculpt tool. This is very similar to the symmetry options in the sense that it replicates the strokes. For tiling this replication happens with a linear offset to fill the whole object along one or more axis.
This allows to create geometry that can be tiled seamless. One use case is the creation of tileable textures by sculpting high resolution geometry and then rendering it with an orthographic camera to create maps for diffuse, normal, ...

Diff Detail

Event Timeline

Not bad! I worry a bit that small tile values might cause hangs while the stroke is executing.

source/blender/makesdna/DNA_scene_types.h
1862

These should go to paint symmetry settings as they could potentially be used for other modes as well.

Not bad! I worry a bit that small tile values might cause hangs while the stroke is executing.

Yes, the tiling settings can easily be missconfigured to result in very high stroke replication counts... and kill CPU and memory usage. The existing radial symmetry basically has the same problem. For that there is a limit of 64, which is enough to give me very long hangs when painting for a few seconds.
My current minimum value for the tiling offset (0.01) is quite low of course (and should probably be increased to at least 0.1 or so). But on the other hand it all depends on the object-size/offset ratio. So even an offset of 1 will kill performance as soon as someone sculpts a very large object.
I thought about a limit for the repeats (in many cases one repetition in each direction would be enough). But limiting it only by the object size seemed more intuitive.

I think you might want to tile relative to the object bounding box (or original bounding box) instead. What you want is your stroke to be repeated at the other side of the mesh for such workflows. This gives you a nice default value of 1 for tiling and makes the tool easier to predict and harder to misconfigure - a current value of 0 gives infinite strokes while you really need to set the tile count high to cause a hang with a relative value.

Making the offset relative would make it unpredictable when the object shrinks/grows due to the sculpting. As noted in the initial comment this feature is intended to be used to sculpt geometry that gets rendered to create tileable textures. For this workflow one needs to be sure that the geometry repeats at a specific interval. So making the offset relative to the sculpted objects size would easily break this workflow (maybe in some hard to notice way that only manifests after hours of work when you finally see the tiled result).
An alternative could be to allow to use another object as reference for the size and calculate relative offsets from that one. But that feels really inconvenient for my taste.

Setting the offset to zero is blocked through the minimum value of the tile_offset property. But as stated above this probably should be increased a bit to make it harder to create very high repetition counts by accident.

So all in all I still see the absolute offsets with a sane default and minimum as the best usability/risk ratio.

Looks lke artist feedback favours an absolute setting, so I'll commit tomorrow :)

Sergey Sharybin (sergey) requested changes to this revision.Jul 23 2015, 9:23 AM

Please make code style consistent with the rest of the code before applying.

source/blender/editors/sculpt_paint/sculpt.c
3461
const float *bbMin = ob->bb->vec[0];
3469
for (dim = 0; dim < 3; ++dim) {
3471

Same as above, and make it consistent.

3491
} while (cache->location[2] < end[2]);
This revision now requires changes to proceed.Jul 23 2015, 9:23 AM
Tilman Blumhagen (sternmull) edited edge metadata.
Tilman Blumhagen (sternmull) removed rB Blender as the repository for this revision.

Corrected coding style.

Tilman Blumhagen (sternmull) set the repository for this revision to rB Blender.
Tilman Blumhagen (sternmull) marked 4 inline comments as done.Jul 23 2015, 1:06 PM

Committed, thanks again for the patch!

Thanks for reviewing and committing.