From 6b69bb7b6b1a31b368a5f6998dca111bef7c62ac Mon Sep 17 00:00:00 2001 From: yonatan Date: Sat, 27 Feb 2021 19:27:31 +0200 Subject: [PATCH] Add parentheses around #defined expression --- content/logspherical.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/logspherical.md b/content/logspherical.md index 80c4b21..bc19de1 100644 --- a/content/logspherical.md +++ b/content/logspherical.md @@ -74,7 +74,7 @@ code: distortion_polka.glsl The above 2D map can be simply applied in 3D space by picking two dimensions to transform. However, this means the geometry will get scaled in those two dimensions but not in the remaining dimension (in fact, geometry will be infinitely slim at the origin, and infinitely fat at the horizon). This is a problem because SDF scaling must be uniform, but we can easily correct this by scaling the remaining dimension proportionally to the others, using the same $r$ factor as before. If we're tiling spheres, this would give us the following distance function: ```glsl -#define SCALE 6.0/PI +#define SCALE (6.0/PI) float sdf(in vec3 pos3d) {