From 15c61834af5d5457b35c891786a9114eedac3134 Mon Sep 17 00:00:00 2001 From: pojojojo21 <65415823+pojojojo21@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:53:43 -0500 Subject: [PATCH 1/3] Lab submission --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index aa0f112..e55a68b 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,24 @@ Extra credit if you can find all FIVE bugs. - In the README, create a link to your shader toy solution with the bugs corrected - In the README, describe each bug you found and include a sentence about HOW you found it. - Make sure all three of your shadertoys are set to UNLISTED or PUBLIC (so we can see them!) + +Partner: Rhuta Joshi +Shader toy link: https://www.shadertoy.com/view/dsBGRd + +We methodiccally followed the flow of the code. We started with the mainImage function and looked at the inputs calculated. +Looking at the mainImage function we could clearly see the compiler error cause by uv2 not being initialized as a vec2 but just vec instead. +ERROR1: uv2 -> vec instead of vec2 + +Then we looked at where this was passed into the function raycast and noticed that uv2 was never used instead uv was passed in instead. +ERROR2: uv is used instead of uv2 in raycast function inputs + +We then followed raycast to it's definition where looked at what was being done in the function. We knew something was wrong because the screen was being stretched so that the spheres were not sphereical. There we noticed that iResolution.y is never used just iResolution.x which would distort the screen. +ERROR3: used iResolution.x/iResolution.x instead of iResolution.x/iResolution.y + +From there we figured that our screen size looked good and everything was proportionally correct. Now we needed to solved why all our objects were not reflecting the other objects but just their own color. So we went to look at where specular reflection is applied to all surfaces. Now we noticed that to get the correct relection direction so that we can find the other object that should be reflected in the one we are looking at we need to reflect the direction vector aboutt the normal but instead we are reflecting the eye about the normal. +ERROR4: was reflecting eye about nor to calculate the new direction instead of direction about normal. + +Finally we figured out by looking at the image that there was space around the edges of the sphere sdf. I remembered having this error in my sdf hw where the edges had space between objects and the way I had solved that was by updating the max ray steps used. +ERROR 5: Increase Max Ray steps + + From 42c58bd3d030bf5daa4b4ac9cee5c22497645c14 Mon Sep 17 00:00:00 2001 From: pojojojo21 <65415823+pojojojo21@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:54:07 -0500 Subject: [PATCH 2/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e55a68b..af2a8f6 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ From there we figured that our screen size looked good and everything was propor ERROR4: was reflecting eye about nor to calculate the new direction instead of direction about normal. Finally we figured out by looking at the image that there was space around the edges of the sphere sdf. I remembered having this error in my sdf hw where the edges had space between objects and the way I had solved that was by updating the max ray steps used. + ERROR 5: Increase Max Ray steps From d7a0dbbee193e50255fb112f8905a56da7e389cd Mon Sep 17 00:00:00 2001 From: pojojojo21 <65415823+pojojojo21@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:54:32 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index af2a8f6..521e8c8 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,19 @@ Shader toy link: https://www.shadertoy.com/view/dsBGRd We methodiccally followed the flow of the code. We started with the mainImage function and looked at the inputs calculated. Looking at the mainImage function we could clearly see the compiler error cause by uv2 not being initialized as a vec2 but just vec instead. + ERROR1: uv2 -> vec instead of vec2 Then we looked at where this was passed into the function raycast and noticed that uv2 was never used instead uv was passed in instead. + ERROR2: uv is used instead of uv2 in raycast function inputs We then followed raycast to it's definition where looked at what was being done in the function. We knew something was wrong because the screen was being stretched so that the spheres were not sphereical. There we noticed that iResolution.y is never used just iResolution.x which would distort the screen. + ERROR3: used iResolution.x/iResolution.x instead of iResolution.x/iResolution.y From there we figured that our screen size looked good and everything was proportionally correct. Now we needed to solved why all our objects were not reflecting the other objects but just their own color. So we went to look at where specular reflection is applied to all surfaces. Now we noticed that to get the correct relection direction so that we can find the other object that should be reflected in the one we are looking at we need to reflect the direction vector aboutt the normal but instead we are reflecting the eye about the normal. + ERROR4: was reflecting eye about nor to calculate the new direction instead of direction about normal. Finally we figured out by looking at the image that there was space around the edges of the sphere sdf. I remembered having this error in my sdf hw where the edges had space between objects and the way I had solved that was by updating the max ray steps used.