fix: remove weird gray circle around fractals

This commit is contained in:
2026-09-25 09:13:59 +02:00
parent 94f9c488bd
commit 8889a09bf8
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ fn shadow_color(normal: vec3<f32>, ci: f32) -> vec3<f32> {
color = filmic(color, 4.2); color = filmic(color, 4.2);
} else if u.shadow_palette_id == 3u { } else if u.shadow_palette_id == 3u {
// No DE darkening as in `classic_color`: in shadow/3D modes the DE // No DE darkening as in `classic_color`: in shadow/3D modes the DE
// is a height (clamped to 1000, not 1), and the lighting already // is a height (unclamped, not capped at 1), and the lighting already
// shows the relief. // shows the relief.
let t = fract(ci * u.color_scale + u.color_offset); let t = fract(ci * u.color_scale + u.color_offset);
let ambient = 0.25; let ambient = 0.25;
+6 -2
View File
@@ -502,9 +502,13 @@ fn iterate_sample(offset: vec2<f32>, px: f32) -> Sample {
// filaments stay crisp instead of aliasing into speckle. If |dzs| // filaments stay crisp instead of aliasing into speckle. If |dzs|
// overflowed (far sub-pixel from the set), de -> 0 and the boundary // overflowed (far sub-pixel from the set), de -> 0 and the boundary
// simply reads as dark, which is the correct limit. // simply reads as dark, which is the correct limit.
// Shadow/3D use DE as a height field, so it must stay unclamped: any
// cap flattens everything farther than that from the set into a
// uniform plateau (a visible circle around the set when zoomed out).
// 3D saturates heights smoothly itself (`sdf` in colorize.wgsl).
let zmag = sqrt(max(z2, 1.0)); let zmag = sqrt(max(z2, 1.0));
let dzmag = sqrt(max(dot(dzs_esc, dzs_esc), 1e-30)); let dzmag = sqrt(max(dot(dzs_esc, dzs_esc), 1e-30));
let max_de = select(1.0, 1000.0, u.shadow != 0u); let max_de = select(1.0, 1e30, u.shadow != 0u);
de = clamp(zmag * log(zmag) / dzmag, 0.0, max_de); de = clamp(zmag * log(zmag) / dzmag, 0.0, max_de);
} }
return Sample(ci, de, true); return Sample(ci, de, true);
@@ -586,7 +590,7 @@ fn fs_data(in: VsOut) -> @location(0) vec4<f32> {
// 4-neighbour's 1-spp sample differs from its own by more than this. `ci` // 4-neighbour's 1-spp sample differs from its own by more than this. `ci`
// steps are palette-phase steps of `ci * color_scale` (color_scale <= 1 in the // steps are palette-phase steps of `ci * color_scale` (color_scale <= 1 in the
// UI), so 0.02 keeps anything visibly banded; DE is compared relative to its // UI), so 0.02 keeps anything visibly banded; DE is compared relative to its
// own magnitude (it's in pixels, up to 1000 for shadow/3D height fields). // own magnitude (it's in pixels, unbounded for shadow/3D height fields).
const AA_CI_EPS: f32 = 0.02; const AA_CI_EPS: f32 = 0.02;
const AA_DE_EPS: f32 = 0.1; const AA_DE_EPS: f32 = 0.1;