From 71f8b6aca1e5297cb382b9e79fa22be1128711b8 Mon Sep 17 00:00:00 2001 From: NicholasMoon Date: Wed, 9 Nov 2022 11:18:14 -0500 Subject: [PATCH 1/2] Update README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index aa0f112..72e95e9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,30 @@ # lab06-debugging +Link to ShaderToy: https://www.shadertoy.com/view/ddB3Rt + +shadertoyyyy + +I believe I found all 5 bugs. + +The first was on line 97:\ + This ndc conversion tried to use a vec class instead of vec2 + +The second was on line 100:\ + I simply used the same uv vec2 for all uv usages, so no need for uv2 + +The third was on line 11:\ + The aspect ratio calculation used the screen width divided by width instead of width divided by height + +The fourth was on line 18:\ + The number of ray marching iterations was too small so I increased to 128 + +The fifth was on line 75:\ + The eye, or camera position, was passed as the incident ray direction in the glsl reflect function. Instead I pass the actual direction of the incident ray dir + +To find all these bugs, I simply went in sequential order in terms of code execution: I started with the main function, then moved to raycast and sdf3D and march etc. +Luckily, I have become very familiar with ray casting and marching, so finding the bugs only required me to look through the code and notice anything that +seemed out of place. In something I was less familiar with, I would probably have had to start incrementally testing the functions to understand the output. + # 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 c7ba7580edc472e45541eb3c055271b77d84e713 Mon Sep 17 00:00:00 2001 From: NicholasMoon Date: Wed, 9 Nov 2022 11:19:37 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 72e95e9..e3c9146 100644 --- a/README.md +++ b/README.md @@ -6,20 +6,20 @@ Link to ShaderToy: https://www.shadertoy.com/view/ddB3Rt I believe I found all 5 bugs. -The first was on line 97:\ - This ndc conversion tried to use a vec class instead of vec2 +The first was on line 97: + - This ndc conversion tried to use a vec class instead of vec2 -The second was on line 100:\ - I simply used the same uv vec2 for all uv usages, so no need for uv2 +The second was on line 100: + - I simply used the same uv vec2 for all uv usages, so no need for uv2 -The third was on line 11:\ - The aspect ratio calculation used the screen width divided by width instead of width divided by height +The third was on line 11: + - The aspect ratio calculation used the screen width divided by width instead of width divided by height -The fourth was on line 18:\ - The number of ray marching iterations was too small so I increased to 128 +The fourth was on line 18: + - The number of ray marching iterations was too small so I increased to 128 -The fifth was on line 75:\ - The eye, or camera position, was passed as the incident ray direction in the glsl reflect function. Instead I pass the actual direction of the incident ray dir +The fifth was on line 75: + - The eye, or camera position, was passed as the incident ray direction in the glsl reflect function. Instead I pass the actual direction of the incident ray dir To find all these bugs, I simply went in sequential order in terms of code execution: I started with the main function, then moved to raycast and sdf3D and march etc. Luckily, I have become very familiar with ray casting and marching, so finding the bugs only required me to look through the code and notice anything that