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

FlipFace seems to be needed #720

Closed
L3tum opened this issue Aug 28, 2020 · 1 comment
Closed

FlipFace seems to be needed #720

L3tum opened this issue Aug 28, 2020 · 1 comment

Comments

@L3tum
Copy link

L3tum commented Aug 28, 2020

This is in "response" to #482 which I've read through.

To my understanding the code record.SetFaceNormal(new Vector3(0, 0, 1)); should prevent some of the rectangles to be black. However, in my implementation they do appear black, and depending on whether I switch the front face calculation on or off, either 3 rectangles (off: top, left, back) or 2 rectangles (on: right, bottom) appear black.

I've rechecked my implementation a few times but I can't seem to find any discernible difference in code. I set the normal via the method above which has the same implementation as the source in this repo. The Lambertian scatter method is also 1:1 the same.

From checking some of the other implementations of this book, most of them seem to implement the extra FlipFace "modifier" as well as the record.SetFaceNormal method making the source code in this repo the only implementation (I've found so far) that only uses the latter.

@L3tum
Copy link
Author

L3tum commented Aug 29, 2020

Ah, sorry about this. I had one version of my implementation that saved the Ray on the HitRecord and calculated the front face from that. Apparently while trying around some things I deleted that line and always calculated the front face against a ray direction of (0,0,0).

@L3tum L3tum closed this as completed Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant