-
Notifications
You must be signed in to change notification settings - Fork 868
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
Sphere Bounding Box: Artifact for negative radius. #532
Comments
Makes sense. I don't know if negative radii will cause other issues as well, though. Let us know what happens in your own code. |
Thank you. So far, except for the bounding box, negative radii do not have any other visible side effects. Code behaves as expected even though it should only be used in the context of creating thickness for dielectrics sharing the same index. |
Looking at the code, the bounding box method is
Looks like this should handle a negative radius just fine. |
Wait, I think the better fix here is to handle this in
|
Indeed you are right. It will take all geometries into account that way. I did not think about that, i still only manage spheres in my implementation. |
I should also point out that the better approach to this (nested materials) is to implement a refracted index stack, assuming that shapes fully nest each other. That would be a fun little appendix project. |
Oh, and while I'm here, I neglected to point out that my proposed code above is due to the fact that the |
Can be fun yes, or having a stack of "thickness" values associated with different refractive index directly inside the sphere object (if all bubbles are concentric). |
I do a rather thorough investigation of this when porting the code to Optix (RTX), and found that negative radii had no visible effect except for BVH construction. |
There's also the question here about whether negative radii (a geometric attribute) should be used as a hack to invert the index of refraction (a material attribute). Instead of creating a glass (inside air) sphere turned inside out, the model should be that of an air inside glass sphere, by supplying the dielectric constructor with an inverted index of refraction. Going with this approach, the change could (should) be as simple as explaining how to model a bubble in a glass sphere in the text. |
I believe that this is fixed now with the latest change to treat aabb constructor parameters as any two extreme points, rather than specifically the point of all minimums and the point of all maximums. Please re-open if this is not true. |
Bounding box calculation for spheres should take the absolute value of the radius in order to take into account "bubble" like dielectrics where sphere with negative radius is placed inside another one.
The text was updated successfully, but these errors were encountered: