I am interested in a scientific application in which ray tracing is necessary, but also where the light itself alters the geometry of the surface mesh (imagine perhaps that the beams of light have enough energy to damage the surface). Right now I am writing everything from scratch and not using any existing libraries, and thus my (obviously naive) implementation is extremely slow. As I understand it, this boils down to clever methods by which to update the BVH, interleaved with each rendering step.

Some slight elaboration on the problem: when a ray of light hits a surface, we consider two possibilities: either it reflects off the surface (as is typical in a ray tracer), or it impacts the surface and essentially burns a hole into the surface. This alters the geometry of the mesh and affects any future light rays, and thus forces an update of the boundary volume hierarchy. The surface deformation is usually local but can be global-scale, for example if the hole is large enough it may cause the structure to collapse or break off. Thus ray tracing affects the geometry "in real time", but simultaneously geometry is necessary to perform ray tracing at each step as well.

While I'm interested in the algorithmic problem, what I'm more interested in is whether or not there is a graphics library that is well suited to this task, so that I don't have to re-invent the wheel, or dive too deep into the literature. I am quite a beginner when it comes to available software libraries so please forgive me.

  • 2
    $\begingroup$ This sounds like an animation issue. That is, the light would affect the geometry you would use next frame, not on the current frame. And you'd need to store the changes to the geometry from frame to frame, lest the removal of light cause the geometry to repair itself. $\endgroup$ Nov 27, 2020 at 14:55
  • $\begingroup$ @NicolBolas Yeah that sounds right. Right now everything is done exactly but very slow, so basically if this whole problem could be mostly solved "efficiently" using some well-known graphics library we would save a lot of trouble, so that's what I was hoping for. $\endgroup$ Nov 27, 2020 at 20:23

1 Answer 1


You might look into Mitsuba, which is a physically based path tracing renderer that's designed to be easy to extend with plugins. It might be useful as a base for you to build on, implementing your own algorithms as plugins or by modifying its code.

It already contains facilities for measuring the amount of light falling on some geometry, in the form of the "irradiance meter" object. I'm not sure how much it can help you with geometry modification as it's not really designed for that (it just imports geometry from a file and renders it), but maybe you can find some other libraries to help with that part, depending on what kind of geometry operations you need to do.

  • $\begingroup$ Thank you for your answer. Unfortunately I think that the geometry modification is actually the crux of the problem. But I will take a look! $\endgroup$ Nov 26, 2020 at 5:07
  • $\begingroup$ Maybe you could add to your question some more details about what kind of geometry modifications you want to do? People might be able to recommend something. $\endgroup$ Nov 26, 2020 at 19:52
  • $\begingroup$ I have updated my question accordingly. $\endgroup$ Nov 27, 2020 at 7:31
  • $\begingroup$ Hi @ChristopherA.Wong. You are right to prefer not to reinvent the wheel. A library like Mistuba that can not only render an image, but also as a by-product tell how much light some materials receive, in a physically accurate fashion, looks like a very strong asset for you. It can probably produce accurately the precise information your specific application needs to know how to change the geometry (e.g., melting wax). Writing your code like: make a mesh -> get an image + illumination info -> your_plugin_that changes_geometry -> new mesh, loop, looks like a sane and strong approach. $\endgroup$ Nov 28, 2020 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.