source icon indicating copy to clipboard operation
source copied to clipboard

Proposal: volumetric scattering

Open MMoscheni opened this issue 2 years ago • 1 comments

Dear Raysect team,

currently rays fired by observers are of rectilinear trajectory, which could potentially be reflected/scattered by material surfaces (call it "superficial scattering").

Adding "volumetric scattering", i.e. simulating non-rectilinear ray trajectories within the volume of a material, could potentially be interesting. The scattering probability would generally depend on local material properties, specified by the user via a scattering_function_3d(). If material properties vary in space, then relying on adaptive integration (see this issue) would be a necessary conditon.

Quoting the wise strategy suggested by @vsnever (from this issue):

  • Scattering changes the ray's direction. Therefore, the point at which the ray leaves the volume of the primitive is not known prior to scattering simulation. To be consistent with the rest of the Raysect API, this feature must be implemented in the evaluate_surface() method of the NullVolume material. However, the implementation will be tricky, because in addition to tracing the world, each daughter ray should be the subject of this Monte-Carlo scattering simulation inside the primitive, until the last of the spawned rays leaves it at some point.

What do you think? Thank you! Cheers, Matteo

MMoscheni avatar Jan 19 '23 09:01 MMoscheni

Volumetric scattering is proposed for v1.0. To implement it requires a complete re-implementation of the volume integration system. This would be a significant API change and would require cherab's materials to be rewritten. See #357.

CnlPepper avatar Jan 29 '23 17:01 CnlPepper