Welcome to the forums

Quote from: keyframe on January 18, 2011, 03:41:01 PM
I've scoured the forums for clues - and the answer I most typically find is "What are you trying to achieve specifically" (people in this community seem very generous with their time and knowledge - this is fantastic to see). In my case, i'm not really attempting to achieve anything (yet?!), I just want to understand the inner working of this system.
I understand your frustrations and feelings of "where the hell do I start". We all had to go through this, but admittedly, it shouldn't be so hard as it often is for many.
However, I think it is really the wrong way around to first want to understand the inner workings of TG2 and then start working from there.
In my opinion you can already learn a lot by playing around and especially doing a lot of mini-projects, which basically means trying to achieve one specific effect (cumulus cloud, detailed fake stone etc. etc.). This way you learn the workflow and the functions in small chewable steps.
At some point it is important to understand what kind of data each input accepts/requires exactly, but I think (almost want to assure you) that's the least of concern for someone starting TG2.
Anyway, I'll try to answer some of your questions. I always try to explain by examples so that you can reproduce the idea and understand it better. Also, it shows that through experimentation you certainly can deduce much of TG2's inner working as there's luckily enough logic in the system

It's clarity on things which lacks, so let's try to work on that from here:
Quote
What data type is returned by the displacement functions? (Alpine Fractal, for example)
First question, first exceptions in the answer already

The alpine fractal is an advanced fractal function like the powerfractal v3 shader and only generates displacement (vectors). However, the powerfractal v3 shader can also generate colour, hence the colour tab inside.
This way you can have colour (shading) match your displacements, for example.
The alpine fractal can not. The alpine fractal only outputs displacement.
The colour tab in the powerfractal v3 shader does NOT affect the displacement.
Open a new default project and generate a terrain from a powerfractal and enable high and low colour in the powerfractal.
Play with colour, contrast, offset etc. No effect.
So I discussed briefly an Alpine shader and powerfractal v3 shader, but there's also a displacement shader.
Here things change a bit.
The left input of the shader accepts displacement and colour and is meant to link the displacement shader in the network.
The right input (named "function") requires colour/scalar input from which it calculates displacement.
However, it does NOT accept displacement. So when you connect a powerfractal with colours unchecked, the displacement shader does nothing.
The strength of the displacement is determined by the displacement factor inside the displacement shader.
So, as it requires colour/scalar you can use a powerfractal with its colours enabled as (right!) input of the displacement shader.
Now the colour tweaks DO have effect. Change contrast, offset etc. and the displacement will look different.
That is because you tweak the colour function and thus tweak the displacement function consequently.
Quote
What data type is expected as input to the displacement functions (They seem to be able to operate both with, and without input -- does having an input imply Base_fractal+New_fractal?)
Generally the red nodes in TG2 have a main input to the right which always accepts displacement and colour. You need this in order to pass data through to the next node.
Most nodes perform an operation by default and thus affect outcome when they are connected in your network.
The displacement shader, for instance, does nothing if you don't have a function connected to its right "function" input.
Data just passes through the node, unaffected, then.
I'm not really sure to what you are referring to when you say "displacement functions". For instance, the surface layer also has a displacement function input port.
For the record, this input works similar to the displacement shader.
Quote
Can that data type (Displacement? Vector? Scalar? foo?) be manipulated by using the 'Functions' (for instance, can I multiply the result of Alpine Fractal, by 2), and still have it be a 'valid displacement'? (my tests seem to indicate that it cannot - the minute that I append any multiply node after Alpine Fractal, my terrain disappears).
Certainly.
You would require to use a merge shader and conect that after your Alpine fractal. Inside the merge shader go to the "merge mode" tab and choose "multiply (Input * A's diffuse colour) as merge mode for displacement. As that is what you would like to affect.
Hey, wait a minute, "A's diffuse colour". It seems we need a constant colour value to multiply with. Create and connect a "constant colour" function to the "Shader A" input of the merge shader.
Give the constant colour any value you would like the fractal to be multiplied with.
Logically, you're now manipulating the displacement multiplier/amplitude.
The easiest way, without having to use any extra node, is to simply increase the "displacement amplitude" setting in the Alpine/Power fractal.
So, if you wanted to multiply with 1.5 then enter a 1.5x greater value as displacement amplitude.
You'll see that the result is exactly the same as using a merge shader in multiply mode with a constant colour.
You can create function networks which create displacement. It's pretty much to explain, but there's a nice tutorial about that here:
http://forums.planetside.co.uk/index.php?topic=1166.0Quote
What data type is returned by the 'color functions' (Power Fractal for instance)?
This should be a bit more clear by now. The answer isn't very surprising, a colour function outputs colour.
You should keep in mind that you disable displacement and enable colour in a powerfractal when you explicitly only want to use its colour output.
I guess that would make sense.
Quote
What is the relationship between the 'combo nodes' color and displacement parameters? (PF, for instance, has both color AND displacement controls -- which suggests to me that they are handled separately -- gut instinct: displacement scalar, color vector)
I also discussed that already a bit. May of your questions are inter-related. Yes, they are separate and do not affect each other.
As I mentioned it could be useful to have colours generated along with displacement, to get a match or other interesting effects.
Quote
Where are the frequency controls? (I've noticed that some functions have a 'Tweak noise' parameter (PF), and some do not (AF))
The frequency controls are in the "scale" tab and "tweak noise" tab. Both tabs control the noise-function generated by the fractal.
The scales are determined by a "feature scale", "lead-in scale" and "smallest scale".
These 3 values determine how many octaves of noise will be generated. Octaves mean how many iterations, thus the amount of detail.
Low octaves is less detail, many octaves is much detail.
The lowest limit of detail is determined by the smallest scale. The most dominant scale of shapes is determined by "feature scale" and the "lead-in scale" defines the total range of scales being used.
In the tweak tab you can choose which noise-flavour you would like to use, but also there are controls to modulate the frequencies/scales.
The precise workings of these functions have never been documented or explained by the staff.
With the noise variation you can kind of localize the noise to patches (by increasing the value quite a lot, say >5-10)
Or make it very evenly distributed in regard to scales, by making it <0-1.
The variation methods are a bit unclear, still.
Multi-scale modulator probably mixes an extra iteration of the same multifractal in some way, which you can control with the noise variation setting.
The other two, (un)clamped multi-fractal basically mean that you don't want to use the multi-scale modulator and either want to use the multi-fractal itself, being it clamped or unclamped.
The Alpine Fractal does not have these tweak parameters as you can consider the Alpine Fractal as an advanced powerfractal, probably a fancy combination of powerfractal noise with other clever elements. The UI for this shader is probably simplified to make it useable and probably also to avoid that the user will render TG2 useless as the shader already is very "heavy" without all of these (extra) fancy controls (with which you're likely to make it even worse if you don't know what you're doing).
Clamped means that the colour output is restricted to range from 0 to 1.
Unclamped means that it can go beyond these values, without limits. (probably there are, but not that I know).
Ok, this took a bit more than a few minutes, but hopefully things are a bit more clear now.
Time for a drink, might change little things later, but this is primarily how I think when using TG2.
Cheers,
Martin