I’m a recent blender user, and so to the Blender community and forums. In the Blender channels some users told me to ask this question here, so I hope I’m doing right.
I’ve been looking to improve my volume rendering equation as the one Blender uses in the Principled Volume Node. Therefore, I’ve tried to search the code and see how it is done, but I couldn’t find anything.
More precisely, my question is:
Does anyone know the approximation of the equation used in Blender for the volume rendering algorithm? To be more concrete, how does it look the code behind the Principled Volume node?
I’ve already seen this code, but I was expecting the part of the loop. If it is done with ray casting I suppose that the color is computed by the sum of the colors at each step in each pixel.
Actually yes, I’ve tried to unserstand something but I couldn’t get a lot. I could find the ray loop, but not how they comute the final color at each step, and how they interact between the scattering and absorption color result.
How about the theory behind the model? Does Blender uses the optical model approach called “multi scattering”?
I suggest to look at the “Production Volume Rendering” SIGGRAPH course or the volume rendering chapters in PBRT.
In Cycles there can be scattering on surfaces or in volumes, it’s all part of the same path tracing algorithm. Volume multiple scattering is automatically supported, there’s no specific code for that, it’s just the natural result of path tracing with multiple bounces.