Planetside Software Forums

General => Terragen Discussion => Topic started by: Alkin on June 02, 2009, 10:53:15 AM

Title: Sand (Desert, dry lake surface, cracked surface)
Post by: Alkin on June 02, 2009, 10:53:15 AM
Hi.
Ive searched forums for sand surface and come up with some results but mostly it is a dune texture like on this picture here (http://www.answersincreation.org/curriculum/geology/images/Sahara_desert.jpg) which is also something i need but id like to know how to make ripples which are in bottom right corner of the picture.
Also i am interested how can i make something like this (http://www.phototravels.net/namibia/ndv2/namib-desert-air-v-19.html). Almost flat but with texture.
The last thing i would like to get advise on is how to make something like this (http://www.terragalleria.com/images/middle-east/isra10292.jpeg)

Thank you in advance.

P. S. Yes i know, i am complete newb. ))
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: RArcher on June 02, 2009, 11:50:30 AM
The first two are possible just using a powerfractal.  Simply spend some time playing around with the various values until you get something close, you will also get the benefit of learning quite a bit too.

The last one is also possible.  Perhaps see here for more detail: http://forums.planetside.co.uk/index.php?topic=6432.0 (http://forums.planetside.co.uk/index.php?topic=6432.0)
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: nvseal on June 02, 2009, 12:01:54 PM
You can also look at the function landscape tutorials here for the sand ripples. http://forums.planetside.co.uk/index.php?board=6.0;sort=subject (http://forums.planetside.co.uk/index.php?board=6.0;sort=subject)
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Seth on June 02, 2009, 12:14:12 PM
Quote from: RArcher on June 02, 2009, 11:50:30 AM
The first two are possible just using a powerfractal.  Simply spend some time playing around with the various values until you get something close, you will also get the benefit of learning quite a bit too.



errrr... did anyone already made good sand ripples using powerfractal ?
I know Wiwine did using functions but i don't remember good PF sand ripples from anyone (but i may be wrong of course)... and i spent some times trying but i was faaaaar from the picture i just checked (the first Alkin posted)
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Alkin on June 02, 2009, 12:24:44 PM
Quote from: RArcher on June 02, 2009, 11:50:30 AM
The first two are possible just using a powerfractal.  Simply spend some time playing around with the various values until you get something close, you will also get the benefit of learning quite a bit too.

The last one is also possible.  Perhaps see here for more detail: http://forums.planetside.co.uk/index.php?topic=6432.0 (http://forums.planetside.co.uk/index.php?topic=6432.0)

I did spend ton of time with PF. And again i did manage to come up with some nice dunes but not ripples.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: littlecannon on June 02, 2009, 01:06:19 PM
Hi Alkin... have you done a search for pelin noise (Function). I think you may have to use this to get what you want. I'm pretty sure there was a discussion on this a while ago. I would advise you what to do... But I don't have much of a clue when it comes to functions (shame).

BUT... I have found this http://forums.planetside.co.uk/index.php?topic=1168
and with a little magic... you could have the sand you always dreamed of.
Thanks, Simon.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Seth on June 02, 2009, 01:31:48 PM
yes, functions.
not only powerfractal ;)
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: RArcher on June 02, 2009, 01:49:57 PM
Ahh, I was mainly talking about the dunes themselves for the powerfractal.  For the close up ripples, I just use an image map based displacement to handle that:

http://forums.planetside.co.uk/index.php?topic=6560.0 (http://forums.planetside.co.uk/index.php?topic=6560.0)
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 02, 2009, 04:30:29 PM
Quote from: Seth on June 02, 2009, 01:31:48 PM
yes, functions.
not only powerfractal ;)

Are there any known issues using functions over powerfractals? It would seem that a Sine wave would be the right thing to use in this instance.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Seth on June 02, 2009, 06:34:04 PM
Quote from: RArcher on June 02, 2009, 01:49:57 PM
For the close up ripples, I just use an image map based displacement


yeah and the result is good, as the ripples i saw from errr... Saurav and Efflux (i think or was it Moodflow ?) ;D
but i would like to find a way to do some ripples with PowerFractals too
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: dandelO on June 02, 2009, 08:07:46 PM
With perlin ridges set in the fractal's noise flavour and low, close values for scale, you can make decent looking sand ripples by stretching the X or Z noise, depending which way you want the wind/water to have piled the sand in relation to your FOV.

Here is a very quick shot at it just while I read this thread, quality isn't a factor here, just demonstration... ;)

[attachimg=#]

Here's the values I've changed in a default power fractal...

scales: Feature=0.5, Lead-in=0.5, smallest=0.25.
Colour: Contrast=1, roughness=0
Displacement: Amplitude=0.25, roughness=0
Noise: Flavour=Ridges, XYZ stretch= X=5, Y=1, Z=1
Warping: Disabled everything here.

The camera is 5m above the surface, these ripples are quite big then. :-\ You can get the idea, though.

I'm looking directly down the Z axis so the X value needs stretched to make the ripples go horizontaly like this.
To make tighter ripples, drop the Z-stretch value, in increments of 0.1 until you have the desired size, is how I'd go about it...
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: dandelO on June 02, 2009, 09:08:05 PM
Same thing, bigger scales and I've used a 3D painted shader to draw where the small ripples go, which are the same scales of the last post's with noise stretch - X=15, Y=1, Z=0.75. The painted shader is just plugged into the blendshader of the ripples.

Not perfect by any means but workable if you spent enough time on it.

[attachimg=#]
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 02, 2009, 09:47:37 PM
I spent a couple of hours playing with this, and here's where I got to using functions. I may spend a little more time with it. The trick with the ripples, is to to use Get Altitude to drive the Sine function, so the contours follow the landscape, and a Bias function allows you to give the ripples more of a steeper peak.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Seth on June 03, 2009, 02:07:07 AM
good start Hetzen !
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: domdib on June 03, 2009, 04:44:11 AM
Looks great Hetzen - any chance of a node shot or clip file?
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 03, 2009, 05:22:18 AM
I need to tidy up my TGD, but after I do, I'll post it with some instructions on how and why I used what I did, with the proviso that anyone modding the network post their results back in this thread.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Alkin on June 03, 2009, 12:41:00 PM
Quote from: Hetzen on June 02, 2009, 09:47:37 PM
I spent a couple of hours playing with this, and here's where I got to using functions. I may spend a little more time with it. The trick with the ripples, is to to use Get Altitude to drive the Sine function, so the contours follow the landscape, and a Bias function allows you to give the ripples more of a steeper peak.

It looks very nice. Could you give more details on how to make something like that?
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: dandelO on June 03, 2009, 01:09:22 PM
Nice, Hetzen.
I'm clueless when it comes to most of the functions, no idea. :)

I'm going to carry on with fractals and see where I get to...
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Alkin on June 03, 2009, 02:24:36 PM
BTW dandelO i am following your footsteps, but so far somewhat successful.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 03, 2009, 05:54:48 PM
Thanks for the comments guys.

As promised, I've attached a working TGD and pic of the node network, and I'll try and talk you through it.

I wanted to create ripples that followed the contours of the landscape, rather than all heading in one direction as you would get if you used just an X or Z value from a Get Position node as shown in the previous tutorial. What you have to remember, is that the Get nodes return the value at the point being calculated in the chain of commands. You'll notice that the ripples are applied after I had worked out some suitable settings for the basic dune shapes, because I wanted the function to look at where it was in relation to the height on the landscape.

A Get Altitude node is connected to an Add Scaler which is connected to a Perlin 3D Scaler to add some variation to the otherwise regimental concentricness you'd get with out it. (As described in the previous tutorial). This Add Scaler is then plugged into a Multiply Scaler before the Sin function.

A Sin function will take any value from -infinity to +infinity and always output a value from -1 to +1 as the input increments. It will do this in a curve shape that we all know from basic maths. The larger the the steps of value being fed into it, the faster it will output a curve from -1 to +1 back to -1. So with this in mind, the Multiply Scaler before the Sin Scaler acts as a frequency multiplier, ie the more I multiply the value of the input, the faster the oscilation from -1 to +1, resulting in more ripples per meter. OK? Still here?

So we now have an output of -1 to +1 as we go up and down the altitude of our landscape. What I wanted to do now is distort that sine wave with a Bias Scaler, which essentially looks at that curve and pinches or pulls the shape. Take a look in the node reference to see what I meen. But it only works on values between 0 and 1, so I now need to convert my -1 to +1 from the Sin Scaler to get my values between 0 and 1. To do this, I added 1 to (-1 to +1) to now give (0 to +2) and then divided this by 2 (or multply by 0.5) to give 0 to 1.

This is then connected into the displacment node, and the value of displacment inside that node I used was 0.3. Think of this as the amplitude, ie the height of the sine wave.

So there you go. Function nodes aren't really as daunting as you first think. There is a logic behind them, rather than some black art. Saying that, I've only recently just started playing around, and barely scratched at what can be done with them.

So have fun with this, and let me see what you come up with.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: mhall on June 03, 2009, 07:10:27 PM
Hi Hetzen,

Very cool.

I was just wondering ... can you use the clamp 0 1 node to restrict your values to between 0 and 1?

I'm just a lurker (I'm a photographer by trade and, though I did buy Terragen with Animation, I don't use it because I know that, if I start rendering,  I'm not going to stop! So I get my fix by reading the forums and admiring the artwork), but I thought I had read that was what the clamp node was for.

Just thought I would mention it as it might simplify your node network a bit.

Or am I off on that one?

Regards,
Micheal
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 03, 2009, 07:15:03 PM
Mhall, as far as I know, the Clamp 0 1 excludes anything below 0 and above 1, rather than compressing values into the range 0 to 1, could be wrong.

Sometimes I do wonder why I spend so much time in this program, when I know it would be far easier to just take a photograph or photoshop a series of images. But then I come up with cool ways of implementing this software in other stuff I do at work, where getting the right angle or changing the lighting or moving along a camera track would have a cost and resource implication.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: mhall on June 03, 2009, 07:52:31 PM
Got it - so rather than gradually compressing the values as with the multiplier/divisor the clamp node would result in flat spots where a series of values all return 0 or 1 with a slope of changing values between them.

Makes sense.

I love photography - and made a conscious choice to leave computer graphics to concentrate on photography about 9 years ago - but I'm also itching to really dive back in to Terragen. I love what I see here on the boards and I spend a lot of time on the road driving -  through California, Nevada, New Mexico, Arizona, Wyoming, Colorado, Oregon and Washington this year. Though I see beautiful vistas that I would love to photograph, I most often find myself wondering how I would workout the scene in Terragen or how I would model the plants or hero rocks. :)

Thanks for sharing your work.

Regards,
Micheal
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 03, 2009, 08:18:53 PM
No problems Micheal, I've borrowed enough off others here. I find myself looking at nature on the way into the office too, with TG in mind, clouds are great things to study with polarised glasses btw. ;D

What will compress numerical values outside of math, is a colour adjust shader funnily enough, by moving the black and white points, a bit like levels in photoshop. TG treats black as 0 and white as 1, anything above and below that value can still be a colour, except you won't be able to see it, hence the clamp function if you need to visually control values.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: mogn on June 04, 2009, 12:00:36 AM
Quote from: Hetzen on June 03, 2009, 05:54:48 PM
So we now have an output of -1 to +1 as we go up and down the altitude of our landscape. What I wanted to do now is distort that sine wave with a Bias Scaler, which essentially looks at that curve and pinches or pulls the shape. Take a look in the node reference to see what I meen. But it only works on values between 0 and 1, so I now need to convert my -1 to +1 from the Sin Scaler to get my values between 0 and 1. To do this, I added 1 to (-1 to +1) to now give (0 to +2) and then divided this by 2 (or multply by 0.5) to give 0 to 1.


The conversion between -1..1 can be done in another way (possible slower, but saves 1 node):

connect your input to the left input tab of a "mix scalar", connect a "constant scalar" value of 1 to the middle tab of the "mix scalar". Thats all, the output of the "mix scalar" if the function you want.

Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: Hetzen on June 04, 2009, 07:49:13 AM
Thanks for that, but I'm still unclear how it works. The wording in the node reference doesn't seem to help either, it doesn't explain how it compresses values outside of 0 and 1.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: domdib on June 04, 2009, 08:24:24 AM
Thanks for the TGD and the detailed explanation.
Title: Re: Sand (Desert, dry lake surface, cracked surface)
Post by: rcallicotte on June 04, 2009, 09:19:27 AM
Thanks for your work, Hetzen.  This is a great contribution to our community.