Author Topic: Functional Terrain  (Read 13146 times)

Offline MooseDog

  • Member
  • *
  • Posts: 100
    • MDStudios
Functional Terrain
« on: December 28, 2006, 05:27:59 PM »
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:


Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 12654
  • Holy snagging ducks!
Re: Functional Terrain
« Reply #1 on: December 30, 2006, 02:13:48 AM »
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

Offline MooseDog

  • Member
  • *
  • Posts: 100
    • MDStudios
Re: Functional Terrain
« Reply #2 on: December 30, 2006, 03:53:57 AM »
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!
« Last Edit: December 30, 2006, 04:19:08 AM by MooseDog »

Offline glen5700

  • Member
  • *
  • Posts: 136
    • 3D Digital Graphics
Re: Functional Terrain
« Reply #3 on: December 30, 2006, 05:10:30 PM »
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




Offline Matt

  • Planetside Staff
  • *
  • Posts: 3388
  • I'm the crazy one
Re: Functional Terrain
« Reply #4 on: January 04, 2007, 04:41:39 AM »
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.

Offline glen5700

  • Member
  • *
  • Posts: 136
    • 3D Digital Graphics
Re: Functional Terrain
« Reply #5 on: January 04, 2007, 12:26:30 PM »
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

Offline glen5700

  • Member
  • *
  • Posts: 136
    • 3D Digital Graphics
Re: Functional Terrain
« Reply #6 on: January 05, 2007, 04:32:10 AM »
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

Offline BPauba

  • Member
  • *
  • Posts: 147
  • Twisting Reality
    • DeviantART Gallery
Re: Functional Terrain
« Reply #7 on: January 05, 2007, 06:27:55 AM »
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!

Offline David Burnett

  • Member
  • *
  • Posts: 86
Re: Functional Terrain
« Reply #8 on: January 05, 2007, 07:49:33 PM »
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' .


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.

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.
 
 

Offline BPauba

  • Member
  • *
  • Posts: 147
  • Twisting Reality
    • DeviantART Gallery
Re: Functional Terrain
« Reply #9 on: January 05, 2007, 08:28:30 PM »
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' .
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.

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.
« Last Edit: January 06, 2007, 03:06:44 AM by JavaJones »

Offline su_liam

  • Member
  • *
  • Posts: 16
Re: Functional Terrain
« Reply #10 on: April 20, 2007, 08:50: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.

 

anything