Fluid Animation

Do you understand the idea of interpolation?

To be honest to not really. Never read up on it.

In most simplest terms it is the concept of taking 2 values and mapping them to a range, so say we have 5 and 10 and our “alpha” is at 0.5 (the domain of alpha is 0 to 1). That would mean our alpha would return 7.5. Now we can expand this to 3d by simply interpolating each position component in our vertices.

How did you get that smooth transition between dark blue and light blue? I can’t seem to get the same effect.

I basically transposed the lerp function so I could map it to the perlin density range, so if I returned a perlin density of 0.25 that’d be 1 and -0.25 would be 0. I made a module that includes what I used btw however it’s really simple you could make your own by using like mathpapa or some crap then solve for the alpha

Make your workflow easier with Math++!

What does that mean in laymens terms?

Something like this?

local Height = MathNoise + MathNoise2 + MathNoise3 + MathNoise4 + MathNoise5
local Color = math.clamp(Height, 0, 1)
Part.Color = Color3.fromRGB(0, 204 * Color, 153 * Color)

I have now implemented / tried my best to implement what you said.

Ported Water Simulation to a “ModuleScript”, and changed the name to “Fluid Animation”!

Why is there several perlin noises?

That is what creates the waves effects.