Rescale noise...?

Started by dandelO, April 17, 2011, 07:31:01 PM

Previous topic - Next topic

dandelO

A while back when I was messing around with something I accidentally made a setup that ranged a noise from a start scale to an end scale with a smooth transition in growth. I didn't bother saving anything because it wasn't what I was after at the time and I thought, "Ach, I'll remember how I did this next time I need it..."
I can't. :(

So, the thing is this. I had a Voronoi which started at a default scale of 1m at the origin and grew outwards to a scale of 100m(say) over a smooth gradient.

For the eyes of me, I can't remember how I done it. The closest I can get to what I'm talking about is something like this;

[attachimg=#]

[attachimg=#]

Using a modulo scalar is subdividing the cells themselves but not the scale of the actual noise, the Arctan2 scalar is creating the gradient. I'm not sure if I used either of these nodes before when I had it working! ::)

The network I vaguely remember having was a bit different than the simple one here that shows the above noise, I know I had a couple/few more function nodes but I am at a complete loss as to what they were, or where they were.
______________________________

This pic' is just a screen capture of a default Veronoi noise with an inaccurate pinch filter on it that crudely shows the effect I mean, if I'm not being clear above...

[attachimg=#]

Cheers, if anyone can help. :)

dandelO

You can see a little better with a Perlin noise and modulo scalar where I am stuck.

[attachimg=#]

It's only subdividing the pattern as it appears according to the gradient, like it's just a distribution shader, not actually altering the scale of the pattern itself.

You might guess that this is part of the 'other idea' I mentioned in the waves thread I posted a few days ago. I figure, if I can make it work correctly again, I can use it to modulate the scale of a sin function according to the distance of the gradient, i.e. near waves would be tighter and at the starting scale, whilst the further into the distance, the wider and calmer the wave would become, towards the end scale...

Am I talking crap? Maybe confused that I had it working before and it isn't actually possible? I'm 99% sure I did.
It's usually that 1% that bites my arse, though! :D

Hetzen

With your waves Martin, you can use a bias scaler to get a pinch on a range, then use the modulo to subdivide that by a fraction of 1. Then use that to drive your sin function.

I'll have a think about your scaling on noise and post back later.

rcallicotte

I don't remember.  Did you post anything here on the forums?  Maybe we could do some UberSearches to help find more information.
So this is Disney World.  Can we live here?

Tangled-Universe

I think I remember that thread....It was about different sizes of fake stones and I think you showed a function which did what you're describing now...
Let's search for it...

Tangled-Universe


Themodman101

I'm just curious what kind of use you would have for this? what exactly could be done with this? I'm really not a math person so maybe thats why.

Its really cool though, so dont get me wrong.

dandelO

Cheers, folks. Appreciate the help. :)

Hetzen, great! I look forward to your experiments.
While you're here(completely different subject)... On at least two occasions that I've posted animations here we got onto the subject of the key-frame interpolation easing in and out and you tried to help me with a nod towards the 'get frame number' node, which I think you said should feed a simple constant scalar that would then drive the camera without any easing. I've tried repeatedly to make this work but never to any use. Can you shine any light on your method?

Calico/Martin, I never posted the thing I was talking about above anywhere, don't think I even spoke about it at the time. I was playing with functions trying to make a spiral noise to use as a cloud shader for some whirlwind tests, I gave up on function nodes and just used a spinning simple shape shader and cut into that shape with shaders to make a cloud mask(I posted a thread called '30f whirly' around about that time).

I remember not having much success creating a scaled spiral noise but I did come across the radial method I described above. Brilliant! I thought I'd easily remember what I did and didn't even bother to save it, let alone post it here. Sh*t! :D

I'll have a trawl through these threads, Martin, cheers...

dandelO

Quote from: Themodman101 on April 18, 2011, 11:50:09 AM
I'm just curious what kind of use you would have for this? what exactly could be done with this? I'm really not a math person so maybe thats why.

Its really cool though, so dont get me wrong.

I'm no maths guy either, Themodman, which is why I ask the question now. I'm sure some of these guys are robots in here! ;)

The reason I'm trying to scale a noise over a range is to use as a basis for a wave function to use on a water object.
The scale of small breaker waves on the shore would increase over the gradient making the next wave behind it wider, the following one wider still, etc. I'd make a gradient that fitted the scene. The appropriate amount of displacement would be added to each increasing wave to make the nearer ones rougher and the further ones smoother(but that's the easy part).

I'm just using a Perlin noise and an Arctan2 gradient here to show what I mean, I haven't put it into a scene yet, still on the shader-preview windows stage, as you can see from the screenshots above.

Cheers! :)

dandelO

Good post from Matt from one of the threads Martin linked. ^^

Quote
Quote from: Matt on January 29, 2008, 11:04:21 AM
The noise scales itself by multiplying the position input by the inverse (reciprocal) of the scale. When the position input has a large value (i.e. it is far from 0,0,0), small changes to the scale have large absolute changes to the position because it is a multiplication effect. Therefore whatever function you use has more effect on the noise shape at larger distances from the origin, regardless of what function you use.

It is possible to cancel out this effect by dividing part of your function by the distance from the origin, but you need to make sure that there is also a constant component to your scale function which you don't apply the divide to. Difficult to explain without providing an example... but hopefully you can see what I mean.

Matt


I'm not worried about the continuous distortion away from the origin, this would be easily masked to a localized area for what I plan anyway.

Cheers to Mogn(the robot version of Goms, I believe) for the info on the scale-by-altitude thread, too. I'll probably not get back here until tomorrow as I'm busy tonight so, thanks everyone in the meantime. :)

Dune

I think you are following the wrong approach with the simple shapes, unless you can bend them alongside the coastline (try the warper with the terrain as input for the redirect). The get altitude, then sinus, then subtract from terrain works better IMHO. Only if you just need a straight beach, it would probably work.

dandelO

Cheers, man. I'm not using simple shape shaders any more, it's all changed.
I'm using a sin scalar now to make the waves. The scaling of this sin function from point A to point B is what I want to fix here.
Say I have my waves running left to right along the X axis, I want to then be able to 'grow' their scale along the Z axis, according to a gradient.

Hetzen

#12
The attached TGC will shift the noise left.

To change the direction the noise travels, enter a positive or negative value in the constant vectot 'Direction'. ie -1,0,0 will move the noise right. 0,-1,0 will move it up. 0,-1,-1 up and forwards.

The way this works....

Get Frame returns a single number (scaler), and we can multiply the effect the Get frame has with another scaler. So entering 10 in the speed multiplier will mean what ever the Get frame is, our out come will be 10 times that. So rather than move 1m per frame, we are now moving 10m per frame.

When you multiply a Scaler (in this case 10 on frame 1) with a Vector, the single number of a constant tries to multiply x,y,z of an input vector by that amount. So at frame 1, 10 will be multiplied by our 'Direction' vector in x,y,z (-1,0,0), which gives a return of (-10,0,0).

Get position returns a vector value for x,y,z. So when we add the vector worked out above, we get (x-10,y,z) on frame 1. On frame 2 the answer will be (x-20,y,z). And so on.

When you plug that into a perlin function, it will offset what ever point the get position is looking at at render time, by -10m in x, in effect shifting the perlin pattern left.

Why is this usefull?

Well, because 1/ there are no keyframes to worry about, just direction and speed. 2/ TG automatically adds an ease out and in on each key frame, which is no good if we want to animate something that has a constant speed, like clouds, water, etc.



As for your scaling noise from a central point, not found anything yet.

Hetzen

Quote from: dandelO on April 18, 2011, 01:36:51 PM
Cheers, man. I'm not using simple shape shaders any more, it's all changed.
I'm using a sin scalar now to make the waves. The scaling of this sin function from point A to point B is what I want to fix here.
Say I have my waves running left to right along the X axis, I want to then be able to 'grow' their scale along the Z axis, according to a gradient.

I've gone a long way into doing what you're describing here Martin. You're on the right tracks. But this is just the easy bit. Wait until you get into backwards moving white horses. Lol.

mogn

Something like this:

Using a constant for scale input to the noise.
Modify the vector (limit to a range).
Abs(vector) for 4-fold symmetry.