Planetside Software Forums

General => Terragen Discussion => Topic started by: l.a. akira on May 02, 2007, 03:56:02 AM

Title: Constraining Fractal terrain with a distribution shader
Post by: l.a. akira on May 02, 2007, 03:56:02 AM
Hey guys,

I'm setting up a scene with a piece of DEM data and want to add some detail using fractal terrain confied by a distribution shader. Using the altitude constraints seems to be fine but when I try to limit the minimum slope, TG seems to want to ignore it. Any ideas if this is a bug or am I simply doing something wrong?
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: ProjectX on May 02, 2007, 06:42:50 AM
You could add your fractal as the displacement function for a surface layer. That would do it.
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: l.a. akira on May 02, 2007, 12:39:52 PM
Fractal Terrain has its own displacement built in and resides in the terrain group. I dont see how that has to do with the shaders group.
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: ProjectX on May 02, 2007, 12:59:52 PM
You can apply displacement with anything at almost any point in the render line.

Most people apply extra displacements with fractal terrain (which is a preset powerfractal actually) in the surface layers and leave only the major terrain sculpting to come before the compute terrain. AFAIK it improves render times that way.

And since slope can only be calculated after a compute normal or compute terrain it would be best to put it in a surface layer (which comes after the compute terrain) rather than add a compute normal before the compute terrain and then do your slope calculations.

The main problem with starting up with TG2 (which needs to be rectified in the startup guide) is that people assume that the terrain and shaders groups, etc. Actually affect the way terragen renders anything, whereas really they are just there to help organize things and make them look nicer and easier to understand.

It is entirely feasible to make the whole terragen file (including the camera files and render nodes) appear under the shaders box in the node editor. It doesn't mean they will be treated as shaders though.
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: Oshyan on May 02, 2007, 07:17:29 PM
Slope keying requires a computed normal. If you're trying to limit by slope in the Terrain group, before the "Compute Terrain" node (which also determines normal), slope is not available. You can either add the fractal detail in afterward in the Shader group, or put a Compute Normal into the Terrain group above your fractal detail node(s) in the network.

- Oshyan
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: l.a. akira on May 02, 2007, 09:39:32 PM
got it, thanks guys! :)
Title: Re: Constraining Fractal terrain with a distribution shader
Post by: BPauba on May 06, 2007, 02:44:33 PM
You can get masking results with a [distrobution] shader before a [compute terrain] node, but you get some really odd semi-circle looking terrain features. I would just stick with doing it after the [compute terrain] node