eradiate.scenes.phase.MultiPhaseFunction#
- class eradiate.scenes.phase.MultiPhaseFunction(id='phase', geometry=None, *, components, weights, use_mis=True)#
Bases:
PhaseFunctionMulti phase function.
Aggregates two or more sub-phase functions (components) and blends them based on its weights parameter. Weights are typically the associated medium’s scattering coefficient.
- traverse(callback)#
Traverse this scene element and collect kernel dictionary template and parameter update map contributions.
- Parameters:
callback (
SceneTraversal) – Callback data structure storing the collected data.
- update()#
Enforce internal state consistency. This method should be called when fields are modified. It is automatically called as a post-init step.
- with_normalized_weights(ctx)#
Return a copy of this phase function with per-cell weights rescaled to sum to 1 across components.
The returned instance’s
weightsis always a plainndarray, even ifself.weightswas a list of callables: this evaluates them (and the normalization) atctx.si, so the result is a snapshot at that one spectral index, not a phase function that stays normalized under further context changes.- Parameters:
ctx (
KernelContext) – Context at which weights are evaluated before normalization.- Returns:
MultiPhaseFunction– A new instance with the same components and geometry, and weights normalized to sum to 1 in every cell.
- property objects#
Map of child objects associated with this scene element.
- Returns:
dict– A dictionary mapping object names to a corresponding object to be inserted in the Eradiate scene graph.
- property params#
- Returns:
dict[str,SceneParameter] orNone– A dictionary mapping parameter paths, consisting of dot-separated strings, to a corresponding update protocol.
See also
- property template#
Kernel dictionary template contents associated with this scene element.
- Returns:
dict– A flat dictionary mapping dot-separated strings describing the path of an item in the nested scene dictionary to values. Values may be objects which can be directly used by themitsuba.load_dict()function, orDictParameterinstances which must be rendered.
See also