Procedural Canyons (hurrah!)

Started by ProjectX, April 05, 2007, 02:10:03 PM

Previous topic - Next topic

ProjectX

I've worked out procedural canyons for you all (don't know if this has already been done or not). It's so unbelievably simple I won't post it as a clip file, I'll tell you how to do it.

Ok, make a fractal terrain (relatively flat, but with some small variation), this is going to be the variation for your canyon plateaus and also floors.

Now, in the terrain node editor, create a displacement shader. Plug the terrain into the input of the displacement shader, and plug the output of the displacement into the compute terrain node.

Nothing happened? Good.

Now, in the node editor, create another fractal, but do not connect it to anything. To begin with, don't mess around with the settings much, (i'm not actually sure if this helps or not, but I think changing the displacement amplitude sets the canyon vertical noisiness, along with feature scale being lateral noisiness)

No add a "get altitude" node and connect the newly created fractal to it. Add a "Y to scalar" function onto the end of that. What this does is converts the altitude of the terrain we've generated into a scalar value. This does have the downside of meaning that you have to do your funky lateral displacement tricks AFTER the canyon has been made.

Now, we're going to add a "multiply scalar" node, and a constant scalar node. Hook up the Y to Scalar into the multiply scalar input1, and the constant into input 2. You can set the constant to whatever you like, the higher the value, the sharper the canyon walls will be, whereas with lower values you'll end up with shallower slopes, and greater slope variation. I used 100 originally, and that gave very straight vertical walls, in the render below I used 10.

So now we have the scalar values for the altitude of our steep-walled terrain, what we're now going to do is clamp them, so that they don't go higher than a certain value (our plateaus) or lower than another value (our troughs). Add a clamp scalar function and hook the multiply scalar into the input, and two new constant scalars to the minimum and maximum handles. Set the minimum to the height of the floor, and the maximum to the height of the plateau (in meters). If the plateaus aren't high enough, then you can either increase the displacement multiplier in the displacement shader, or increase the scalar multiplyer.

Plug the clamp scalar into the function handle of the displacement multiplier, tweak and render.

Enjoy!

EDIT: One thing I've discovered while playing this is that if you adjust the multiplier, you have to adjust the clamp ranges. This is prossibly because the scalar range of the altitude is given between 0 and x. If we were to add nodes that subtract half of x and then multiplies, the down-ness would be multiplied along with the up-ness. So if your terrain goes flat again after tweaking (or before), just tweak the clamp settings - a good start is min: 0 and max: 1000, and move on from there.

I could of course be making no sense, and if so it is because I need sleep. Have fun.

child@play

wow, very well thought out and explained. thanks a lot, this will be useful  :)
perfection is not when there's nothing more to add, it's reached when nothing more can be left out


rcallicotte

Brilliant.  Thanks.  I'm putting this in my notes.  LOL.  Cooool.   8)
So this is Disney World.  Can we live here?

nvseal

#3
Nice work, I've been wondering how to do this forever.  I'm going to have to try this out later.  8)

Harvey Birdman

Really - that's pretty sophisticated use of the node network. Or at least it seems so to a raw noob like me.

;)

Will

Neat, thanks man! I count get it to work though maybe I'm doing somthing wrong.

Regards,

Will
The world is round... so you have to use spherical projection.

Will

#6
Nevermind I fixed it. For those who are having any problums try ramping up the displacment of your first fractal.

Regards,

Will
The world is round... so you have to use spherical projection.

Harvey Birdman

Quotetry raping up the displacment of your first fractal


Ummm.... you know, the wife already thinks I'm spending too much time with this. She starts hearing talk of raping the displacement and she's going to stop me from hanging out here.

;D

Will

whoops, thanks for the heads up   :-[ fixed

regards,

Will
The world is round... so you have to use spherical projection.

Harvey Birdman


Will

Yea I deserve it though for not checking my spelling.  ;)

Regards,

Will
The world is round... so you have to use spherical projection.

rcallicotte

HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHA.

:D

That was hilarious!  You guys are a hoot.
So this is Disney World.  Can we live here?

RealUser

Markus / RealUser
...................................................................
visit my Renderosity Gallery at
http://www.renderosity.com/mod/gallery/browse.php?username=RealUser
...................................................................

edlo

Very nice investigation and results...now that is much better than dropping the clip or world file, good job ! ;D

neon22

Nevertheless :-)

and it doesn't seem to matter if you have anything on input to the get altitude.
I suspect this node doesn't do anything with its input