How to smooth out terrain with scripts

Hi there
So i have been making a terrain generator.
Concept: parts for outlines => FillBlock individual parts (sounds crappy but suprisingly stable)
(this was 18sec, 10sec with “inpatient” mode)


But there is a problem.

Square edges.

(not as bad here)

How can i smooth this out? If i can.

1 Like

My first suggest is to decrease the part size, but it can’t be more smaller than 1,1,1, else it’ll just render the ceiling of the given values.

You can also try to union the parts, smooth it out (using something like smoothing radius) and turn it into terrain, but I’m not sure if the parts to terrain supports unions. Have the parts step up less steeply or use wedges alongside the parts.

Other than that it looks pretty good for random terrain generation. You can’t really see the square edges from the outside because of the grass.

Point by point.

Ther are 1,1,1… okay not exactly, more like 1, (layer height) ,1

No union support as far as i know. Not bad tho.

thx :smiley: i optimised the living h* out of it tho.

good idea

Thank you, you made my brain work.

Having wedges along the parts, will problably not work. When using fillblock on wedges, the just fill the box hitbox for the wedges.
grafik
it used to be a wedge

Using FillBlock you’re only going to be able to write 0 or 1 to the occupancy of terrain cells, which will have this jagged effect - cells with 0 and 1 next to each other create steps like that.

If you want a smoother result, you’re going to have to either do a post-processing pass to “blur” the terrain occupancy (not that hard to do…) or use some kind of other method for writing to the terrain that produces gradients instead of 0/1

1 Like