From 8b454fbe9335a7011e947093230b07a74ba9c653 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 18 Oct 2021 07:12:05 -0700 Subject: [PATCH] Slight tweaks to how saturation_factor works on newton-fractal --- manimlib/shaders/newton_fractal/frag.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manimlib/shaders/newton_fractal/frag.glsl b/manimlib/shaders/newton_fractal/frag.glsl index 8315f9ec..223f8556 100644 --- a/manimlib/shaders/newton_fractal/frag.glsl +++ b/manimlib/shaders/newton_fractal/frag.glsl @@ -75,7 +75,7 @@ vec2 seek_root(vec2 z, vec2[MAX_DEGREE + 1] coefs, int max_steps, out float n_it } z = z - step; } - n_iters -= clamp((threshold - curr_len) / (last_len - curr_len), 0.0, 1.0); + n_iters -= log(curr_len) / log(threshold); return z; } @@ -118,7 +118,7 @@ void main() { color = colors[i]; } } - color *= 1.0 + (0.01 * saturation_factor) * (n_iters - 5 * saturation_factor); + color *= 1.0 + (0.01 * saturation_factor) * (n_iters - 2 * saturation_factor); if(black_for_cycles > 0 && min_dist > CLOSE_ENOUGH){ color = vec4(0.0, 0.0, 0.0, 1.0);