From 08e2a68b71318d55879070e838edd07aa90acd48 Mon Sep 17 00:00:00 2001 From: Haoquan Liang <90011917+LEO-CGGT@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:33:11 -0500 Subject: [PATCH] Update README.md --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index aa0f112..14b2c14 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ # lab06-debugging +Team members: Leo Liang, Wayne Wu +[Shader Toy link](https://www.shadertoy.com/view/dsSGRt) -# 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). - -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!) +Bug: +1. `vec uv2 = 2.0 * uv - vec2(1.0);` + It's a syntax error and it won't compile with this. + Should be `vec2 uv2 = 2.0 * uv - vec2(1.0);` +2. `raycast(uv, dir, eye, ref);` + The camera looks off so there could be something wrong with the raycast. + So I found that uv2 is computed but uv is used instead. Should be `raycast(uv, dir, eye, ref);` +3. `H *= len * iResolution.x / iResolution.x;` + The aspect ratio still looks wrong after fixing the above bugs. By looking through the code I found iResolution.x/iResolution.x, which looks absolutely wrong. + It should be `H *= len * iResolution.x / iResolution.y;` +4. `dir = reflect(eye, nor);` + There is no reflection so something must be wrong. We figured out it's something wrong with how `dir` is computed but didn't figure out how to fix it properly. Adam taught us how to do it. + It should be `dir = reflect(dir, nor);` +5. Not sure if this is a bug but if we keep `i < 64` in `void march()`, there will be some artifacts on the floor. + It's technically not a bug because sometimes people just want smaller marching distance for better performance. If we increase it to `i < 128`, there will be no more artifacts on the floor.