Skip to content

Lab 2: Kyra Clark & Saksham Nagpal #3

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 1 commit 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
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# lab06-debugging

# 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!)
# Kyra Clark & Saksham Nagpal - Lab 2
[Link to Shadertoy](https://www.shadertoy.com/view/DsccRj)

## Bugs, and how we found them!
1. **Bug 1 - Line #97 :** It was just a vec and not a vec2. We pressed compile, and the compilation failed and pointed us teo that line.
2. **Bug 2 - Line #100 :** The raycast function was using uv instead of uv2. We identified that the spheres' positions were way off on the screen when rendered, so we looked closely at the UVs being used, and found the bug in the mainImage function where the rendering was happening.
3. **Bug 3 - Line #18 :** We increased the max no. of iterations on our march function from 64 to 200. We noticed a weird warp around the edges of the sphere, which we identified from the slides that it happens when we terminate our raymarch too early and we lose out on details.
4. **Bug 4 - Line #11 :** H was being calculated with a multiplication factor of iResolution.x / iResolution.x, we changed the denominator to iResolution.y . We noticed the spheres were squashed, so we narrowed the issue down to 2 places - (i) either the SDF sampling is weird, or (ii) the raycast function is doing something funky. It was the latter.
5. **Bug 5 - Line #75 :** The reflect function was using 'eye' instead of 'dir'. The specular highlights were missing, so we knew the function to look at was sdf3D where the specular highlights get calculated. Looking there, we expected the reflect function to have a direction vector as input to reflect that along the input normal, but a vec3 position (i.e. eye) was being sent as the input instead, which was sus.