RenderManAPI  24.0
RixLightFilterContext Class Referenceabstract

The RixLightFilterContext provides limited access to data from the shading context associated with a light filter invocation. More...

#include <RixLightFilter.h>

Inherits RixContext.

Classes

class  Allocator
 Allocator is a utility (fully inlined) class to assist with tedious memory pool allocations. More...
 

Public Member Functions

virtual bool IsEnabled (void const *instance, void **instanceData) const =0
 Determine whether or not the given instance of a light filter is active. More...
 
virtual void GetBuiltinVar (RixShadingContext::BuiltinVar, int const **var) const =0
 Retrieve built-in variables from the underlying shading context. More...
 
virtual void GetBuiltinVar (RixShadingContext::BuiltinVar, float const **var) const =0
 
virtual void GetBuiltinVar (RixShadingContext::BuiltinVar, RtFloat3 const **var) const =0
 
virtual void GetBuiltinVar (RixShadingContext::BuiltinVar, RixLPEState *const **var) const =0
 
virtual RixSCDetail GetPrimVar (RtUString const name, float fill, float const **var, float const **radius=NULL) const =0
 Retrieve primitive variables from the underlying shading context. More...
 
virtual RixSCDetail GetPrimVar (RtUString const name, RtFloat2 fill, RtFloat2 const **var, float const **radius=NULL) const =0
 
virtual RixSCDetail GetPrimVar (RtUString const name, RtFloat3 fill, RtFloat3 const **var, float const **radius=NULL) const =0
 
virtual RixSCDetail GetPrimVar (RtUString const name, RtUString const **var) const =0
 
virtual RixSCDetail GetPrimVar (RtUString const name, RtMatrix4x4 const &fill, RtMatrix4x4 const **var) const =0
 
virtual int Transform (RixShadingContext::TransformInterpretation interp, RtUString const fromSpace, RtUString const toSpace, RtFloat3 *var, float *width=NULL) const =0
 Transform an array of RtFloat3 (and optional width) the same size as the numPts in the RixLightFilterContext. More...
 
virtual int Transform (RixShadingContext::TransformInterpretation interp, RtUString const fromSpace, RtUString const toSpace, RtFloat3 const *srcVar, RtFloat3 *dstVar, float const *srcWidth, float *dstWidth) const =0
 
virtual int Transform (RixShadingContext::TransformInterpretation interp, RtUString const fromSpace, RtUString const toSpace, int numPts, int const *shadingCtxIndex, RtFloat3 const *srcVar, RtFloat3 *dstVar, float const *srcWidth, float *dstWidth) const =0
 Transform an array of RtFloat3 (and optional width) of size numPts, with a shadingCtxIndex array of that size. More...
 
virtual void * Allocate (size_t n, size_t size) const =0
 Allocate: fast memory allocation support from a memory pool tailored to light modifier plugins. More...
 
template<class T >
T * New (size_t nObjs) const
 New is a utility (fully inlined) non-virtual method to assist with tedious memory allocation tasks. More...
 
virtual RixShadingContextCreateMutableContext (RixLightFilter const *filter, void *instanceData) const =0
 Creates a mutable shading context that can be used to re-evaluate connected inputs to the lightfilter by invoking RixShadingContext::EvalParam(). More...
 
virtual void EndMutableContext (RixShadingContext *ctx) const =0
 Terminates the mutable shading context created by CreateMutableContext(). More...
 
virtual RixLightGetCurrentLight () const =0
 Get the current light associated with the context of execution. More...
 
virtual RixInterfaceGetRixInterface (RixInterfaceId id) const =0
 Get the specified interface from this context. More...
 

Public Attributes

int numPts
 

Protected Member Functions

 ~RixLightFilterContext () override
 

Detailed Description

The RixLightFilterContext provides limited access to data from the shading context associated with a light filter invocation.

Pattern generation is not supported (EvalParam is not present). Primvars and built-in vars may be accessed and transformed. The shadingCtxIndex parameter to Filter() should be used to index into these arrays retrieved from the light filter context. A special form of the Transform() call (which takes the shadingCtxIndex) is provided that does this indexing automatically.

Constructor & Destructor Documentation

◆ ~RixLightFilterContext()

RixLightFilterContext::~RixLightFilterContext ( )
inlineoverrideprotected

Member Function Documentation

◆ Allocate()

virtual void* RixLightFilterContext::Allocate ( size_t  n,
size_t  size 
) const
pure virtual

Allocate: fast memory allocation support from a memory pool tailored to light modifier plugins.

Memory allocated via this interface is managed (freed) by RixLightFilterContext according to the "bxdf" lifetime of the shading context of the pointd be lit. As with many custom memory allocation schemes, clients should

Referenced by RixLightFilterContext::Allocator::Allocate(), and New().

◆ CreateMutableContext()

virtual RixShadingContext* RixLightFilterContext::CreateMutableContext ( RixLightFilter const *  filter,
void *  instanceData 
) const
pure virtual

Creates a mutable shading context that can be used to re-evaluate connected inputs to the lightfilter by invoking RixShadingContext::EvalParam().

This is typically done after changing builtins of the shading context with RixShadingContext::SetBuiltinVar(). The filter and instanceData inputs must be those associated with the lightfilter associated with the inputs. The shading context returned by this method must be terminated with a call to EndMutableContext().

Patterns that execute as a result of EvalParam() calls on this mutable shading context will execute with object space being the space of the geometry to which the lightfilter is bound, not the space of the lightfilter itself, because the lightfilter transform is only available via the RixLightFilterContext::Transform() methods - which aren't available to the upstream patterns.

◆ EndMutableContext()

virtual void RixLightFilterContext::EndMutableContext ( RixShadingContext ctx) const
pure virtual

Terminates the mutable shading context created by CreateMutableContext().

◆ GetBuiltinVar() [1/4]

virtual void RixLightFilterContext::GetBuiltinVar ( RixShadingContext::BuiltinVar  ,
int const **  var 
) const
pure virtual

Retrieve built-in variables from the underlying shading context.

◆ GetBuiltinVar() [2/4]

virtual void RixLightFilterContext::GetBuiltinVar ( RixShadingContext::BuiltinVar  ,
float const **  var 
) const
pure virtual

◆ GetBuiltinVar() [3/4]

virtual void RixLightFilterContext::GetBuiltinVar ( RixShadingContext::BuiltinVar  ,
RtFloat3 const **  var 
) const
pure virtual

◆ GetBuiltinVar() [4/4]

virtual void RixLightFilterContext::GetBuiltinVar ( RixShadingContext::BuiltinVar  ,
RixLPEState *const **  var 
) const
pure virtual

◆ GetCurrentLight()

virtual RixLight* RixLightFilterContext::GetCurrentLight ( ) const
pure virtual

Get the current light associated with the context of execution.

◆ GetPrimVar() [1/5]

virtual RixSCDetail RixLightFilterContext::GetPrimVar ( RtUString const  name,
float  fill,
float const **  var,
float const **  radius = NULL 
) const
pure virtual

Retrieve primitive variables from the underlying shading context.

◆ GetPrimVar() [2/5]

virtual RixSCDetail RixLightFilterContext::GetPrimVar ( RtUString const  name,
RtFloat2  fill,
RtFloat2 const **  var,
float const **  radius = NULL 
) const
pure virtual

◆ GetPrimVar() [3/5]

virtual RixSCDetail RixLightFilterContext::GetPrimVar ( RtUString const  name,
RtFloat3  fill,
RtFloat3 const **  var,
float const **  radius = NULL 
) const
pure virtual

◆ GetPrimVar() [4/5]

virtual RixSCDetail RixLightFilterContext::GetPrimVar ( RtUString const  name,
RtUString const **  var 
) const
pure virtual

◆ GetPrimVar() [5/5]

virtual RixSCDetail RixLightFilterContext::GetPrimVar ( RtUString const  name,
RtMatrix4x4 const &  fill,
RtMatrix4x4 const **  var 
) const
pure virtual

◆ GetRixInterface()

virtual RixInterface* RixContext::GetRixInterface ( RixInterfaceId  id) const
pure virtualinherited

Get the specified interface from this context.

The generic interface that is returned must be cast to the appropriate type before use.

Referenced by PxrGeoAOV::disableIntegratorAOVs(), RixIES::ReadIESProfile(), RixBXLookupLobeByName(), RixDebugBasis(), RixGetSceneColorSpace(), RixIsHoldout(), and RixIsMatte().

◆ IsEnabled()

virtual bool RixLightFilterContext::IsEnabled ( void const *  instance,
void **  instanceData 
) const
pure virtual

Determine whether or not the given instance of a light filter is active.

If it is, the corresponding instanceData pointer is returned.

◆ New()

template<class T >
T* RixLightFilterContext::New ( size_t  nObjs) const
inline

New is a utility (fully inlined) non-virtual method to assist with tedious memory allocation tasks.

Note that class-constructor methods may be run on array entries. This cost should be carefully considered for high performance requirements.

References Allocate().

◆ Transform() [1/3]

virtual int RixLightFilterContext::Transform ( RixShadingContext::TransformInterpretation  interp,
RtUString const  fromSpace,
RtUString const  toSpace,
RtFloat3 var,
float *  width = NULL 
) const
pure virtual

Transform an array of RtFloat3 (and optional width) the same size as the numPts in the RixLightFilterContext.

The type of transformation is specified with TransformInterpretation. If the call is successful it will return 0.

◆ Transform() [2/3]

virtual int RixLightFilterContext::Transform ( RixShadingContext::TransformInterpretation  interp,
RtUString const  fromSpace,
RtUString const  toSpace,
RtFloat3 const *  srcVar,
RtFloat3 dstVar,
float const *  srcWidth,
float *  dstWidth 
) const
pure virtual

◆ Transform() [3/3]

virtual int RixLightFilterContext::Transform ( RixShadingContext::TransformInterpretation  interp,
RtUString const  fromSpace,
RtUString const  toSpace,
int  numPts,
int const *  shadingCtxIndex,
RtFloat3 const *  srcVar,
RtFloat3 dstVar,
float const *  srcWidth,
float *  dstWidth 
) const
pure virtual

Transform an array of RtFloat3 (and optional width) of size numPts, with a shadingCtxIndex array of that size.

The type of transformation is specified with TransformInterpretation. The RtFloat3 in the from space are read from the numPts long srcVar array and are written to the dstVar array. Both pointers can point to the same location, so an in-place operation is allowed. If the call is successful it will return 0.

Member Data Documentation

◆ numPts

int RixLightFilterContext::numPts

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