Skip to content

Rewrite Book 3 to allow for flipping faces of Cornell Light #662

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

Closed
trevordblack opened this issue Jul 8, 2020 · 5 comments
Closed

Rewrite Book 3 to allow for flipping faces of Cornell Light #662

trevordblack opened this issue Jul 8, 2020 · 5 comments
Assignees
Milestone

Comments

@trevordblack
Copy link
Collaborator

See #661

"
However! In Book 3, the flipface usage is reintroduced in order to make the rectangle-shaped light one-sided, to avoid bleed-through in the ceiling. Currently, Book 3 has no code for it. When the currently-merged version of Book 2 gets published, there will be no place for a reader to find the flip face methods. Perhaps a tiny remark, but something that occurred to me 😄
"

@trevordblack trevordblack added this to the v3.3.0 milestone Jul 8, 2020
@trevordblack trevordblack self-assigned this Jul 8, 2020
@hollasch hollasch modified the milestones: v3.3.0, Backlog, v4.0.0 Oct 12, 2020
@hollasch hollasch self-assigned this Oct 29, 2020
@trevordblack
Copy link
Collaborator Author

The options for this are:

  1. Leave everything as is
  2. Hard code into emitted that the back face illuminates. It works in this case, but makes the general case wrong. i.e
    color emitted(const ray& r_in, const hit_record& rec, double u, double v, const point3& p)
    const override {
        if (!rec.front_face)
            return emit->value(u, v, p);
        return color(0,0,0);
    }
  1. Subclass the light so that only the light in the ceiling points the other way
  2. Create a subclass xz_rect whose outward_normal is down
  3. Add a boolean to the rect class to specify which side of the rect is the front_face
  4. Remove that subsection and try to live with the light bleed on the light, maybe move it closer to the ceiling

@trevordblack
Copy link
Collaborator Author

trevordblack commented Dec 16, 2020

  1. Rotate the light 180 degrees in any axis

@hollasch
Copy link
Collaborator

  1. Take a look at Investigate general quadrilateral object to replace existing axis-aligned rectangles (aarect.h) #756. We have a lot of redundant classes just because we don't have a general quadrilateral primitive. That's all we need. There are two general approaches:
    8a. Implement a canonical quadrilateral primitive (like <0,0,0> x <1,1,0>, facing in the +Z direction) and rely on standard transforms to position and orient these quadrilaterals.
    8b. Implement a parameterized quadrilateral that takes position plus two U,V vectors to create a quadrilateral in any orientation.

Normally I'd like 8a, but our current transform support is quite limited, and I think that's appropriate. 8b will give us what we need with quite a bit more flexibility, is easy to understand and is easy to implement. It will deprecate box (though we will then just specify a box factory function using quadrilaterals), xy_rect, xz_rect, yz_rect and probably flip_face.

@trevordblack
Copy link
Collaborator Author

this is currently blocked by #292

hollasch added a commit that referenced this issue Aug 13, 2021
This reverts commit b0fbca7b0c6c4e77491b1bbebc6ed5fe939d912e.

Removing these primitives, since we will not be using them. This change
also removes the temporary test scene for quads.

Resolves #292
Resolves #662
Resolves #681
Resolves #756
Resolves #780
@hollasch
Copy link
Collaborator

Fixed in ed119af

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants