Skip to content

Lab 2: Gehan Zheng #25

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

# Team members

No team members.

# Shader Toy Links

[Fork 566 Debugg gehanzh 366](https://www.shadertoy.com/view/cs3yR2)

# Bugs

1. At first it just doesn't compile. So I found that it should be `vec2` instead of `vec` in line 97.

2. Transformation looks wrong. So I look into `raycast` function and found that in line 11 there's a typo `iResolution.x / iResolution.y` instead of `iResolution.x / iResolution.x`.

3. Transformation is still wrong but there is nothing wrong in `raycast` function. So I found that `raycast` is called with wrong parameters in line 100. The first parameter should be `uv2` instead of `uv`.
4. The material doesn't look specular. And I noticed that eye vector is passed to `reflect` function, which is definitely wrong. Change it to `dir` and it looks the same as the reference.
5. Reflection doesn't look the same as the reference. It is because number of iterations is too small.

6. (Not sure if it's a bug) It looks like Schlick's approximation is used to compute fresnel but `pow` is missing, so I fixed and it looks more specular now.
# 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