Code Monkey home page Code Monkey logo

Comments (3)

mmp avatar mmp commented on August 15, 2024

This is an interesting question; I've been chewing on it a bit...

The way I had been thinking of failing the alpha test was that it essentially meant there was no geometry there after all--the intersection was a no-op, nothing to see here, keep tracing the ray, etc. The potential alternative interpretation, shown in this example, is that there is kind of a pseudo-intersection, but there's no scattering at that point, and then the ray continues doing its thing after(and so in this case, would pick up a new medium, etc.)

I think that both interpretations are reasonable. The current interpretation has the advantage that it can be resolved in the middle of ray intersection testing traversal, while the other would require first resolving what is the closest intersection, then checking alpha, then picking up the new medium and going forth. So I'm inclined to stick with the current interpretation (and document it better), since I think the alternative one would impose some performance cost that wouldn't buy anything in the case where there aren't any participating media involved.

I am of course open to the argument that the alternative is actually better in general here...

from pbrt-v4.

shadeops avatar shadeops commented on August 15, 2024

I'm in agreement with you, having the more common case being faster is my preference. It only requires a little bit of extra scene assembly to achieve the desired effects above, so imposing a speed penalty to make that extra setup a little easier isn't worth it in my opinion.

Implementing the other interpretation and measuring the performance impact on different types of scenes might make for an interesting exercise for readers. =]

from pbrt-v4.

mmp avatar mmp commented on August 15, 2024

Sounds good--thanks! I've made a note about this for discussion and/or exercise-ification in the book.

from pbrt-v4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.