Ray tracing where illumination itself affects the geometry 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 &quot;in real time&quot;, 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.
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 &quot;irradiance meter&quot; 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.