fix(fractal): keep non-escaping points black
Points that never escape kept the last loop index as iter, so they never reached the black color. Start iter at maxIterations and set it only when a point escapes. Update the ITEM_4 text (en, de) to match.
This commit is contained in:
1 parent
833e1ec8dc
commit
07e0fc1192
3 files changed
+3
-3
No files matched your search
@@ -124,6 +124,7 @@ export const FRACTAL2D_FRAGMENT = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Mandelbrot (0), Julia (1), Burning Ship (2)
|
else { // Mandelbrot (0), Julia (1), Burning Ship (2)
|
||||||
|
iter = maxIterations; // stays at max for points that never escape (black interior)
|
||||||
for(int i=0; i<2000; i++) {
|
for(int i=0; i<2000; i++) {
|
||||||
if (i >= maxIterations) break;
|
if (i >= maxIterations) break;
|
||||||
|
|
||||||
@@ -134,7 +135,6 @@ export const FRACTAL2D_FRAGMENT = `
|
|||||||
iter = i;
|
iter = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iter = i;
|
|
||||||
|
|
||||||
if (algorithm == 2) { // Burning Ship
|
if (algorithm == 2) { // Burning Ship
|
||||||
z.y = abs(z.y);
|
z.y = abs(z.y);
|
||||||
|
|||||||
@@ -616,7 +616,7 @@
|
|||||||
"ITEM_1": "Die CPU schickt pro Frame nur Uniforms: Mittelpunkt, Zoom, maximale Iterationen, Algorithmus, Farbschema und die Julia-Konstante. Die GPU rechnet alle Pixel parallel; Aufwand O(Pixel · Iterationen).",
|
"ITEM_1": "Die CPU schickt pro Frame nur Uniforms: Mittelpunkt, Zoom, maximale Iterationen, Algorithmus, Farbschema und die Julia-Konstante. Die GPU rechnet alle Pixel parallel; Aufwand O(Pixel · Iterationen).",
|
||||||
"ITEM_2": "Die maximale Iterationszahl wächst mit dem Zoom: 100 + 200 · log10(Zoom), also bis etwa 1.060 beim maximalen Zoom 64.000.",
|
"ITEM_2": "Die maximale Iterationszahl wächst mit dem Zoom: 100 + 200 · log10(Zoom), also bis etwa 1.060 beim maximalen Zoom 64.000.",
|
||||||
"ITEM_3": "Zoom per Mausrad hält den Punkt unter dem Cursor fest: sein Weltpunkt wird vor und nach dem Zoom gleich gesetzt und der Mittelpunkt entsprechend verschoben.",
|
"ITEM_3": "Zoom per Mausrad hält den Punkt unter dem Cursor fest: sein Weltpunkt wird vor und nach dem Zoom gleich gesetzt und der Mittelpunkt entsprechend verschoben.",
|
||||||
"ITEM_4": "Die Farbe kommt aus dem Verhältnis Iterationen / Maximum; Punkte, die nie entkommen, bekommen die Farbe für t ≈ 1 (im Schema Blue-Gold dunkelrot).",
|
"ITEM_4": "Die Farbe kommt aus dem Verhältnis Iterationen / Maximum; Punkte, die nie entkommen, bleiben schwarz.",
|
||||||
"ITEM_5": "Unter WebGPU übersetzt Babylon.js denselben GLSL-Shader nach WGSL; es gibt keinen eigenen Compute-Pfad."
|
"ITEM_5": "Unter WebGPU übersetzt Babylon.js denselben GLSL-Shader nach WGSL; es gibt keinen eigenen Compute-Pfad."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -616,7 +616,7 @@
|
|||||||
"ITEM_1": "The CPU sends only uniforms per frame: center, zoom, maximum iterations, algorithm, color scheme and the Julia constant. The GPU computes all pixels in parallel; cost O(pixels · iterations).",
|
"ITEM_1": "The CPU sends only uniforms per frame: center, zoom, maximum iterations, algorithm, color scheme and the Julia constant. The GPU computes all pixels in parallel; cost O(pixels · iterations).",
|
||||||
"ITEM_2": "The maximum iteration count grows with the zoom: 100 + 200 · log10(zoom), so up to about 1,060 at the maximum zoom of 64,000.",
|
"ITEM_2": "The maximum iteration count grows with the zoom: 100 + 200 · log10(zoom), so up to about 1,060 at the maximum zoom of 64,000.",
|
||||||
"ITEM_3": "Zooming with the mouse wheel keeps the point under the cursor fixed: its world point is set equal before and after the zoom and the center is moved accordingly.",
|
"ITEM_3": "Zooming with the mouse wheel keeps the point under the cursor fixed: its world point is set equal before and after the zoom and the center is moved accordingly.",
|
||||||
"ITEM_4": "The color comes from the ratio iterations / maximum; points that never escape get the color for t ≈ 1 (dark red in the Blue-Gold scheme).",
|
"ITEM_4": "The color comes from the ratio iterations / maximum; points that never escape stay black.",
|
||||||
"ITEM_5": "Under WebGPU Babylon.js translates the same GLSL shader to WGSL; there is no separate compute path."
|
"ITEM_5": "Under WebGPU Babylon.js translates the same GLSL shader to WGSL; there is no separate compute path."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user