Skip to content

Lab02: Christine Kneer #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# lab02-debugging

## Name: Christine Kneer

[My Shadertoy Link](https://www.shadertoy.com/view/X3scWj)

![sdf](https://github.com/user-attachments/assets/92dc2cc3-7005-4dbc-8069-d6b2a0c1c5a1)

- **Bug 1**: Line 97, vec uv2 = 2.0 * uv - vec2(1.0); Code did not compile, so this bug was fairly easy to find.
- **Bug 2**: Line 100, raycast(uv, dir, eye, ref); Sphere position was off, so I decided to double check my ray cast inputs, where I found the bug.
- **Bug 3**: Line 11, H *= len * iResolution.x / iResolution.x; The scene's aspect ratio was obviously off (not unit spheres), so I naturally looked for where iResolution was used,
since iResolution is usually related to aspect ratio.
- **Bug 4**: Line 75, dir = reflect(eye, nor); I noticed that there was absolutely no reflection. In order to see what was going on better, I changed the reflection color to black, and I realized that I could indeed see the black color on these objects. This means that “reflection” was happening, just with the wrong color - this most likely means that our reflected rays were not hitting the correct object. Then I went to look for where we were calculating the reflection color, and I immediately noticed that dir = reflect(eye, nor) is off, because we would want to reflect our rayCast ray instead of the eye in the other direction.
- **Bug 5**: Line 18, for(int i = 0; i < 64; ++i). Plane was abruptly cut off, but the rest of the plane all looked correct. It seems that ray march did reach far enough, i.e. not enough steps, so I went to check the ray cast for loop.

# 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