API Reference¶
This page documents the Python-facing API introduced by the Eradiate kernel. Only additions specific to this fork are covered here; the base Mitsuba 3 API is documented in the Mitsuba 3 documentation.
How to build this page
This page requires two steps before it renders correctly:
Build the sources.
Build the API subsite to generate the intermediate RST.
These steps are automated by the pixi run docs-api task. Then rebuild this site normally.
Constants¶
Medium¶
- class mitsuba.Medium¶
Base class:
mitsuba.Object- get_majorant(self, mi, active=True)¶
Returns the medium’s majorant used for delta tracking
- Parameter
mi(mitsuba.MediumInteraction3f): no description available
- Parameter
active(bool): Mask to specify active lanes.
- Returns →
mitsuba.Color3f: no description available
- Parameter
- get_scattering_coefficients(self, mi, active=True)¶
Returns the medium coefficients Sigma_s, Sigma_n and Sigma_t evaluated at a given MediumInteraction mi
- Parameter
mi(mitsuba.MediumInteraction3f): no description available
- Parameter
active(bool): Mask to specify active lanes.
- Returns → tuple[
mitsuba.Color3f,mitsuba.Color3f,mitsuba.Color3f]: no description available
- Parameter
- has_spectral_extinction()¶
Returns whether this medium has a spectrally varying extinction
- Returns → bool:
no description available
- intersect_aabb(self, ray)¶
Intersects a ray with the medium’s bounding box
- Parameter
ray(mitsuba.Ray3f): no description available
- Returns → tuple[bool, float, float]:
no description available
- Parameter
- is_homogeneous()¶
Returns whether this medium is homogeneous
- Returns → bool:
no description available
- property m_has_spectral_extinction¶
(self) -> bool
- property m_is_homogeneous¶
(self) -> bool
- property m_sample_emitters¶
(self) -> bool
- phase_function()¶
Return the phase function of this medium
- Returns →
mitsuba.PhaseFunction: no description available
- Returns →
- sample_interaction(self, ray, sample, channel, active)¶
Sample a free-flight distance in the medium.
This function samples a (tentative) free-flight distance according to an exponential transmittance. It is then up to the integrator to then decide whether the MediumInteraction corresponds to a real or null scattering event.
- Parameter
ray(mitsuba.Ray3f): Ray, along which a distance should be sampled
- Parameter
sample(float): A uniformly distributed random sample
- Parameter
channel(int): The channel according to which we will sample the free-flight distance. This argument is only used when rendering in RGB modes.
- Parameter
active(bool): Mask to specify active lanes.
- Returns →
mitsuba.MediumInteraction3f: This method returns a MediumInteraction. The MediumInteraction will always be valid, except if the ray missed the Medium’s bounding box.
- Parameter
- sample_interaction_analytical(self, ray, it, sample, channel, active)¶
Sample a free-flight distance in the medium analytically.
This function samples a (tentative) free-flight distance according to an exponential transmittance. It is then up to the integrator to then decide whether the MediumInteraction corresponds to a real or null scattering event.
- Parameter
ray(mitsuba.Ray3f): Ray, along which a distance should be sampled
- Parameter
it(mitsuba.Interaction3f): The boundary interaction that the sampled distance cannot exceed.
- Parameter
sample(float): A uniformly distributed random sample
- Parameter
channel(int): The channel according to which we will sample the free-flight distance. This argument is only used when rendering in RGB modes.
- Parameter
active(bool): Mask to specify active lanes.
- Returns → tuple[
mitsuba.MediumInteraction3f,mitsuba.Color3f,mitsuba.Color3f]: This method returns a MediumInteraction. The MediumInteraction will always be valid, except if the ray missed the Medium’s bounding box.
- Parameter
- transmittance_eval_analytical(self, ray, it, active)¶
Compute the analytical transmittance along a ray to an interaction.
- Parameter
ray(mitsuba.Ray3f): Ray, along which to compute the transmittance, use mint
- Parameter
si: Interaction that marks the end of the segment along which to compute the transmittance.
- Parameter
it(mitsuba.Interaction3f): no description available
- Parameter
active(bool): Mask to specify active lanes.
- Returns →
mitsuba.Color3f: The transmittance along a ray
- Parameter
- transmittance_eval_pdf(self, mi, si, active)¶
Compute the transmittance and PDF
This function evaluates the transmittance and PDF of sampling a certain free-flight distance The returned PDF takes into account if a medium interaction occurred (mi.t <= si.t) or the ray left the medium (mi.t > si.t)
The evaluated PDF is spectrally varying. This allows to account for the fact that the free-flight distance sampling distribution can depend on the wavelength.
- Parameter
mi(mitsuba.MediumInteraction3f): no description available
- Parameter
si(mitsuba.SurfaceInteraction3f): no description available
- Parameter
active(bool): Mask to specify active lanes.
- Returns → tuple[
mitsuba.Color3f,mitsuba.Color3f]: This method returns a pair of (Transmittance, PDF).
- Parameter
- use_emitter_sampling()¶
Returns whether this specific medium instance uses emitter sampling
- Returns → bool:
no description available
Extremum¶
- class mitsuba.ExtremumSegment¶
Stores the extremum (minorant/majorant) data for a ray segment.
Used as the output type of ExtremumStructure traversal. Tracks the segment’s entry/exit distances and the local extinction coefficient bounds within that interval.
- __init__()¶
- __init__(self, other)¶
Copy constructor
- Parameter
other(mitsuba.ExtremumSegment): no description available
- Parameter
- __init__(self, mint, maxt, minorant, majorant)¶
Construct from entry/exit distances and a combined extremum vector.
- Parameter
mint(float): Segment entry distance
- Parameter
maxt(float): Segment exit distance
- Parameter
value(mitsuba.Vector2f): Extremum vector [minorant, majorant]
- Parameter
minorant(float): no description available
- Parameter
majorant(float): no description available
- Parameter
- __init__(self, mint, maxt, value)¶
Construct from entry/exit distances and a combined extremum vector.
- Parameter
mint(float): Segment entry distance
- Parameter
maxt(float): Segment exit distance
- Parameter
value(mitsuba.Vector2f): Extremum vector [minorant, majorant]
- Parameter
- assign(self, arg)¶
- Parameter
arg(mitsuba.ExtremumSegment, /): no description available
- Returns → None:
no description available
- Parameter
- majorant()¶
Majorant value over the segment. Accessor to the second element of
value.- Returns → float:
no description available
- property maxt¶
Segment exit distance along ray
- minorant()¶
Minorant value over the segment. Accessor to the first element of
value.- Returns → float:
no description available
- property mint¶
Segment entry distance along ray
- reset()¶
Mark the extremum segment as invalid.
This operation sets segment’s minimum and maximum distances to \(\infty\) and \(-\infty\), respectively.
- Returns → None:
no description available
- valid()¶
Check whether this is a valid segment
A segment is considered valid when
segment.mint < segment.maxt- Returns → bool:
no description available
- property value¶
Extremum data stored as [minorant, majorant]
- zero_(self, size=1)¶
Overloaded function.
zero_(self, size: int = 1) -> Nonezero_(self, arg: int, /) -> None
This callback method is invoked by dr::zeros<>, and takes care of fields that deviate from the standard zero-initialization convention. In ExtremumSegment, the
mintandmaxtfields are set to + and - infinity respectively to to mark invalid intersection records.- Parameter
size(int): no description available
- Returns → None:
no description available
- class mitsuba.ExtremumStructure¶
Base class:
mitsuba.ObjectAbstract base class for extremum structures
ExtremumStructure provides an interface for spatial data structures that store local extrema (majorant/minorant) of volumetric extinction coefficients. This enables efficient delta tracking with locally- adaptive majorants.
To minimize virtual function overhead, the
traverse_extremum()method encapsulates the entire traversal loop internally, requiring only a single virtual call per distance sample.- __init__(self, props)¶
- Parameter
props(mitsuba.Properties): no description available
- Parameter
- bbox()¶
Return the bounding box of the extremum structure
- Returns →
mitsuba.BoundingBox3f: no description available
- Returns →
- eval_1(self, it, active=True)¶
Evaluate the minorant and majorant at a medium interaction point.
This method performs point evaluation at interaction point specified in local space.
- Parameter
it(mitsuba.Interaction3f): Interaction interaction point in local space
- Parameter
active(bool): Mask for active lanes
- Returns → tuple[float, float]:
The minorant and majorant values at the medium interaction point. Clamped values outside bounds.
- Parameter