-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Mandelbrot set is usually rendered with 2 set as a divergence threshold, the example shader in the repo actually uses sqrt(2) -- what comes from the vector dot-product is a squared distance. Suggest this fix to prevent naming confusion:
diff --git a/shaders/shader.comp b/shaders/shader.comp
index a03f4a0..ca26283 100644
--- a/shaders/shader.comp
+++ b/shaders/shader.comp
@@ -38,7 +38,7 @@ void main() {
for (int i = 0; i<M; i++)
{
z = vec2(z.x*z.x - z.y*z.y, 2.*z.x*z.y) + c;
- if (dot(z, z) > 2) break;
+ if (dot(z, z) > 4) break;
n++;
}
As a result, the image becomes slightly neater.
Anyway, thanks a lot for packing the compute stuff in one repo, this has saved me a day of documentation crunching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels