Skip to content
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

lab2 Yi Liu #29

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update readme
  • Loading branch information
yiliu1237 committed Sep 18, 2024
commit 0c77b8c9d6788eafca1667e41a90a91f1d668d6d
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ Create a [Shadertoy account](https://www.shadertoy.com/). Either fork this shade
https://www.shadertoy.com/view/M3fcD2


<p align="center">
<img src="https://github.com/yiliu1237/lab02-debugging/shader_result.gif?raw=true"/>
</p>












# Bug1: Syntax Error
## Bug1: Syntax Error
- Issue: The variable uv2 was declared as vec instead of vec2.
- Fix: Change the type of uv2 to vec2.
- How It Was Found: The Shadertoy editor highlighted this as a syntax error upon running the shader.

# Bug2 Incorrect Input to raycast Function
## Bug2 Incorrect Input to raycast Function
- Issue: The uv variable was incorrectly used when calling the raycast function.
- Fix: Use uv2 instead of uv when calling raycast to ensure proper coordinates are passed.
- How It Was Found: The rendered output was distorted, leading to inspection of how coordinates were handled.

# Bug3: Reflection Calculation Error
## Bug3: Reflection Calculation Error
- Issue: The reflection was not computed correctly due to the misuse of the reflect function.
- Fix: Update the reflect function call to use the correct vector inputs:

Expand All @@ -43,7 +36,7 @@ dir = reflect(dir, nor);

- How It Was Found: The reflection on objects appeared incorrect, leading a deeper look into the reflection calculation.

# Bug4: Scene Aspect Ratio Distortion
## Bug4: Scene Aspect Ratio Distortion
- Issue: The rendered scene was stretched along the x-axis, showing ellipsoids instead of spheres.
- Fix: Adjust the scene's aspect ratio to prevent distortion.

Expand All @@ -55,7 +48,7 @@ uv2.x /= iResolution.y;
- How It Was Found: Comparing the reference Shadertoy to the current output revealed the ratio issue.


# Bug5: Insufficient Iterations in march Function
## Bug5: Insufficient Iterations in march Function
- Issue: The march function was not iterating through enough steps, causing the scene to render incorrectly.
- Fix: Increase the number of iterations in the march function to allow sufficient steps for ray marching:

Expand Down