fix: remove weird gray circle around fractals
This commit is contained in:
@@ -164,7 +164,7 @@ fn shadow_color(normal: vec3<f32>, ci: f32) -> vec3<f32> {
|
||||
color = filmic(color, 4.2);
|
||||
} else if u.shadow_palette_id == 3u {
|
||||
// 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.
|
||||
let t = fract(ci * u.color_scale + u.color_offset);
|
||||
let ambient = 0.25;
|
||||
|
||||
@@ -502,9 +502,13 @@ fn iterate_sample(offset: vec2<f32>, px: f32) -> Sample {
|
||||
// filaments stay crisp instead of aliasing into speckle. If |dzs|
|
||||
// overflowed (far sub-pixel from the set), de -> 0 and the boundary
|
||||
// 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 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);
|
||||
}
|
||||
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`
|
||||
// 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
|
||||
// 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_DE_EPS: f32 = 0.1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user