vulkan_minimal_compute icon indicating copy to clipboard operation
vulkan_minimal_compute copied to clipboard

Cosmetic issue with the mandelbrot set definition

Open exaexa opened this issue 7 years ago • 0 comments

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.

exaexa avatar Jul 27 '18 10:07 exaexa