Page MenuHome

Shading: Noise and Wave nodes. Add Roughness input.
Needs ReviewPublic

Authored by Bartosz Moniewski (monio) on Sun, Mar 8, 11:49 PM.
Tags
Tokens
"Love" token, awarded by Beckersc."Love" token, awarded by symstract."Love" token, awarded by Rongix."Love" token, awarded by RodDavis."Love" token, awarded by LucaRood."Love" token, awarded by mistajuliax."Baby Tequila" token, awarded by charlie."Like" token, awarded by Floatharr."Love" token, awarded by mfink."Like" token, awarded by MetinSeven."Love" token, awarded by ChrisGraz."Love" token, awarded by B_Engstler."Orange Medal" token, awarded by MasterNurmi."Yellow Medal" token, awarded by LapisSea."Love" token, awarded by higgsas."Love" token, awarded by duarteframos."Love" token, awarded by astrand130."Like" token, awarded by ace_dragon."Like" token, awarded by filibis."Like" token, awarded by belich.

Details

Summary

Currently in fractal_noise functions, each subsequent octave doubles the frequency and reduces the amplitude by half.
This patch introduces Roughness input to Noise and Wave nodes. This multiplier determines how quickly the amplitudes of the subsequent octaves decrease.

  • Value of 0.5 will be the default, generating identical noise we had before.
  • Values above 0.5 will increase influence of each octave resulting in more "rough" noise, most interesting pattern changes happen there.
  • Values below 0.5 will result in more "smooth" noise.

Changes in code are simple but feature itself is quite significant, it will allow creating vastly different looking noises very easily.
This property is sometimes called "Persistence" but most CG software name it "Roughness". I leave naming decision to reviewers.

Diff Detail

Event Timeline

This is super useful!

And about the naming, isn't this conceptually identical to "Lacunarity" in the Musgrave node?
I think it would be good if the naming and behaviour would be consistent between these nodes.

Lacunarity in fractal noises modifies frequency/scale of octaves, not amplitudes.
Roughness/Persistence works a bit similar to Dimension in Musgrave but input behavior and results are rather different.

Oh, I misunderstood... For some reason I read it as if the scale of the noises was being affected, instead of the amplitude.
But in any case, wouldn't it be good to match it with the Musgrave Dimension then?

I'd suggest either changing this patch to match the Musgrave, or changing the Musgrave to match this. Having a consistent behaviour would make a lot of sense, considering they both use the same concept of stacking noises.
I'd say they could even just be one node, and have exactly the same controls (thus adding the lacunarity as well), and a "noise type" selector, just like the current Musgrave already has.

Sorry, apparently I forgot how Musgrave textures work. Lacunarity in basic Fractal Perlin Noise (our Noise node) affects only frequencies. However in Musgrave textures it affects frequencies and amplitudes. It's calculated this way:

Roughness = pow(Lacunarity, -Dimension);

I'd suggest either changing this patch to match the Musgrave, or changing the Musgrave to match this. Having a consistent behaviour would make a lot of sense, considering they both use the same concept of stacking noises.

Those parameters should work differently by design.
You see, there are an infinite number of ways to combine noise primitives. Certain method of combining is what makes a texture. Kenton Musgrave designed his functions specifically for terrain generation and these inputs are intended to work exactly as they do. There is mind-bending amount of math research behind his simple algorithms. If we change how amplitudes are calculated these will no longer be Musgrave textures.
Changing my patch to mimic Dimension input isn't good idea either. Noise node is meant for more general application so direct control over Roughness will work better here.
I believe we should rely on existing conventions and proven implementations. Roughness/Persistence is a standard for basic Fractal Perlin Noise. Question is which standardier name we choose. ;)