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

# Xiaonan Pan's Submission

Henry Han assisted me with the puzzles.
[Shadertoy Solution](https://www.shadertoy.com/view/tcsfWf)

## Bug List

1. The variable name `uv2`

- The error info from shadertoy directly guides to its location
2. The width - height ratio, change `H` to `H *= len * iResolution.x / iResolution.y`;
- After the fix of bug 1., I notice the screen is kind of stretched, from my experience, this may relate to the camera set and screen resolution. As this project is raycast based, raycast is somehow the camera, so I go through its code first and find the problem
3. Replace `reflect(eye, nor)` by `reflect(dir, nor)`
- Incorrect shading could come from incorrect hit info(like hitObjectID, shading model. material parameters) given by Intersection. I went to the Intersection and saw that the shading model is quite simple, just returning the color where the ray reflected to. So, the missing reflection effects could be from the `reflect()` function as it goes to incorrect position to get color.
4. Increase the max iteration number of `march()`, and use `nor` instead of `dir` to offset the intersection to avoid the false negative hit near the object
- The overall shapes looks smooth with a solid heigh-width ratio, so, the major of the code should be correct.
- I just played with the parameters to see if any artifacts disappear.


# 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