Flat Spots

Started by PeanutMocha, June 26, 2011, 03:06:10 am

Previous topic - Next topic


June 26, 2011, 03:06:10 am Last Edit: June 26, 2011, 11:30:35 am by PeanutMocha
I'm trying to create some flat spots in my terrain to position buildings on.

My current strategy is to use a Heightfield Merge with the Lowest (cut away) setting, loading a heightfield much smaller than the overall scene, just big enough to hold the building OBJ. I then use a Heightfield Generate with a Painted Shader as the input (to create a specific shape for the building) and a Heightfield Adjust Vertical to get it to just the right altitude.

I ran into a few problems with this approach:

A) I can't figure out how to translate the smaller shader to the position where the building is supposed to be.  The Use Shader tab of the second Heightfield Generate has controls to set the position of the shader, but this does not appear to affect my render.

B) Although the second Heightfield Generate does cut out the larger one, there is still significant curvature.  The cutout seems to follow that curvature.  I'm not sure what's causing that.  I added a plane to more clearly show this (see image).

C) Is there a way to ease the transition between the flat and procedural areas so that it doesn't look like a sheer cliff?  I know that two separate heightfields have a border blending option, but I can't find a way to do the same thing with merged heightfields.

TGD is attached.

Advice on either how to fix my approach, or a better approach, is greatly appreciated.

Henry Blewer

I have found that making my objects with very deep 'basements' helps to deal with hilly terrain. I also extend the stairways.
Forget Tuesday; It's just Monday spelled with a T


Just thinking out loud - would a crater shader be of any use?


June 26, 2011, 04:05:42 pm #3 Last Edit: June 26, 2011, 04:54:54 pm by Tangled-Universe
Here you go...the tgd contains explanations as I changed the node names to make them describe what they do.

After the terrain I use a distribution shader as a "sit on" shader for an altitude clamp function.
The function reads the altitude and you can set a desired maximum altitude of your plateau.
The simple shape shader then masks this distribution shader so you can move your area by only adjusting the simple shape shader's position.
Be aware that you might need to adjust the max altitude for plateau value if you move the shader.

Consequently, you could use the "min input" of the clamp scalar to raise certain areas to a minimum altitude.



Wow that looks great!

Is there any way to ease in to the flat areas (to avoid the sharp cut out look)?



June 27, 2011, 03:41:33 am #5 Last Edit: June 27, 2011, 04:00:05 am by Dune
Just soften the edges of the simple shape I'd say.

Another solution would be to use a merge shader (highest raise) in a terrain generate and soft simple shape combination. Raise the simple shape until it just rises above your terrain. But some parts may still raise on the platform... so for a really flat area TU's solution is better.


Yep, just increase the "colour edge width" value.


I've always looked for a better way of achieving 'flat areas' on any given terrain for a number of purposes - thank you all for this information.


Quote from: choronr on June 27, 2011, 04:53:32 pm
I've always looked for a better way of achieving 'flat areas' on any given terrain for a number of purposes - thank you all for this information.

Ditto...this looks tres elegant
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist