RenderManAPI  24.0
RixIntegratorContext Class Referenceabstract

#include <RixIntegrator.h>

Inherits RixContext.

Public Types

enum  NearestHitFlags {
  k_None = 0, k_Primary = 1, k_IncludeMisses = 2, k_ConstrainToVolume = 4,
  k_ContinuationOpacity = 8, k_SkipVolumes = 0x10
}
 
enum  MemCategory { k_IntegratorMem }
 Allocate() and New() are utility (fully inlined and templated) methods to assist with memory management tasks associated with the memory pool of the RixIntegratorContext. More...
 

Public Member Functions

virtual RixDisplayServicesGetDisplayServices (int version=1) const =0
 
virtual RixLightingServicesGetLightingServices (int version=1) const =0
 
virtual RixVolumeServicesGetVolumeServices (int version=1) const =0
 
virtual RixRefCntPtr< RixLPEGetRixLPE (int version=1) const =0
 
virtual RixIntegratorEnvironment const & GetEnv (int version=1) const =0
 
virtual void GetNearestHits (int nRays, RtRayGeometry const *rays, RixBXLobeTraits const &lobesWanted, RtRayGeometry::RayType rayType, int nearestHitFlags, RtUString const subset, RtUString const excludeSubset, RtHitSides hitSides, int *numShadingCtxs, RixShadingContext const **shadingCtxs)=0
 This version of GetNearestHits() returns ray hits in the form of a list of RixShadingContext. More...
 
virtual void GetNearestHits (int nRays, RtRayGeometry const *rays, RtRayGeometry::RayType rayType, int nearestHitFlags, RtUString const subset, RtUString const excludeSubset, RtHitSides hitSides, RtHitPoint *hits)=0
 This version of GetNearestHits() returns ray hits in the form of a list of RtHitPoint. More...
 
virtual void GetNearestHits (int nRays, RtRayGeometry const *rays, RixBXLobeTraits const &lobesWanted, bool wantsMisses, int *numShadingCtxs, RixShadingContext const **shadingCtxs, RtUString const subset=US_NULL, RtUString const excludeSubset=US_NULL, bool isLightPath=false, RtHitSides hitSides=k_SidesBoth, bool isPrimary=false, bool isVolume=false, bool stochasticMode=true)
 
virtual void GetNearestHits (int nRays, RtRayGeometry const *rays, RtHitPoint *hits, RtUString const subset=US_NULL, RtUString const excludeSubset=US_NULL, RtHitSides hitSides=k_SidesBoth, bool isPrimary=false, bool isVolume=false, bool stochasticMode=true)
 
virtual void GetTransmission (int nRays, RtRayGeometry const *rays, RtColorRGB *transmissions, RtColorRGB *volumeEmissions, RtUString const subset=US_NULL, RtUString const excludeSubset=US_NULL)=0
 GetTransmission() can be invoked by an integrator to compute the transmittance between two points in space. More...
 
virtual void ReleaseShadingContexts (int numShadingCtxs, RixShadingContext const **shadingCtxs)=0
 ReleaseShadingContexts() must be called to release the shading contexts created via GetNearestHits(). More...
 
virtual void * Allocate (size_t nObjs, size_t objSize, MemCategory)=0
 
template<class T >
T * Allocate (size_t nObjs)
 
template<class T >
T * New (size_t nObjs)
 
virtual RixInterfaceGetRixInterface (RixInterfaceId id) const =0
 Get the specified interface from this context. More...
 

Public Attributes

int integratorCtxId
 
int numRays
 Unique identifier for integrator context. More...
 
int numActiveRays
 Size of the primaryRays array. More...
 
RtRayGeometryprimaryRays
 The primary camera rays. More...
 
RixRNGrngCtx
 A pointer to single RixRNG object, properly configured for numRays samples. More...
 
float * time
 Shutter-normalized times associated with each ray. More...
 

Protected Member Functions

 ~RixIntegratorContext () override
 

Member Enumeration Documentation

◆ MemCategory

Allocate() and New() are utility (fully inlined and templated) methods to assist with memory management tasks associated with the memory pool of the RixIntegratorContext.

Use Allocate() for raw allocations, New() for allocations with default construction.

Usage: RtColorRGB *result = iCtx->Allocate<RtColorRGB>(100);

Enumerator
k_IntegratorMem 

◆ NearestHitFlags

Enumerator
k_None 
k_Primary 

Indicate if the ray should be considered as a primary ray or a continuation of one, uninterrupted from the camera or a light source.

k_IncludeMisses 

Indicates if the caller wants the method to return 'empty' shading contexts for ray misses.

k_ConstrainToVolume 

Indicates if the rays should not hit anything beyond the local volume.

k_ContinuationOpacity 

Rays should continue as continuations through semi-opaque surfaces rather than stochastically terminating.

k_SkipVolumes 

Indicates if the rays should not hit any volumes.

Constructor & Destructor Documentation

◆ ~RixIntegratorContext()

RixIntegratorContext::~RixIntegratorContext ( )
inlineoverrideprotected

Member Function Documentation

◆ Allocate() [1/2]

virtual void* RixIntegratorContext::Allocate ( size_t  nObjs,
size_t  objSize,
MemCategory   
)
pure virtual

Referenced by Allocate(), and New().

◆ Allocate() [2/2]

template<class T >
T* RixIntegratorContext::Allocate ( size_t  nObjs)
inline

References Allocate(), and k_IntegratorMem.

◆ GetDisplayServices()

virtual RixDisplayServices* RixIntegratorContext::GetDisplayServices ( int  version = 1) const
pure virtual

◆ GetEnv()

virtual RixIntegratorEnvironment const& RixIntegratorContext::GetEnv ( int  version = 1) const
pure virtual

◆ GetLightingServices()

virtual RixLightingServices* RixIntegratorContext::GetLightingServices ( int  version = 1) const
pure virtual

◆ GetNearestHits() [1/4]

virtual void RixIntegratorContext::GetNearestHits ( int  nRays,
RtRayGeometry const *  rays,
RixBXLobeTraits const &  lobesWanted,
RtRayGeometry::RayType  rayType,
int  nearestHitFlags,
RtUString const  subset,
RtUString const  excludeSubset,
RtHitSides  hitSides,
int *  numShadingCtxs,
RixShadingContext const **  shadingCtxs 
)
pure virtual

This version of GetNearestHits() returns ray hits in the form of a list of RixShadingContext.

These shading contexts represent a collection of points which have had their associated Bxdfs fully executed and set up for sample evaluation and generation. Since a Bxdf evaluation may trigger an upstream evaluation of all input patterns, this version of the call is considered to be very expensive as it invokes full shading.

Parameters
[in]nRaysNumber of rays to trace. Cannot be larger than RixIntegratorContext::k_MaxRaysPerBatch.
[in]raysThe rays to trace. Array of size nRays.
[in]lobesWantedThe lobesWanted that will be given to RixBxdf::BeginScatter() when setting up the bxdf for the ray hits.
[in]rayTypeThe type of the ray that should be fired. Primarily used for visibility testing of the geometry.
[in]nearestHitFlags
[in]subsetThe method will only yield hits on objects whose group membership matches subset.
[in]excludeSubsetThe method will ignore hits on objects whose group membership matches excludeSubset.
[in]hitSidesThe method will only yields hits on the indicated side of objects.
[out]numShadingCtxsNumber of shading contexts effectively returned in shadingCtxs.
[out]shadingCtxsA pointer to an array of size at least 'nRays' (since it is possible each ray hit will yield a unique shading context).

Referenced by GetNearestHits(), and RixIntegrator::IntegrateRays().

◆ GetNearestHits() [2/4]

virtual void RixIntegratorContext::GetNearestHits ( int  nRays,
RtRayGeometry const *  rays,
RtRayGeometry::RayType  rayType,
int  nearestHitFlags,
RtUString const  subset,
RtUString const  excludeSubset,
RtHitSides  hitSides,
RtHitPoint hits 
)
pure virtual

This version of GetNearestHits() returns ray hits in the form of a list of RtHitPoint.

No shading contexts are set up in this routine, and only information about the geometric locale is returned. This version of the call is preferred if no shading needs to be performed, such as in the case of an occlusion-only integrator.

Parameters
[in]nRaysNumber of rays to trace. Cannot be larger than RixIntegratorContext::k_MaxRaysPerBatch.
[in]raysThe rays to trace. Array of size nRays.
[in]rayTypeThe type of the ray that should be fired. Primarily used for visibility testing of the geometry.
[in]nearestHitFlags
[in]subsetThe method will only yield hits on objects whose group membership matches subset.
[in]excludeSubsetThe method will ignore hits on objects whose group membership matches excludeSubset.
[in]hitSidesThe method will only yields hits on the indicated side of objects.
[out]hitsResulting ray hits from tracing rays.

◆ GetNearestHits() [3/4]

virtual void RixIntegratorContext::GetNearestHits ( int  nRays,
RtRayGeometry const *  rays,
RixBXLobeTraits const &  lobesWanted,
bool  wantsMisses,
int *  numShadingCtxs,
RixShadingContext const **  shadingCtxs,
RtUString const  subset = US_NULL,
RtUString const  excludeSubset = US_NULL,
bool  isLightPath = false,
RtHitSides  hitSides = k_SidesBoth,
bool  isPrimary = false,
bool  isVolume = false,
bool  stochasticMode = true 
)
inlinevirtual
Deprecated:
This version of GetNearestHits() returns ray hits in the form of a list of RixShadingContext.

These shading contexts represent a collection of points which have had their associated Bxdfs fully executed and set up for sample evaluation and generation. Since a Bxdf evaluation may trigger an upstream evaluation of all input patterns, this version of the call is considered to be very expensive as it invokes full shading.

Parameters
[in]nRaysNumber of rays to trace. Cannot be larger than RixIntegratorContext::k_MaxRaysPerBatch.
[in]raysThe rays to trace. Array of size nRays.
[in]lobesWantedThe lobesWanted that will be given to RixBxdf::BeginScatter() when setting up the bxdf for the ray hits.
[in]wantsMissesIndicates if the caller wants the method to return 'empty' shading contexts for ray misses.
[out]numShadingCtxsNumber of shading contexts effectively returned in shadingCtxs.
[out]shadingCtxsA pointer to an array of size at least 'nRays' (since it is possible each ray hit will yield a unique shading context).
[in]subsetThe method will only yield hits on objects whose group membership matches subset. Optional.
[in]excludeSubsetThe method will ignore hits on objects whose group membership matches excludeSubset. Optional.
[in]isLightPathIndicates if the rays are associated with a light path. Optional.
[in]hitSidesThe method will only yields hits on the indicated side of objects. Optional.
[in]isPrimaryIndicate if the ray should be considered as a primary ray or a continuation of one, uninterrupted from the camera or a light source
[in]isVolumeIndicates if the rays should not hit anything beyond the local volume. Optional
[in]stochasticModeOptional.

References GetNearestHits(), k_ConstrainToVolume, k_ContinuationOpacity, k_IncludeMisses, k_None, k_Primary, RtRayGeometry::k_rtCamera, RtRayGeometry::k_rtIndirect, and RtRayGeometry::k_rtLight.

◆ GetNearestHits() [4/4]

virtual void RixIntegratorContext::GetNearestHits ( int  nRays,
RtRayGeometry const *  rays,
RtHitPoint hits,
RtUString const  subset = US_NULL,
RtUString const  excludeSubset = US_NULL,
RtHitSides  hitSides = k_SidesBoth,
bool  isPrimary = false,
bool  isVolume = false,
bool  stochasticMode = true 
)
inlinevirtual
Deprecated:
This second version of GetNearestHits() returns ray hits in the form of a list of RtHitPoint.

No shading contexts are set up in this routine, and only information about the geometric locale is returned. This version of the call is preferred if no shading needs to be performed, such as in the case of an occlusion-only integrator.

References GetNearestHits(), k_ConstrainToVolume, k_ContinuationOpacity, k_None, k_Primary, RtRayGeometry::k_rtCamera, and RtRayGeometry::k_rtIndirect.

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

◆ GetRixLPE()

virtual RixRefCntPtr<RixLPE> RixIntegratorContext::GetRixLPE ( int  version = 1) const
pure virtual

◆ GetTransmission()

virtual void RixIntegratorContext::GetTransmission ( int  nRays,
RtRayGeometry const *  rays,
RtColorRGB transmissions,
RtColorRGB volumeEmissions,
RtUString const  subset = US_NULL,
RtUString const  excludeSubset = US_NULL 
)
pure virtual

GetTransmission() can be invoked by an integrator to compute the transmittance between two points in space.

This is of use for bidirectional path tracing algorithms where the transmittance between vertex connections needs to be computed. It may also be used for computing shadow rays if the lighting services cannot be used for this purpose for some reason.

RixLightingServices are able to deal with transmission rays associated with direct lighting samples (if required) so simple unidirectional path tracers may have no need for this call.

The isVolume flag can be optionally set by a volume integrator to constrain the results to the bounds of a volume.

Parameters
[in]nRaysNumber of rays to trace. Cannot be larger than RixIntegratorContext::k_MaxRaysPerBatch.
[in]raysThe rays to trace. Array of size nRays.
[out]transmissionsTransmission between each ray origin and corresponding hit point.
[out]volumeEmissionsEmission due to participating media between each ray origin and corresponding hit point.

◆ GetVolumeServices()

virtual RixVolumeServices* RixIntegratorContext::GetVolumeServices ( int  version = 1) const
pure virtual

◆ New()

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

References Allocate(), and k_IntegratorMem.

◆ ReleaseShadingContexts()

virtual void RixIntegratorContext::ReleaseShadingContexts ( int  numShadingCtxs,
RixShadingContext const **  shadingCtxs 
)
pure virtual

ReleaseShadingContexts() must be called to release the shading contexts created via GetNearestHits().

Shading contexts should not be released until after rays that originate from them have been traced.

Parameters
[in]numShadingCtxsNumber of shading contexts.
[in]shadingCtxsA pointer to an array of size 'numShadingCtxs'.

Member Data Documentation

◆ integratorCtxId

int RixIntegratorContext::integratorCtxId

◆ numActiveRays

int RixIntegratorContext::numActiveRays

Size of the primaryRays array.

May be less than numRays if the integrator sets wantsEmptyIntegrate and adaptive sampling is on. There will then be numRays rays in primaryRays, but only the first numActiveRays are considered still relevant by the adaptive sampler.

Referenced by RixIntegrator::IntegrateRays().

◆ numRays

int RixIntegratorContext::numRays

Unique identifier for integrator context.

◆ primaryRays

RtRayGeometry* RixIntegratorContext::primaryRays

The primary camera rays.

Referenced by RixIntegrator::IntegrateRays().

◆ rngCtx

RixRNG* RixIntegratorContext::rngCtx

A pointer to single RixRNG object, properly configured for numRays samples.

◆ time

float* RixIntegratorContext::time

Shutter-normalized times associated with each ray.

Array of size numRays. Values range from 0 (meaning shutter opening time) to 1 (meaning shutter closing time).


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