Skip to content
Open
Show file tree
Hide file tree
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
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
# lab02-debugging
# Debugging Lab Submission - Nico Kong

## Shadertoy

Link: https://www.shadertoy.com/view/wfsfWf

![](f5.png)

## Debugging Process

1 - Compiler help me identify that the code wrote
[line 97] vec uv2 instead of vec2 uv2;

2 - starting by looking at the main function, I noticed that uv2 isn't used anywhere, and that is it supposed to be the input for raycast (instead of uv)
[line 100] using uv instead of uv2 as an input;

3 - I noticed that the scene seems stretched. at this point, i decided to start reading the individual subfunctions in order, and noticed that the computation of H seems redundant and was probably a mistake.
[line 11] changed dividing by resolutionY to dividing by resolutionX;

4 - Comparing to the result pic, i noticed the ground isn't rendered as far as it should. with only using 64 steps for the marching, it's not enough for it to reach the full scene. so i changed
[line 18] to do 256 iterations instead of only 64.

5 - Reflection
i changed it such that when the reflection is not hitting an object, we get a white/black color; and noticed that only a small part of the geometry is changing - this suggests that the reflection rays are hitting something.
I'm now assuming that the reflection is hitting the object itself - since the color is assigned to some material that it hit, but the object still has its own color.
up on further inspection, [line 75] dir = reflect(eye, nor); doesn't make sense.
we're trying to reflect the ray direction and not the eye vector - so I fixed the problem by changing it to
[line 75] dir = reflect(dir, nor);

## Team Members

This assignment was completed solo.

# Assignment Description

# Setup

Expand Down
Binary file added f5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.