RenderManAPI  24.0
RixLPEState Class Reference

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 RtColorRGBGetThruput () const
 
const RixLPEAutomataGetAutomata (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RixLPEState()

PRMAN_INLINE RixLPEState::RixLPEState ( RixLPEAutomata const *  automata,
const int  nautomata 
)

References Reset().

◆ ~RixLPEState()

PRMAN_INLINE RixLPEState::~RixLPEState ( )

Member Function Documentation

◆ Broken()

PRMAN_INLINE bool RixLPEState::Broken ( ) const

Referenced by Test().

◆ GetAutomata()

PRMAN_INLINE const RixLPEAutomata * RixLPEState::GetAutomata ( int &  nautomata) const

◆ GetState() [1/2]

PRMAN_INLINE std::vector< short > & RixLPEState::GetState ( )

Referenced by Test().

◆ GetState() [2/2]

PRMAN_INLINE const std::vector< short > & RixLPEState::GetState ( ) const

◆ GetThruput()

PRMAN_INLINE const RtColorRGB & RixLPEState::GetThruput ( ) const

◆ MoveCamera() [1/2]

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.

The RixShadingContext shading state The index of the shading sample in shading context

References RixLPE::k_CAMERA, RixLPE::k_NONE, and PIXAR_ARGUSED.

◆ MoveCamera() [2/2]

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.

The RixShadingContext shading state The index of the shading sample in shading context The current path throughput at this scattering event.

References RixLPE::k_CAMERA, RixLPE::k_NONE, and PIXAR_ARGUSED.

◆ MoveEmissiveObject()

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.

The RixShadingContext shading state The index of the shading sample in shading context The current path throughput at this scattering event A RixLPEToken identifying the LPE group of the emissive geometry.

References RixLPE::k_NONE, RixLPE::k_OBJECT, and PIXAR_ARGUSED.

◆ MoveLight()

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.

The RixShadingContext shading state The index of the shading sample in shading context The current path throughput at this scattering event The amount of illumination transmission to the light [Deprecated/unused] A RixLPEToken identifying the light

References RixLPE::k_LIGHT, RixLPE::k_NONE, and PIXAR_ARGUSED.

◆ MoveVertex() [1/2]

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).

The RixShadingContext shading state The index of the shading sample in shading context A RixLPEScatterEvent instance describing the event A RixLPEToken identifying the LPE group

References RixLPEScatterEvent::GetEvent(), RixLPEScatterEvent::GetScatt(), RixLPEScatterEvent::GetValid(), and PIXAR_ARGUSED.

◆ MoveVertex() [2/2]

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.

The RixShadingContext shading state The index of the shading sample in shading context A RixLPEScatterEvent instance describing the event The current path throughput at this scattering event A RixLPEToken identifying the LPE group Whether to transit state in the automata.

References RixLPEScatterEvent::GetEvent(), RixLPEScatterEvent::GetScatt(), RixLPEScatterEvent::GetValid(), and PIXAR_ARGUSED.

◆ Reset()

PRMAN_INLINE void RixLPEState::Reset ( )

Referenced by RixLPEState().

◆ SetState()

PRMAN_INLINE void RixLPEState::SetState ( const std::vector< short > &  state)

Referenced by Test().

◆ Test()

PRMAN_INLINE bool RixLPEState::Test ( const RixLPEToken  dir,
const RixLPEToken  sca,
const RixLPEToken  custom 
)

References Broken(), GetState(), and SetState().


The documentation for this class was generated from the following files: