Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetic issue with the mandelbrot set definition #3

Open
exaexa opened this issue Jul 27, 2018 · 0 comments
Open

Cosmetic issue with the mandelbrot set definition #3

exaexa opened this issue Jul 27, 2018 · 0 comments

Comments

@exaexa
Copy link

exaexa commented Jul 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant