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

Glass absorbtion [Feature request] #109

Open
JeremyLeaf opened this issue Aug 25, 2023 · 1 comment
Open

Glass absorbtion [Feature request] #109

JeremyLeaf opened this issue Aug 25, 2023 · 1 comment

Comments

@JeremyLeaf
Copy link

JeremyLeaf commented Aug 25, 2023

Firstly thanks for maintaining this project, it is extremely useful!

Would it be feasible to add an absorbtion setting/parameter to a glass object? So as a ray traverses through the object it gets dimmer due to absorbtion? Maybe this could be achieved by taking the length of a ray within a glass, displaying it with a gradient brightness depending on the length of line.

@ricktu288
Copy link
Owner

Two approaches possible here.

  1. Integrate with Gradient-index optics #69, so that the rays are traced step-wise. This will be quite inefficient if the refractive index and absorption rate are constant (but is the only approach if they are not constant).
  2. As @JeremyLeaf suggested, trace the rays as usual, but the distance that each segment of ray goes is considered.

For 2., we need to add a loop in addRay that checks whether the ray is emerging within each glass. And hence each glass must implement isInsideGlass, etc as currently do for GRIN glasses. These change is also required for #37 and the "source-over body-merging" approach of defining "absolute refractive index" (see #51).

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