-
Notifications
You must be signed in to change notification settings - Fork 25
Description
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 theNullVolumematerial. 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