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
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# lab06-debugging

## Submission
### Team
Sakshi & Megan

[Solution Link](https://www.shadertoy.com/view/ddBGRt)

### Bugs

1. **Compile time Error**

Line 97: Syntax error vec2 (not vec)

Compile time error that was present from the beginning. Easy to spot, Shadertoy indicates such errors and will not run untill they are solved.

2. **Aspect Ratio**

Line 11: Correct the aspect ratio (iResolution.x / iResolution.y)

The spheres were not uniform and stretched along the x direction. Since the UV calculation looked right, we looked at the ray cast code and found that the aspect ratio was being calculated incorrectly.

3. **Incorrect Argument**

Line 100: Pass in the correct UVs (uv2)

The image was centered at the lower left corner, so we suspected something with the UVs was still incorrect. This one took me a while and I went back to verify the ray cast code (even pulled up Adam's raycasting slides :P). Finally Megan found out that the uvs being input to the raycast funtion were incorrect.

4. **Raycast Distance**

Line 18: Increase the max distance for ray marching (was 64, changed to 300)

The edges of the ground near where they met the spheres were warped and those artifacts were similar to what we've seen in the class.

5. **Ray Direction**

Line 75: Fixed ray calculation for specular reflection

The sphere reflection looked off and that made us look into the code handling reflection. I had to look up the parameters for the reflect function that made it clear that the 1st expected input parameter is ray direction and not ray origin

# 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