Planetside Software Forums

General => Terragen Discussion => Topic started by: epsilon on January 19, 2014, 02:26:00 PM

Title: power fractal "lead-in scale" question (again)
Post by: epsilon on January 19, 2014, 02:26:00 PM
Hi all,

after having read the wiki/documentation pages and many forum contributions on this topic I'm afraid I still do not quite understand the meaning of "lead-in scale" vs. "feature scale".
I understand the concept at a "high level" as in  "lead-in-scale=mountain-range vs. feature-scale=individual mountain".

But I'd rather prefer a more mathematical description.

I understand that we have

n_feat = log2(feature_scale/smallest_scale) octaves for our "mountain-feature".

And that there are 'somhow' an additional

n_lead = log2(lead_in_scale/feature_scale) octaves of variations "larger than the mountains". 

But how are those lead_in octaves different from the regular feature octaves (why not just using a total of n_feat+n_lead regular octaves ?)

I presume that the "power fractal" is some kind of "multi fractal" where one fractal function's output is used to drive certain attributes of another fractal function.
So is it correct that the lead-in-scale corresponds to the scale of the first ('driver') fractal whereas the feature-scale corresponds to the octaves of the second ('main') fractal ?

Thanks a lot for any explanations/information

  eps.
Title: Re: power fractal "lead-in scale" question (again)
Post by: epsilon on January 27, 2014, 07:27:30 PM
Not a a single reply to the original post ?
Maybe the question was not phrased understandably enough ? (English is not my first language)
Title: Re: power fractal "lead-in scale" question (again)
Post by: TheBadger on January 27, 2014, 10:11:08 PM
Hi,

Im sure the OP just got overlooked. It happens from time to time.
You probably just posted when people were focusing on other questions, and you got bumped down. Also your question will appeal to fewer people do to its nature. Explaining things mathematically is not everyones strong suit.

In the meantime you might want to PM a user you think can help. user "mogn" comes to mind.

Title: Re: power fractal "lead-in scale" question (again)
Post by: Matt on January 28, 2014, 06:04:00 AM
Hi eps,

The lead-in octaves have the same amplitude as the feature scale octave. While the "roughness" parameter controls the damping of octaves below the feature scale all the way down to the smallest scale, it does not affect the octaves above the feature scale.

[attach=1]

Lead-in octaves affect smaller octaves in the multifractal, but they do this in the same way as any 'normal' octave would. Due to the way the basic amplitudes are calculated, though, having lead-in octaves gives the multifractal a chance to produce some amplitude variation at higher scales before calculating the feature scale.

Matt
Title: Re: power fractal "lead-in scale" question (again)
Post by: Matt on January 28, 2014, 06:14:23 AM
BTW, the scale ratio between octaves (known as 'lacunarity') in the Power Fractal is 1.92, so to calculate the number of octaves I use log to the base 1.92, so it would be something like:

log( leadinScale / smallestScale ) / log(1.92)

Matt
Title: Re: power fractal "lead-in scale" question (again)
Post by: russe166 on January 28, 2014, 06:26:56 AM
Thanks for the explanation, Matt.

Especially the text in the attached document that explains the graph is really helpful.
Do more of these documents exist?
Is a kind of handbook in preparation?

Michael
Title: Re: power fractal "lead-in scale" question (again)
Post by: Matt on January 28, 2014, 06:41:32 AM
I prepared this one just now. Most of the documentation we have is in the Wiki: http://planetside.co.uk/wiki/index.php?title=Main_Page

I'll transfer this information over to the Wiki.

Matt
Title: Re: power fractal "lead-in scale" question (again)
Post by: russe166 on January 28, 2014, 06:55:04 AM
Thanks for the quick answer. I will take a look in the Wiki.

Michael
Title: Re: power fractal "lead-in scale" question (again)
Post by: bobbystahr on January 28, 2014, 11:14:15 AM
Quote from: Matt on January 28, 2014, 06:41:32 AM
I prepared this one just now. Most of the documentation we have is in the Wiki: http://planetside.co.uk/wiki/index.php?title=Main_Page

I'll transfer this information over to the Wiki.

Matt

Brilliant...I think I finally get it...thanks Matt...

Title: Re: power fractal "lead-in scale" question (again)
Post by: Tangled-Universe on January 28, 2014, 11:20:59 AM
Quote from: Matt on January 28, 2014, 06:14:23 AM
BTW, the scale ratio between octaves (known as 'lacunarity') in the Power Fractal is 1.92, so to calculate the number of octaves I use log to the base 1.92, so it would be something like:

log( leadinScale / smallestScale ) / log(1.92)

Matt


Thanks for sharing this nice picture Matt, I immediately have some ideas and perhaps possible improvements or even solutions for cloud things I'm working on for many years.

Curious, if I calculate it manually I always end up with 1 octave less. How come, where's the extra octave coming from?

Lacunarity is perhaps interesting to manipulate, are you considering unlocking it in the interface? Will the shader/code allow for it anyway?
Title: Re: power fractal "lead-in scale" question (again)
Post by: epsilon on January 28, 2014, 01:05:07 PM
Quote from: Matt on January 28, 2014, 06:04:00 AM
Hi eps,

The lead-in octaves have the same amplitude as the feature scale octave. While the "roughness" parameter controls the damping of octaves below the feature scale all the way down to the smallest scale, it does not affect the octaves above the feature scale.
Matt

Thank you very much for this helpful information !
With that explanation and especially the attached picture the 'lead-in-octaves' vs. 'normal octaves'  now makes perfectly sense  :)
Title: Re: power fractal "lead-in scale" question (again)
Post by: Matt on January 28, 2014, 09:13:47 PM
Quote from: Tangled-Universe on January 28, 2014, 11:20:59 AM
Thanks for sharing this nice picture Matt, I immediately have some ideas and perhaps possible improvements or even solutions for cloud things I'm working on for many years.

Be sure to try out the "Show HUD in Preview" option in the alpha build, to give you a live feedback as you change the fractal parameters. The HUD only works for displacement, not colour.

Quote
Curious, if I calculate it manually I always end up with 1 octave less. How come, where's the extra octave coming from?

I should have added one to that formula. That's because if you have a lead-in scale of 2 and a smallest scale of 1, you want to represent that with 2 octaves, not 1. But the code does other things, for example, it enforces the lead-in scale to be at least twice the feature scale regardless of what lead-in parameter you enter.

Quote
Lacunarity is perhaps interesting to manipulate, are you considering unlocking it in the interface? Will the shader/code allow for it anyway?

It's currently hardcoded, but it might be possible to make it dynamic in future. I'm not sure I will, though, because it will further complicate some other aspects of the fractal if I can't make assumptions about what the lacunarity will be.

Matt
Title: Re: power fractal "lead-in scale" question (again)
Post by: Tangled-Universe on January 29, 2014, 06:07:20 AM
Thanks Matt, I understand what you mean about the lacunarity.
I kind of suspected it wouldn't be so straight forward to expose the setting.

In music the lacunarity of noise (or musical notes I should say) is 2, but in CG the lacunarity is usually at 1.92, like TG does as well, or anything but 2.
Why is this? Is a lacunarity of 2 generating too repetitive patterns?
Something I was just wondering and perhaps you may know the answer to it, Matt?

The HUD is indeed working fine for this purpose :)
A cloud fractal seems to work as well if you use high values for noise variation? Curious.