Planetside Software Forums

General => Terragen Discussion => Topic started by: Volker Harun on September 12, 2007, 06:55:05 am

Title: PowerFractal Lessons
Post by: Volker Harun on September 12, 2007, 06:55:05 am
I was asked once or twice to give lessons on my surfacing.
My technique is very easy but intuitive - I'll give you some basics here and maybe we end up with a nice scene  ;).

Feel free to ask questions by PM. I answer them by PM or in this thread.

Title: Part 1 - Basics
Post by: Volker Harun on September 12, 2007, 07:31:25 am
 ;D Start TG2 with a default scene.

You see that white rectangular in the render preview, which shows the boundaries of the Heightfield generate shader.
I love it, as I can use it for scaling purposes.

Go into the Heightfield generate shader and change its size to 100x100m (Picture 1).

Now zoom in. You'll see the shading of the Base colours node very nicely (Picture 2).

Set the values of the Base colours node to the following:
Feature Scale:        25
Lead in Scale:        25
Smallest Scale:       25
High Colour:           1
Colour Contrast:       1
Colour Roughness:      0
Noise Variation:       0
Lead in Warp Effect:   none

Leave the others to the default.
You should see now some nice and soft Perlin in the Render Preview (Picture 3).

Now, let us explore some setting:

Change the Colour Roughness to 5. Nothing should change.
This is because the smallest scale has the same value as the others.
Reduce the smallest scale to 1 and watch the changes. Looks more like a fractal.

Play around with the other scales and see how they work.
I end up with Feature Scale 5, Lead in scale 100 and smallest scale 1 (Picture 4).

Now adjust the colours of the fractal:
RGB codes I used:
High Colour: 196|189|174
Low Colour: 148|142|131

Play with the Colour contrast. I used a value around 0.5.

to be continued ...
Title: Part 2 - Adding a second layer
Post by: Volker Harun on September 12, 2007, 08:24:31 am
Fine, let us add some definition.

Add a new Power Fractal node to the surface shaders (Picture 5).
Rename it to Layer 1 (at least I will refer to it as Layer 1).

The new fractal has done 2 things. It covers the Base colours and it added displacements. I do not like both at the moment.
So please do me a favour and turn off the displacements of Layer 1.

Do you see the same thing as me? Base colours are still shining through. This is because Layer 1 has no Low colour enabled.
As Base Colours are quite bright, I change Layer 1's High Colour to black.

Again the Colour contrast is set to 1, Colour roughness to 0 and Noise variation is set to 0, too.
Play with the scales.
You can see that Layer 1 can be used now to blend the luminance of the Base Colours.

At the moment I get stuck with values of 10|10|10 for scale.
Why? With those even values, I can taste the flavour of the noise variations better ,-)
Change the Perlin noise to Billows, Ridges, Mix 1 and Mix 2. Pick what you like (what looks most fractal).

They look all the same? Not quite, but are very similar. Hmmmmmm.....

Okay, I am fair. Change the scales to for example: 10|20|1, Colour roughness could be ~5 again.
That is better!

I change the High colour to RGB 101|94|70 and lowered the Colour contrast to about .35

I started the first render ... and I am not at all satisfied!  :-[ :-[ :-[
It looks very familiar all over the place ... almost like an artifical pattern.

So the scale is what I will change- first: 9.5|170|1.3 (I love those numbers!) looks fine.
Still I need some unexpected variations.

Let us look into the Tweak tab ... and give noise variations a chance.
A value of 1 is not by luck the default for this value.
A rendered picture wants me to load that picture to TG0.9 as a heightfield (Picture 6).

So only some fine tuning is left.

to be continued ...
Title: Part 3 - Fine tuning the Shaders
Post by: Volker Harun on September 12, 2007, 09:07:09 am
So let us start from scratch!


Okay then how often have you saved this scene yet?  ;D ;D ;D

First thing I do now is to change the colour of Layer 1 again. Brighter and less saturated to blend into the Base colours.

Now guess what ... for adding more, different detail we add another Power fractal (Layer 2).
Give the High Colour a bright red and turn off the displacement.

Go to the Tweaks tab and choose a noise different from Layer 1 (I used Billows and choose now Mix 2).
Activate the Warp and choose reasonable value ~1.

It is a bit dominant. Thatswhy the Colour offset could be helpful (This means reduce it a bit to your taste).

For me it looks now like red scratches that a glacier has left on rocks (Picture 7).
Reducing the Colour Contrast and increasing the roughness is better (Picture 8).
And last, not least ... make Layer 2's colour match the others. (Picture 9).

You think this is nice?

Wait and see  ;D ;D ;D

to be continued ...

Title: Part 4 - Second Setup
Post by: Volker Harun on September 12, 2007, 09:58:19 am
Now comes the boring stuff ....

I am sorry, but this helps me to keep my scenes clean.

Create somwhere a new group and called for example '100m Shader'

Then look at Picture 10:
1. Mark the three shaders, and cut them out.
2. Go into the internal network of the new group and paste them there.

You may need to go one level up and back to the internal network to see the nodes again. Reconnect them if necessary.

Okay, time to save this group as a clip file. Go one level up, right click the group's title and choose Save Nodes as Clip-file.
It says '1 node saved', doesn't it? Do not worry about that.

Okay, let us start a new scene.
Add a fractal terrain. Go to the Terrain group and delete those heightfield shaders.
Add two other nodes by hand:
Merge shader
Transform shader
Connect them like shown in Picture 11.

The fun part comes now. Change in the Merge shader the merge mode for displacements to Subtract (A-Input).

It looks like that the transform shader is not needed ... but I keep it anyway. Else feel free to change the values to whatever.

I choose a PoV ~20m above surface.
Add a standard Surface shader. And maybe you want to import the '100m Shader'-Group now  ;)

Now assign to the colour function of your Surface Shader the Layer 2 of the 100m Shaders
(Picture 12)
Do the same with the Displacement of the Surface Shader and use a Multiplyer of -5.

Save the scene and make a test render. Attached are my result and the Scene file.

This is nice, but can be better!  ;) Maybe you already know what went wrong???

to be continued ...
Title: Part 5 - Repair the Fractals
Post by: Volker Harun on September 12, 2007, 10:27:26 am
I tell you my impressions.

When developing the shaders, it looked much nicer:

And using a displacement of 5 at an altitude of ~20m with such a dumb result is a bit irritating.

So it seems to be a matter of contrast.

Go to the displacement of your Surface Shader and delete the entry of Layer 2.
Assign to the Colour function the Base Colours of the 100m-Group. Make testrenders while working on the Colour contrast.

I needed to change the Colour contrast of this fractal to 1.
Now change the Colour function to Layer 1. Work on its contrast settings, too.

This one got a bit tricky ... raising the contrast did not really work. This fractal needed more roughness (10) and a bit more contrast (0.75). I darkened the colour a bit, also.

Now again with the last Layer. Assign Layer 2 again to the Colour function of the surface shader.
That one is easy. Brightening the colour (0.5) and increasing the contrast (0.75) is nice.
Picture 14 has an additional displacement with a multiplyer of 0.5

Layer 1 could need some makeover (those large dark patches) but this is up to you  ;)

So this is a startup scene with one (!) Surface shader .... startup ....

to be continued ...
Title: Part 6 - Using the shader
Post by: Volker Harun on September 12, 2007, 11:05:58 am
I have changed the fractals a bit and attached the current scene file (PoV-1-2).

I rename the Surface shader to 'Rock' now.
Raising the camera and moving a bit to the left shows a nice, hazy valley.

What about some vegetation there?

Add a Surface shader and make it height restrictions to that valley. Maybe give a green colour (Picture 15).

You might want to add the 100m-shaders directly to the colour function, but no .... let us assign to the colour function a new transform shader first. Scale this transform shader to 0.1|0.1|0.1 just to have something to start with.

Now comes a part that made me call this shader once 'One for All'-Shader:
Into the Transform shader, assign the Base colours of the 100m shader, only.
Assign the transform shader to the displacement of the Green shader, too.
And now, copy that green colour to the luminance-colour of your shader.
You might want to use Layer 2 as a function for the luminosity.  ;D

Got it?

Sometimes I use a transformed version of these shaders for blending, breakup purposes.  ;)

Attached are the final image and the scene file. (640x360, 0.7, AA3 GI 1|1, 0°05'34")

Guess that it could look nicer when working on the scene only and not writing this stupid stuff, ehh? Going to rework this tomorrow.
Title: Re: PowerFractal Lessons
Post by: rcallicotte on September 12, 2007, 02:15:41 pm
Thanks Volker.  I've been following everything and am now just simply experimenting as I have in the past when you supplied understanding as well as a file. 


Title: Re: PowerFractal Lessons
Post by: ProjectX on September 12, 2007, 04:25:34 pm
this is some mighty fine surfacing help there! I've followed all but the last post so far and the results have been 5 or 6 times better than what i would normally get. It's also increased my general knowledge of the fractals in every day use ten-fold, thanks a lot!
Title: Re: PowerFractal Lessons
Post by: dhavalmistry on September 12, 2007, 10:28:28 pm
I am the biggest "Thank You Giver" on this one......

why am I giving crazy comments today??.....perhaps there was something in my chicken!!
Title: Re: PowerFractal Lessons
Post by: jo on September 13, 2007, 01:32:21 am
Quote from: dhavalmistry on September 12, 2007, 10:28:28 pm
perhaps there was something in my chicken!!

An egg?


Title: Re: PowerFractal Lessons
Post by: Volker Harun on September 13, 2007, 02:54:58 am
Dha was a mistry in the chick!  ;D ;D
Title: Advanced Powerfractals - Part 1
Post by: Volker Harun on September 13, 2007, 03:46:28 am
Okay - what have we done?

A mediocre scene with a nice shader. But most important we got some approach to the Power Fractals.

The Power of these is in my opinion that they handle two colours.

So, a new day has dawn, yesterday's work has gone. Let us start from scratch, please!?!

Starting a new scene, changing the size of the heightfield, zooming in.

What we can avoid now, is low contrast.
Go to the Base Colour shader of your new scene and change the colour settings. Colour contrast of 1 is good, High and Low Colour should be black and white.
Keep the noise and warp-settings - whoever has set those defaults, knew why.
Just the scale could be changed - to keep the noise patterns within the boundaries.

I went for ~ 2|10|0.3 (The last one just to keep the octaves low -> rendertime).
The preview looks nice, a render is too rough for my taste. I reduced the Colour Roughness to 1-2.
Adv-1.jpg shows a version with slightly changed colours.

I rename this shader Layer 0 and add a new powerfractal, named Layer 1.
Be sure to deactivate the displacement and to activate the Low colour.
The new Powerfractal covers Layer 0 completely, we are going to chang this later.
More important is to give this shader its own natural look - yesterday, we added details to one Base Fractal. Today we create 3 different Fractals that get blended.

Again high contrast settings. But more important is to change the noise. Layer 0 has Perlin for Layer 1 I go for a Mix.
Smaller scale settings - about half the size of Layer 0 are a good start. I think you get it right.

Now we want to blend Layer 1. At the bottom of the powerfractal (PF) you can add a blend-shader. Create a new PF and assign it as a blend shader. Activate the checkbox 'Blend by shader'. I called this shader 'Blend Layer 1'.

Unless you can visualize perfectly, you might want to change the colours of Layer 1 to see where it is blended or not.
I set the values of Blend Layer 1 to get an approximate 50% coverage.
But Layer 1 did not look that good anymore. Tweaking the scale a bit gave good results (Adv-2.jpg)

The third powerfractal - is it necessary? Well, we could need some very fine details.
I give you my scale settings 0.05|1.7|0.005 - you might want to zoom in to get the details.
For the Blendshader you might need to use a negative Colour offset.
Anything else, I trust you  :D ::) ;D

Finally create a new group, insert your shaders into the internal network of it and save the group as clip-file.

For those who would like to compare, I add my finished version as an attachment.

to be continued ...
Title: Advanced Powerfractals - Part 2
Post by: Volker Harun on September 13, 2007, 05:07:12 am
Let us see it in action now:

Get the TB-Terrain Clip which is provided below.
Start a new scene, load this clipand the one of the previous lesson.
Delete the both Heightfield shaders and assign the TB-Output shader to the Compute normal-Input as shown in Adv-3.png.

Move your camera up and watch the Towerbuster-Terrain being rendered in the preview.
If you do not get it, use the attached Adv-3.tgd.

We create a new standard Surface shader and attach Layer 2 of the OneForAll-Group to its colour function and use the same for -0.5 displacement.
Go for a quick render right now.

Give this layer a decent name like 'Rock 1'.
Create another standard Surface shader, call it 'Rock 2'
Give it a darker colour, but use the same Colour function. We do not need an additional displacement here. We already have it.
But the Fractal Breakup could be 1 with a Coverage below 0.5.

This layer just gave some colour variations using the same function - Adv-4.jpg shows a cropped render at higher quality (0.9; AA7; less than 7 minutes).
It seems that TG2 is calculating those fractals only once for every position. So this is a quite fast shading technique.

The last step is to add some brownish cast and rougher displacements to this surfaces.
I use a Surface shader called 'Red' with a brownish-red colour and the above Colour function.
Fractal breakup is high, Coverage low. I unchecked the 'Breakup only colour' and set to the Displacement an offset of 1.
The Fractal breakup shader is quite calm to give an overall appearance.

Attached are a cropped render (Adv-5.jpg) and the scene (Adv-5.tgd).

to be continued ...
Title: Advanced Powerfractals - Thoughts
Post by: Volker Harun on September 13, 2007, 05:23:32 am
... just a few thoughts to the end.

In my opinion, the human eye loves patterns that are fractal on the one hand, but repetitive on the other.

Using the same Colour function quite often gives images some calm balance, order. The brain gets persuaded to focus on the differences within this patterns.

I would like to invite and encourage you to upload your results to the image sharing area of this forum.
Maybe one thread where we can gather our experiences ,-)
And of course I would love it, when you use the Towerbuster Terrain ;D

Have fun and peace,
Title: Re: PowerFractal Lessons
Post by: nvseal on September 13, 2007, 03:07:18 pm
This is some top notch stuff here Volker. This needs to be stickied or added to the user made documentation section.
Title: Re: PowerFractal Lessons
Post by: normhol on September 13, 2007, 03:49:23 pm
This is great stuff, however it is advanced. I got to "mark and cut". How does one do that?[part4][attach=#]
It may be boring to you, but is illuminating to a lot of us I'm sure. It is nice of you to share your hard work.
Title: Re: PowerFractal Lessons
Post by: SeerBlue on September 13, 2007, 03:58:48 pm
thank you, Volker, I wonder how many people have a "Volker Harun" folder on there computers stocked with your files ;D
Title: Re: PowerFractal Lessons
Post by: Volker Harun on September 13, 2007, 04:07:52 pm
@SeerBlue ... in fact, I have met once one person. But there were others, too ,-)
Title: Re: PowerFractal Lessons
Post by: moodflow on September 13, 2007, 06:28:57 pm
I have a few files I got from Volker - all appended with his name.  :-)
Title: Re: PowerFractal Lessons
Post by: nvseal on September 13, 2007, 07:10:58 pm
Quote from: moodflow on September 13, 2007, 06:28:57 pm
I have a few files I got from Volker - all appended with his name.  :-)

I'll confess  :-X, me too.  ;D
Title: Re: PowerFractal Lessons
Post by: inkydigit on September 14, 2007, 07:54:13 am
I too Have a Special Volkers Stuff folder on my lil old Mac!!!....Thanks Volker... you have helped me learn aloty of stuff that I did not think I would ever get my head around/get around to!!!
Title: Re: PowerFractal Lessons
Post by: Volker Harun on September 14, 2007, 07:56:01 am
Okay, I close this thread now ... else I'll have to rename myself.