Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# lab06-debugging

Link to ShaderToy: https://www.shadertoy.com/view/ddB3Rt

<img width="475" alt="shadertoyyyy" src="https://user-images.githubusercontent.com/43520504/200883352-91b97e0a-c945-4349-9e9b-809310882f92.PNG">

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).
Expand Down