From b951521ff4872d56479966f6a3f3ce9a524f7259 Mon Sep 17 00:00:00 2001 From: ess-aar <90112787+ess-aar@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:11:10 -0500 Subject: [PATCH 1/2] Lab 6 Submission - Sakshi --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index aa0f112..a63bf1c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # lab06-debugging +## Submission +### Team +Sakshi & Megan + +[Solution Link](https://www.shadertoy.com/view/ddBGRt) + +### Bugs +1. Line 97: Syntax error vec2 (not vec) +2. Line 100: Pass in the correct UVs (uv2) +3. Line 11: Correct the aspect ratio (iResolution.x / iResolution.y) +4. Line 18: Increase the max distance for ray marching (was 64, changed to 300) +5. Line 75: Fixed ray calculation for specular reflection (input to reflect should be ray direction and not ray origin) + # 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). From bd1e421e21c95f431363ba0f96a67446209bed59 Mon Sep 17 00:00:00 2001 From: ess-aar <90112787+ess-aar@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:43:21 -0500 Subject: [PATCH 2/2] Adding some explanation --- README.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a63bf1c..2744168 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,36 @@ Sakshi & Megan [Solution Link](https://www.shadertoy.com/view/ddBGRt) ### Bugs -1. Line 97: Syntax error vec2 (not vec) -2. Line 100: Pass in the correct UVs (uv2) -3. Line 11: Correct the aspect ratio (iResolution.x / iResolution.y) -4. Line 18: Increase the max distance for ray marching (was 64, changed to 300) -5. Line 75: Fixed ray calculation for specular reflection (input to reflect should be ray direction and not ray origin) + +1. **Compile time Error** + + Line 97: Syntax error vec2 (not vec) + + Compile time error that was present from the beginning. Easy to spot, Shadertoy indicates such errors and will not run untill they are solved. + +2. **Aspect Ratio** + + Line 11: Correct the aspect ratio (iResolution.x / iResolution.y) + + The spheres were not uniform and stretched along the x direction. Since the UV calculation looked right, we looked at the ray cast code and found that the aspect ratio was being calculated incorrectly. + +3. **Incorrect Argument** + + Line 100: Pass in the correct UVs (uv2) + + The image was centered at the lower left corner, so we suspected something with the UVs was still incorrect. This one took me a while and I went back to verify the ray cast code (even pulled up Adam's raycasting slides :P). Finally Megan found out that the uvs being input to the raycast funtion were incorrect. + +4. **Raycast Distance** + + Line 18: Increase the max distance for ray marching (was 64, changed to 300) + + The edges of the ground near where they met the spheres were warped and those artifacts were similar to what we've seen in the class. + +5. **Ray Direction** + + Line 75: Fixed ray calculation for specular reflection + + The sphere reflection looked off and that made us look into the code handling reflection. I had to look up the parameters for the reflect function that made it clear that the 1st expected input parameter is ray direction and not ray origin # Setup