diff --git a/README.md b/README.md index aa0f112..9b73d67 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ +# shadertoy link +https://www.shadertoy.com/view/msS3zt + +# bugs +- bug 1: compile error. uv2 was type vec and not vec2 +- bug 2: incorrect inputs to raycast() in mainImage(). uv was inputted and not uv2. +- bug 3: improper resolution. the spheres were smooshed. after creating uv2 (mapping from [0,1] to [-1,-1]), + we need to multiply uv2.x by iresX/iresY. this is because when we start with the uv (uv = fragCordXY/resXY), we could have any mix of x and y lengths. if x >> y then the y domain will look very smooshed, and so on. so we need to preserve the aspect ratio. in total we have + + * fragCoord : [[0, resX], [0, resY]] + * * uv = fragCordXY/resXY + * uv: [[0:1], [0:1]] + * * uv2 = 2. * uv - vec2(1.) + * * uv2 = 2. * ((fcX/resX), (fcY/resY)) - (1., 1.) + * * *(this was what we added to fix the bug!)* --> uv2.x *= resX/resY + * * uv2 = 2. * ((fcX/resY), (fcY/resY)) - (1., 1.) + + ^ now that both components of uv2 have the same denominator, the aspect ratio is preserved + + +- bug 4: the reflections were off. +
+
**before**
+**after**
+ + +
+
+
+