Slight tweaks to how saturation_factor works on newton-fractal

This commit is contained in:
Grant Sanderson 2021-10-18 07:12:05 -07:00
parent ed3d44120c
commit 8b454fbe93

View file

@ -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);