by amelius · 1y ago · 0 comments
> PBRT's MediumInterface system can only represent a single "inside" medium and a single "outside" medium per shape. If a shape physically touches multiple different media (for example, a glass sphere sitting at the interface between water and air), PBRT cannot directly represent this configuration.
I think this is kind of odd for a renderer which is otherwise quite capable. Can anyone explain why this is the case, and how I can work around this limitation?
That way the light will refract on the internal boundary as if it moves from the one material to the other.
Prerequisite is that you ened to be able to create non-manifold objects...
When you say quotient, which material's ior is in the numerator and which in the denominator?
The resulting interface ior should be positive if you go from a less dense medium into a denser medium, so I guess the material you're going to goes on top.
(which matches what happens from air-> glass. ior air is more or less one, mior glass = 1.5 so from air to glass -> ior 1.5)
https://blog.yiningkarlli.com/2019/05/nested-dielectrics.htm...
that inspired me to add the feature to my renderer (rayrender.net).
The downside to priority tracking (and possibly why PBRT does not include it) is it introduces a lots of overhead to ray traversal due to each ray needing to track a priority list. Modern raytracers use packets of rays for GPU/SIMD operations, and thus minimizing the ray size is extremely important to maximize throughput and minimize cache misses.
And, PBR being a textbook, we do save some things for exercises and I believe that is one of them; I think it's a nice project.
A final reason is book length: we generally don't add features that aren't described in the book and we're about at the page limit, length wise. So to add this, we'd have to cut something else...
Maybe I have to broaden my search for a raytracer. What would be my best bet for correctly simulating multi-material lenses (so with physical correctness), in Linux (open source), preferably with GPU support?
(By the way, as a user I'd be happy to give up even a factor of 10 of performance if the resulting rendering was 100% physically accurate)