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

[shadertoy](https://www.shadertoy.com/view/wcsBWf)


1. Line 102, vec uv2 = 2.0 * uv - vec2(1.0); uses an invalid type vec instead of vec2. This cause a compilation error since vec is not a valid GLSL type
2. Line 106, raycast(uv, dir, eye, ref); passes the [0,1] coordinates instead of the [-1,1] coordinates that were calculated in uv2. I saw that uv2 was calculated to convert from [0,1] to [-1,1] range, but then wasn't actually used.
3. Line 13, line H *= len * iResolution.x / iResolution.x; divides x by x, which equals 1, causing an incorrect aspect ratio. I noticed the division was x/x = 1 instead of x/y, which cause the image to appear stretched
4. Line 79, In the sdf3D function, dir = reflect(eye, nor); uses the eye position instead of the ray direction for reflection calculation. I recognized that the reflect() function expects an incident direction vector.
5. Line 21, we need more iterations to find hits.

# 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