Functional Terrain

Started by MooseDog, December 28, 2006, 01:27:59 PM

Previous topic - Next topic

MooseDog

http://forums.planetside.co.uk/index.php?topic=195

First of all, thanks and congratulations for this tutorial.  It's exactly this sort of pure research that's going to make TG really take off.

So, for some applied research, I managed the following terrain.  I've attached a render, a screencap of the network, and the .tgd file, all for dissection, inspection and education.

What I was not able for the life of me to do was to limit the Perlin 3D detail to certain altitudes.  I tried the Distribution Shader in as many different hook-ups as I could think of, and nothing seemed to work.  At least for me.  If someone can figure it out, pls. share.  That would be some fantastic problem solving!

Here ya go:


Oshyan

The Distribution Shader probably needs a computed normal to work properly. Not sure if you can compute a normal anywhere in your function network but I imagine with that bit of info you may be able to sort it out.

- Oshyan

MooseDog

#2
thank you oshyan.  i'll give it a shot.

my understanding may be incomplete though :D, so just for clarity's sake, i understand both vertex and poly normals as being heading, pitch and bank vectors regarding which direction into space the vertex or polygon is facing.  one use of this info is normal maps, which represent this through the use of red, blue and green colors to describe displacement direction. 

would matt's computed normal contain or provide altitude (co-ordinate) or slope information as well then?  just trying to understand.  thx again!

glen5700

Hi,
I have been working on this and here is what I have come up with.

Here is the terrain setup.


This image shows the strata and outcrops shader with no restrictions.


Now with the strata limit max slope (Distribution shader) on you can see strata on the flat elevations but not on the steep slopes. Cool!


Now with the strata limit min slope on you can't see any strata on the steep slopes. Here is were the problem comes in, my original thought was to have strata just appear on the steep faces.


Now this could be me or Terragen, I have also included the file.
http://www.3ddigitalgraphics.com/terragen/mixed_strata.zip
I have tried various combinations of settings but could not get the strata on the steep slopes, any thoughts?

Thanks,
Glen




Matt

Hi Glen,

It should be possible to achieve this by using a Compute Normal somewhere before you start applying any shaders that need to be constrained by slope. For example, you might want to put it after the fractal and the displacement shader, before the distribution shader.

It's best to use Compute Normal sparingly, especially if there are shaders above it that are slow to compute. Anything above the Compute Normal will take 3 times as long to compute during rendering.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

glen5700

Hi Matt,
I will give it a try after I'm home tonight and will let you folks know how things went.

Thanks for taking the time to reply,
Glen

glen5700

Matt's feedback worked and I came up with some interesting results. The scene here is the same as the above scene's, but with the Compute normal things look quite a bit different. The settings were patch size set to 100 and smooth was checked. The camera angle is new to show the strata close up and, the image took 1 hour and 38 minutes to render. There's also some strange dark (looks like shadows) patches on the landscape - need to investigate.

More will be coming on this.

Thanks,
Glen

BPauba

I have been working at understanding the basics of making function terrians for about an hour now, and i have a couple general questions for ya...

1) is creating a terrain with pure functions realistic? Or will I have to implement procedural terrains and whatnot to get a good looking terrain.
2) if creating final terrains with functions is not realistic, what are the advantages of knowing how to do it?
3) is there any good reading material that will help me understand functions?


I have more, but i cannot tihnk of em right now!

David Burnett

Quote from: BPauba on January 05, 2007, 02:27:55 AM
1) is creating a terrain with pure functions realistic? Or will I have to implement procedural terrains and whatnot to get a good looking terrain.

It's difficult at the moment, but that is due to the lack of noise functions, TG2 does not even have a decent stand alone Perlin function. When we get more noises, either with TG2 or though third party add-ins then the worlds your oyster.
Functional terrain are procedural terrains, it's just the function node network is written in C++ and disguised as shaders :-)

I would imagine that many of the people who have tried to use functional terrains are MojoWorld users too, I know Calyxa and efflux are, well Calyxa's a bit more than just a MW user ;) , MW can be used that way too, its called the 'pro-ui' .


Quote from: BPauba on January 05, 2007, 02:27:55 AM
2) if creating final terrains with functions is not realistic, what are the advantages of knowing how to do it?

It's the difference between able to change the oil and being able to strip down and replace the engine.
What you can do with Power fractal is amazing, but I want to be able to use or change the fundamental
algorithms that it uses rather than just change the settings.

It also allows you to do things that you can't do using Power fratcal, Glen5700 is working on a Dry Mud Shader for example http://forums.planetside.co.uk/index.php?topic=284.0 and efflux has also created some nice textures http://forums.planetside.co.uk/index.php?topic=151.msg1043#msg1043 both of these use the Voronoi functions,

I would also say it encourages use of the Node Network, with is where the real power in TG2 lies.

Quote from: BPauba on January 05, 2007, 02:27:55 AM
3) is there any good reading material that will help me understand functions?

No, it's all guess work at the moment.

I'd advise you to download planetGenesis or World Machine and have a play, then both export ter files that you can load into TG2 to render. I know more about pG than World Machine (because I programmed it). It's much simpler than World Machine but it does allow to play with how a few choice noise function can build very nice terrains.

 

BPauba

#9
Quote from: David Burnett on January 05, 2007, 03:49:33 PM
Quote from: BPauba on January 05, 2007, 02:27:55 AM
1) is creating a terrain with pure functions realistic? Or will I have to implement procedural terrains and whatnot to get a good looking terrain.

It's difficult at the moment, but that is due to the lack of noise functions, TG2 does not even have a decent stand alone Perlin function. When we get more noises, either with TG2 or though third party add-ins then the worlds your oyster.
Functional terrain are procedural terrains, it's just the function node network is written in C++ and disguised as shaders :-)

I would imagine that many of the people who have tried to use functional terrains are MojoWorld users too, I know Calyxa and efflux are, well Calyxa's a bit more than just a MW user ;) , MW can be used that way too, its called the 'pro-ui' .
Quote from: BPauba on January 05, 2007, 02:27:55 AM
2) if creating final terrains with functions is not realistic, what are the advantages of knowing how to do it?


It's the difference between able to change the oil and being able to strip down and replace the engine.
What you can do with Power fractal is amazing, but I want to be able to use or change the fundamental
algorithms that it uses rather than just change the settings.

It also allows you to do things that you can't do using Power fratcal, Glen5700 is working on a Dry Mud Shader for example http://forums.planetside.co.uk/index.php?topic=284.0 and efflux has also created some nice textures http://forums.planetside.co.uk/index.php?topic=151.msg1043#msg1043 both of these use the Voronoi functions,

I would also say it encourages use of the Node Network, with is where the real power in TG2 lies.

Quote from: BPauba on January 05, 2007, 02:27:55 AM
3) is there any good reading material that will help me understand functions?

No, it's all guess work at the moment.

I'd advise you to download planetGenesis or World Machine and have a play, then both export ter files that you can load into TG2 to render. I know more about pG than World Machine (because I programmed it). It's much simpler than World Machine but it does allow to play with how a few choice noise function can build very nice terrains.


Awesome stuff, I appreciate you helping me out. I am a fan of math, but I have never dealt with math in a visual way like this (why cant they teach this kinda stuff in school!). Alright, ill keep on messing around and hopefully have some sort of progress in the future. Thanks for the help, I will see you around.

su_liam

Quote from: David Burnett on January 05, 2007, 03:49:33 PM
Functional terrain are procedural terrains, it's just the function node network is written in C++ and disguised as shaders :-)

An implication of this is that procedural terrains are typically faster to render.  The node network is essentially a kind of scripting language. If a particular node structure proves to be sufficiently useful to enough people it is worthwhile to convert into a procedural terrain.  Of course this requires programmming expertise and access to the inner workings of TG2. It's also time-consuming at the front end. More options on the procedural terrain end is definitely a good thing. Cuts down on those week-long renders. But I do appreciate the ability to put together functional terrains, especially for oddball one-off effects.