mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-11 16:33:01 -06:00
Merge #1846: Make Fractal Noise evolution progress linearly (@Silvertree2010)
This commit is contained in:
@@ -538,7 +538,7 @@ fn fxn_typed_noise(x: f32, y: f32, z: f32, seed: u32, nt: u32) -> f32 {
|
||||
let z0 = floor(z);
|
||||
let tx = x - x0;
|
||||
let ty = y - y0;
|
||||
let fz = fade(z - z0);
|
||||
let fz = z - z0;
|
||||
let a = fxn_slice(i32(x0), i32(y0), i32(z0), tx, ty, seed, nt);
|
||||
let b = fxn_slice(i32(x0), i32(y0), i32(z0) + 1, tx, ty, seed, nt);
|
||||
return a + (b - a) * fz;
|
||||
|
||||
@@ -561,7 +561,7 @@ fn soft_linear_noise(x: f32, y: f32, z: f32, seed: u32) -> f32 {
|
||||
let wy = bspline(y + 0.5 - y0);
|
||||
let a = soft_linear_slice(i32(x0), i32(y0), i32(z0), wx, wy, seed);
|
||||
let b = soft_linear_slice(i32(x0), i32(y0), i32(z0) + 1, wx, wy, seed);
|
||||
let n = a + (b - a) * fade(z - z0);
|
||||
let n = a + (b - a) * (z - z0);
|
||||
return 0.5 + (n - 0.5) * SOFT_LINEAR_GAIN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user