From 25af7b71a408df98affe5149c2509931809f0264 Mon Sep 17 00:00:00 2001 From: wxc <55120659+xchennnw@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:00:09 -0400 Subject: [PATCH 1/3] Update README.md --- README.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index aa0f112..bebbadd 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,16 @@ # lab06-debugging -# Setup +# Name & Link +### Janet Wang +https://www.shadertoy.com/view/DdccR2 -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). +# Bugs +### 1. Line 97: should write vec2 +It's reminded by the compiler. +### 2. Line 100: Should use uv2 in raycast. +It's quite obvious when I read the mainImage() function line by line. +### 3. Line 11: Should be H *= len * iResolution.x / iResolution.y; +The geometry of the balls are weird, and the problem should be in raycast or sdf. And when looking at the raycast function, it's clear that H should be multiplied by Aspect ratio, which is iResolution.x / iResolution.y. +### 4. Line 11: Should be H *= len * iResolution.x / iResolution.y; +The balls are missing their reflections, so I read the code about relection in sdf. Somehow the input of reflect() was eye, it's meaningless and should be dir. -Let's practice debugging! We have a broken shader. It should produce output that looks like this: -[Unbelievably beautiful shader](https://user-images.githubusercontent.com/1758825/200729570-8e10a37a-345d-4aff-8eff-6baf54a32a40.webm) - -It don't do that. Correct THREE of the FIVE bugs that are messing up the output. You are STRONGLY ENCOURAGED to work with a partner and pair program to force you to talk about your debugging thought process out loud. - -Extra credit if you can find all FIVE bugs. - -# Submission -- Create a pull request to this repository -- In the README, include the names of both your team members -- 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!) From 634c22b157d008a08ea29d2215380d61f83afd59 Mon Sep 17 00:00:00 2001 From: wxc <55120659+xchennnw@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:01:03 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bebbadd..769c815 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,6 @@ It's reminded by the compiler. It's quite obvious when I read the mainImage() function line by line. ### 3. Line 11: Should be H *= len * iResolution.x / iResolution.y; The geometry of the balls are weird, and the problem should be in raycast or sdf. And when looking at the raycast function, it's clear that H should be multiplied by Aspect ratio, which is iResolution.x / iResolution.y. -### 4. Line 11: Should be H *= len * iResolution.x / iResolution.y; +### 4. Line 75: Should be dir = reflect(eye, nor); The balls are missing their reflections, so I read the code about relection in sdf. Somehow the input of reflect() was eye, it's meaningless and should be dir. From 8bab2bb09712f324a5c8284e173ea045fb84137c Mon Sep 17 00:00:00 2001 From: wxc <55120659+xchennnw@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:01:17 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 769c815..e17f1db 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,6 @@ It's reminded by the compiler. It's quite obvious when I read the mainImage() function line by line. ### 3. Line 11: Should be H *= len * iResolution.x / iResolution.y; The geometry of the balls are weird, and the problem should be in raycast or sdf. And when looking at the raycast function, it's clear that H should be multiplied by Aspect ratio, which is iResolution.x / iResolution.y. -### 4. Line 75: Should be dir = reflect(eye, nor); +### 4. Line 75: Should be dir = reflect(dir, nor); The balls are missing their reflections, so I read the code about relection in sdf. Somehow the input of reflect() was eye, it's meaningless and should be dir.