Skip to content

Joanna Fisch and Rhuta Joshi Lab Submission #12

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 3 commits 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
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,29 @@ Extra credit if you can find all FIVE bugs.
- In the README, create a link to your shader toy solution with the bugs corrected
- In the README, describe each bug you found and include a sentence about HOW you found it.
- Make sure all three of your shadertoys are set to UNLISTED or PUBLIC (so we can see them!)

Partner: Rhuta Joshi
Shader toy link: https://www.shadertoy.com/view/dsBGRd

We methodiccally followed the flow of the code. We started with the mainImage function and looked at the inputs calculated.
Looking at the mainImage function we could clearly see the compiler error cause by uv2 not being initialized as a vec2 but just vec instead.

ERROR1: uv2 -> vec instead of vec2

Then we looked at where this was passed into the function raycast and noticed that uv2 was never used instead uv was passed in instead.

ERROR2: uv is used instead of uv2 in raycast function inputs

We then followed raycast to it's definition where looked at what was being done in the function. We knew something was wrong because the screen was being stretched so that the spheres were not sphereical. There we noticed that iResolution.y is never used just iResolution.x which would distort the screen.

ERROR3: used iResolution.x/iResolution.x instead of iResolution.x/iResolution.y

From there we figured that our screen size looked good and everything was proportionally correct. Now we needed to solved why all our objects were not reflecting the other objects but just their own color. So we went to look at where specular reflection is applied to all surfaces. Now we noticed that to get the correct relection direction so that we can find the other object that should be reflected in the one we are looking at we need to reflect the direction vector aboutt the normal but instead we are reflecting the eye about the normal.

ERROR4: was reflecting eye about nor to calculate the new direction instead of direction about normal.

Finally we figured out by looking at the image that there was space around the edges of the sphere sdf. I remembered having this error in my sdf hw where the edges had space between objects and the way I had solved that was by updating the max ray steps used.

ERROR 5: Increase Max Ray steps