From f3b68803ecbcc57a93b02e2e1aa5d40eb06940ae Mon Sep 17 00:00:00 2001 From: McKenna Parker <152559424+mckennaparker@users.noreply.github.com> Date: Wed, 17 Sep 2025 11:43:01 -0400 Subject: [PATCH] Update README with submission info and bug fixes --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index fc7863a..824b666 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # lab02-debugging +# Submission +Collaborators: Didn't directly collaborate with anyone, but overheard lots of what Nico's and Lillian's thinking out loud as well as Rui's conversation with Rebecca about reflection. +Solution: https://www.shadertoy.com/view/wflBDf +Bugs: +- Line 97 where uv2 is created, the type was declared as vec but should be vec2. This was easy to find because Shadertoy was throwing a syntax error. +- Line 100 where raycast() is called should be passed the uv2 variable instead of uv because we want the range of pixel coordinates to be in [-1, 1] instead of [0, 1]. I noticed after fixing the first bug that the screen was stretched horizontally, so I figured that the bug would be somewhere in the raycast definitions of H and V. +- Line 11 where H is being updated had length being multiplied by (iResolution.x / iResolution.x) aka 1, so I changed the denominator to be iResolution.y in order to fix the stretching effect in the horizontal direction. +- Line 18 where the raymarching loop is defined, the number of iterations is too small so I increased it to 256 from 64 in order to march far enough to hit all areas of the floor as is shown in the video. The floor being warped and not expanding far enough was one of the first things that I noticed and I figured it would be in the raymarch function. +- Line 75 where dir is updated to be reflect(eye, nor) is incorrect because to get a reflection we need the direction of the camera ray (not the location of the camera) and the normal of the object so if we instead call reflect(dir, nor) to update dir we get the correct reflection. This was also an obvious issue of the program from the start, but harder to find within the functions because of how many functions and lines there are related to the material, reflection, specular reflection, etc. + # Setup Create a [Shadertoy account](https://www.shadertoy.com/). Either fork this shadertoy, or create a new shadertoy and copy the code from the [Debugging Puzzle](https://www.shadertoy.com/view/flGfRc).