![]() |
RenderMan
26.0
|
Represents the LPE system state of a light transport path. More...
#include <RixLPE.h>
Public Member Functions | |
RixLPEState (RixLPEAutomata const *automata, const int nautomata) | |
~RixLPEState () | |
void | Reset () |
std::vector< short > & | GetState () |
const std::vector< short > & | GetState () const |
void | SetState (const std::vector< short > &state) |
bool | Broken () const |
bool | Test (const RixLPEToken dir, const RixLPEToken sca, const RixLPEToken custom) |
const RtColorRGB & | GetThruput () const |
const RixLPEAutomata * | GetAutomata (int &nautomata) const |
void | MoveCamera (RixShadingContext const *sCtx, int sCtxIndex) |
Call this method at a camera event along a light transport path. More... | |
void | MoveCamera (RixShadingContext const *sCtx, int sCtxIndex, const RtColorRGB &thruput) |
Second overload of the MoveCamera() method that accepts a path throughput. More... | |
void | MoveEmissiveObject (RixShadingContext const *sCtx, int sCtxIndex, RtColorRGB const &thruput, RixLPEToken lpeGroupId=RixLPE::k_BLANK) |
Call this method at an emissive object event along a light transport path. More... | |
void | MoveLight (RixShadingContext const *sCtx, int sCtxIndex, RtColorRGB const &thruput, RtColorRGB const *lightTrans, bool firstContribution, RixLPEToken lgtLpeToken) |
Call this method at a light event along a light transport path. More... | |
void | MoveVertex (RixShadingContext const *sCtx, int sCtxIndex, RixLPEScatterEvent const scatterEvent, RixLPEToken lpeGroupId=RixLPE::k_BLANK) |
Invoke this method at an intermediate (non-camera/non-light) scattering event along a light transport path. More... | |
void | MoveVertex (RixShadingContext const *sCtx, int sCtxIndex, RixLPEScatterEvent const scatterEvent, const RtColorRGB &thruput, RixLPEToken lpeGroupId=RixLPE::k_BLANK, bool doStateTransition=true) |
Second overload of the MoveVertex() method that accepts a path throughput and an optional argument about whether to perform a state transition. More... | |
Represents the LPE system state of a light transport path.
Generally, this class provides an API into the internal state of a particular light transport path with respect to the Light Path Expression (LPE) automata. Use the RixLPE::AllocateStates() and RixLPE:FreeStates() methods to allocate and free RixLPEState instances. Then use the MoveCamera(), MoveVertex(), MoveLight() and MoveEmissiveObject() methods of this class in order to perform state transitions at each corresponding type of light scattering event along a light transport path.
PRMAN_INLINE RixLPEState::RixLPEState | ( | RixLPEAutomata const * | automata, |
const int | nautomata | ||
) |
References Reset().
PRMAN_INLINE RixLPEState::~RixLPEState | ( | ) |
PRMAN_INLINE bool RixLPEState::Broken | ( | ) | const |
Referenced by Test().
PRMAN_INLINE const RixLPEAutomata * RixLPEState::GetAutomata | ( | int & | nautomata) | const |
PRMAN_INLINE std::vector< short > & RixLPEState::GetState | ( | ) |
Referenced by Test().
PRMAN_INLINE const std::vector< short > & RixLPEState::GetState | ( | ) | const |
PRMAN_INLINE const RtColorRGB & RixLPEState::GetThruput | ( | ) | const |
PRMAN_INLINE void RixLPEState::MoveCamera | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex | ||
) |
Call this method at a camera event along a light transport path.
This is typically the first state transition along a light transport path. Pass in the shading context and the index of the shading sample in the batch.
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
References RixLPE::k_CAMERA, and RixLPE::k_NONE.
PRMAN_INLINE void RixLPEState::MoveCamera | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex, | ||
const RtColorRGB & | thruput | ||
) |
Second overload of the MoveCamera() method that accepts a path throughput.
This is typically the first state transition along a light transport path. Pass in the shading context, the index of the shading sample in the batch and the path throughput.
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
thruput | The current path throughput at this scattering event. |
References RixLPE::k_CAMERA, and RixLPE::k_NONE.
PRMAN_INLINE void RixLPEState::MoveEmissiveObject | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex, | ||
RtColorRGB const & | thruput, | ||
RixLPEToken | lpeGroupId = RixLPE::k_BLANK |
||
) |
Call this method at an emissive object event along a light transport path.
This is typically the last state transition along a light transport path. Pass in the shading context, the index of the shading sample in the batch, the path throughput, and a token identifying the LPE group.
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
thruput | The current path throughput at this scattering event |
lpeGroupId | A RixLPEToken identifying the LPE group of the emissive geometry. |
References RixLPE::k_NONE, and RixLPE::k_OBJECT.
PRMAN_INLINE void RixLPEState::MoveLight | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex, | ||
RtColorRGB const & | thruput, | ||
RtColorRGB const * | lightTrans, | ||
bool | firstContribution, | ||
RixLPEToken | lgtLpeToken | ||
) |
Call this method at a light event along a light transport path.
This is typically the last state transition along a light transport path. Pass in the shading context, the index of the shading sample in the batch, the path throughput, the transmission to the light, and a token identifying the light in the LPE subsystem.
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
thruput | The current path throughput at this scattering event |
lightTrans | The amount of illumination transmission to the light |
firstContribution | [Deprecated/unused] |
lgtLpeToken | A RixLPEToken identifying the light |
References RixLPE::k_LIGHT, and RixLPE::k_NONE.
PRMAN_INLINE void RixLPEState::MoveVertex | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex, | ||
RixLPEScatterEvent const | scatterEvent, | ||
RixLPEToken | lpeGroupId = RixLPE::k_BLANK |
||
) |
Invoke this method at an intermediate (non-camera/non-light) scattering event along a light transport path.
When light scatters along a light transport path, call this method to transition the state in the LPE automata. This method is intended to be invoked for intermediate light scattering events after MoveCamera() has transitioned out of the camera, and before the light path arrives at the light source (e.g., before MoveLight() / MoveEmissiveObject() are invoked).
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
scatterEvent | A RixLPEScatterEvent instance describing the event |
lpeGroupId | A RixLPEToken identifying the LPE group |
References RixLPEScatterEvent::GetEvent(), RixLPEScatterEvent::GetScatt(), and RixLPEScatterEvent::GetValid().
PRMAN_INLINE void RixLPEState::MoveVertex | ( | RixShadingContext const * | sCtx, |
int | sCtxIndex, | ||
RixLPEScatterEvent const | scatterEvent, | ||
const RtColorRGB & | thruput, | ||
RixLPEToken | lpeGroupId = RixLPE::k_BLANK , |
||
bool | doStateTransition = true |
||
) |
Second overload of the MoveVertex() method that accepts a path throughput and an optional argument about whether to perform a state transition.
Invoke this overload of the MoveVertex() method in order to communicate the current path throughput to the LPE subsystem. The path throughput information can later be used to attenuate display channel outputs appropriately.
sCtx | The RixShadingContext shading state |
sCtxIndex | The index of the shading sample in shading context |
scatterEvent | A RixLPEScatterEvent instance describing the event |
thruput | The current path throughput at this scattering event |
lpeGroupId | A RixLPEToken identifying the LPE group |
doStateTransition | Whether to transit state in the automata. |
References RixLPEScatterEvent::GetEvent(), RixLPEScatterEvent::GetScatt(), and RixLPEScatterEvent::GetValid().
PRMAN_INLINE void RixLPEState::Reset | ( | ) |
Referenced by RixLPEState().
PRMAN_INLINE void RixLPEState::SetState | ( | const std::vector< short > & | state) |
Referenced by Test().
PRMAN_INLINE bool RixLPEState::Test | ( | const RixLPEToken | dir, |
const RixLPEToken | sca, | ||
const RixLPEToken | custom | ||
) |
References Broken(), GetState(), and SetState().