RenderManAPI
24.0
|
RixShadingContext is analogous to a RenderMan grid - it is a group of 1 or more points that may be shaded. More...
#include <RixShading.h>
Inherits RixContext.
Classes | |
class | Allocator |
Allocator is a utility (fully inlined) class to assist with tedious memory pool allocations. More... | |
struct | Id |
shadingCtxId is a unique identifier for this shading context. More... | |
Public Types | |
enum | BuiltinVolume { k_SSDiffusion, k_SSPathTraced } |
BuiltinVolumes are "preloaded" and initialized by the renderer. More... | |
enum | BuiltinBxdf { k_NullBxdf } |
BuiltinBxdfs can be constructed cheaply and offer a basic set of capabilities. More... | |
enum | BuiltinVar { k_P = 0, k_PRadius, k_Po, k_Nn, k_Ngn, k_Non, k_Tn, k_Vn, k_VLen, k_curvature, k_incidentRaySpread, k_incidentRayRadius, k_incidentLobeSampled, k_mpSize, k_biasR, k_biasT, k_geomShadowTermBias, k_u, k_v, k_w, k_du, k_dufp = k_du, k_dv, k_dvfp = k_dv, k_dw, k_dwfp = k_dw, k_dPdu, k_dPdv, k_dPdw, k_dPdtime, k_time, k_Id, k_Id2, k_outsideIOR, k_Oi, k_lpeState, k_launchShadingCtxId, k_motionFore, k_motionBack, k_curvatureU, k_curvatureV, k_dPcameradtime, k_wavelength, k_Naon, k_numBuiltinVars } |
enum | TransformInterpretation { k_AsPoints, k_AsVectors, k_AsNormals } |
enum | MemCategory { k_BxdfMem, k_PatternMem } |
Public Member Functions | |
bool | HasHits () const |
bool | HasMisses () const |
RixBxdf * | GetBxdf () const |
RixOpacity * | GetOpacity () const |
RixDisplacement * | GetDisplacement () const |
RixVolumeIntegrator * | GetSubsurface () const |
RixVolumeIntegrator * | GetVolume () const |
RixPostLighting * | GetPostLighting () const |
virtual bool | HasSubsurface () const =0 |
virtual RixVolumeIntegrator * | BeginSubsurface (int numRays, RtRayGeometry *rays) const =0 |
virtual void | EndSubsurface (RixVolumeIntegrator *) const =0 |
virtual bool | HasVolume (RixSCVolumeSelector) const =0 |
Support for volume integration: More... | |
virtual RixVolumeIntegrator * | BeginVolume (RixSCVolumeSelector, int numRays, RtRayGeometry *rays) const =0 |
virtual void | EndVolume (RixVolumeIntegrator *) const =0 |
RixVolumeIntegrator * | BeginIncidentVol (int numRays, RtRayGeometry *rays) const |
two convenience methods More... | |
RixVolumeIntegrator * | BeginOppositeVol (int numRays, RtRayGeometry *rays) const |
virtual std::vector< const RixShadingContext * > const * | GetOverlappingVolumes () const =0 |
Returns a list of shading contexts associated with any overlapping volumes. More... | |
virtual RixVolumeIntegrator * | GetBuiltinVolume (BuiltinVolume builtin, RixBxdfFactory *factory, void *instanceData) const =0 |
virtual void | SetupRngCtxForPattern () const =0 |
virtual RixBxdf * | GetBuiltinBxdf (BuiltinBxdf, RixBxdfFactory *) const =0 |
virtual RixDisplayServices * | GetDisplayServices (int version=1) const =0 |
Get access to the display services. More... | |
virtual void | GetBuiltinVar (BuiltinVar, int const **var) const =0 |
virtual void | GetBuiltinVar (BuiltinVar, float const **var) const =0 |
virtual void | GetBuiltinVar (BuiltinVar, RtFloat3 const **var) const =0 |
virtual void | GetBuiltinVar (BuiltinVar, RixLPEState *const **var) const =0 |
virtual void | SetBuiltinVar (BuiltinVar, float *var)=0 |
SetBuiltinVar() allows the values of any builtin variable to be overridden. More... | |
virtual void | SetBuiltinVar (BuiltinVar, RtFloat3 *var)=0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RixSCType *type, int *arraylen) const =0 |
GetPrimVar: lazily evaluates the named primitive variable. More... | |
virtual RixSCDetail | GetPrimVar (const RtUString name, float fill, float const **var, float const **radius=NULL) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtFloat2 fill, RtFloat2 const **var, float const **radius=NULL) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtFloat3 fill, RtFloat3 const **var, float const **radius=NULL) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtUString const **var) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtMatrix4x4 const &fill, RtMatrix4x4 const **var) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, float const **var, float const **dXdu, float const **dXdv) const =0 |
This variant of GetPrimVar produces uni/bi/trivariate derivatives of an arbitrary primvar across the surface measured with respect to u and v. More... | |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtFloat2 const **var, float const **dXdu, float const **dYdu, float const **dXdv, float const **dYdv) const =0 |
virtual RixSCDetail | GetPrimVar (const RtUString name, RtFloat3 const **var, float const **dXdu, float const **dYdu, float const **dZdu, float const **dXdv, float const **dYdv, float const **dZdv) const =0 |
virtual void | SetPrimVar (const RtUString name, RixSCDetail d, float *var, float *radius)=0 |
SetPrimVar: useful for changing state on mutable shading contexts for consumption by upstream pattern-graph nodes. More... | |
virtual void | SetPrimVar (const RtUString name, RixSCDetail d, RtFloat2 *var, float *radius)=0 |
virtual void | SetPrimVar (const RtUString name, RixSCDetail d, RtFloat3 *var, float *radius)=0 |
virtual void | SetPrimVar (const RtUString name, RixSCDetail d, RtUString *var)=0 |
virtual void | SetPrimVar (const RtUString name, RixSCDetail d, RtMatrix4x4 *var)=0 |
virtual bool | GetProperty (RayProperty, void const *) const |
As long as the RixIntegrator used supports the appropriate ray property query, shading plugin authors may want to query ray properties such as the ray depth or eye throughput, in order to allow for artistic control or optimization. More... | |
virtual bool | SetProperty (RayProperty, void const *) const |
virtual int | Transform (TransformInterpretation interp, const RtUString fromSpace, const RtUString toSpace, RtFloat3 *var, float *radius=NULL) const =0 |
Transform an array of RtFloat3 (and optional radius) the same size as the numPts in the RixShadingContext. More... | |
virtual int | GetTransform (const RtUString fromSpace, const RtUString toSpace, RtMatrix4x4 const **matrix, int *numMatrices) const =0 |
Return an array of matrices numPts in size that represents the transformation from "fromSpace" to "toSpace". More... | |
virtual RixShadingContext * | CreateMutableContext () const =0 |
Create a context that can be mutated (implements SetBuiltinVar) for the purposes of super sampling a pattern network. More... | |
virtual RixShadingContext const * | GetPrimaryContext () const =0 |
GetPrimaryContext returns a reference to the (immutable) primary shading context. More... | |
virtual RixIntegratorContext * | GetIntegratorContext () const =0 |
Returns a reference to the RixIntegratorContext which created this shading context. More... | |
virtual RixShadingContext const * | GetContextById (RixShadingContext::Id sCtxId) const =0 |
GetShadingContextById, given a RixShadingContext::Id, returns a reference to the shading context which has a matching Id, or NULL if no such context can be found. More... | |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, int const **result, int const *dflt=NULL, bool promoteToVarying=false) const =0 |
EvalParam. More... | |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, float const **result, float const *dflt=NULL, bool promoteToVarying=false) const =0 |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, RtColorRGB const **result, RtColorRGB const *dflt=NULL, bool promoteToVarying=false) const =0 |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, RtFloat3 const **result, RtFloat3 const *dflt=NULL, bool promoteToVarying=false) const =0 |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, RtMatrix4x4 const **result, RtMatrix4x4 const *dflt=NULL, bool promoteToVarying=false) const =0 |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, RtUString const **result, RtUString const *dflt=NULL, bool promoteToVarying=false) const =0 |
virtual RixSCDetail | EvalParam (int paramId, int arrayIndex, RixBxdfFactory **result, RixBxdfFactory *dflt=NULL, bool promoteToVarying=false) const =0 |
template<class T > | |
RixSCDetail | EvalAndCopyParam (int paramId, int arrayIndex, T **result, T const *dflt=NULL, bool promoteToVarying=false, MemCategory mcat=k_BxdfMem) const |
EvalAndCopyParam: Templated convenience routine for callers who need to modify input parameters. More... | |
virtual int | GetParamId (const RtUString name, int *paramId) const =0 |
GetParamId maps a string name to a more efficient integer reference. More... | |
virtual int | GetParamInfo (int paramId, RixSCType *type, RixSCConnectionInfo *cInfo, int *arrayLength=NULL) const =0 |
GetParamInfo returns additional detail about the parameter such as its connection status, type, and array length. More... | |
int | GetParamInfo (int paramId, RixSCType *type, bool *isConnected, int *arrayLength=NULL) const |
This version of GetParamInfo is a convenience for use-cases where a bool notion of connection is sufficient. More... | |
virtual void | GetNearestHits (int numRays, RtRayGeometry const *rays, RtHitPoint *hits, const RtUString subset=US_NULL, const RtUString excludeSubset=US_NULL, RtHitSides hitSides=k_SidesBoth) const =0 |
GetNearestHits: traces rays to determine the nearest hit in the given direction. More... | |
virtual bool | GetLightEmission (RtColorRGB *emission, int *lightGroupIds=NULL) const =0 |
GetLightEmission: returns the sampled emission associated with the shading points. More... | |
virtual void * | Allocate (size_t n, size_t size, MemCategory m) const =0 |
Allocate: fast memory allocation support from a memory pool tailored to Pattern and Bxdf plugins. More... | |
template<class T > | |
T * | New (size_t nObjs, MemCategory cat=k_BxdfMem) const |
New is a utility (fully inlined) non-virtual method to assist with tedious memory allocation tasks. More... | |
virtual RixInterface * | GetRixInterface (RixInterfaceId id) const =0 |
Get the specified interface from this context. More... | |
Public Attributes | |
struct RixShadingContext::Id | shadingCtxId |
int | numPts |
numPts is the number of shading points. More... | |
struct { | |
unsigned eyePath: 1 | |
unsigned lightPath: 1 | |
true if shading for an eye path More... | |
unsigned primaryHit: 1 | |
true if shading for a light path More... | |
unsigned missContext: 1 | |
true if shading for a first hit More... | |
unsigned reyesGrid: 1 | |
true if this context represents misses More... | |
RixSCShadingMode shadingMode | |
true if we're operating on a reyes grid this may occur in a variety of caching conditions More... | |
RixBxdf * bxdf | |
The bxdf shader is non-NULL for radiance queries and is responsible for computing light scattering. More... | |
RixOpacity * opacity | |
RixDisplacement * displacement | |
RixVolumeIntegrator * subsurface | |
RixVolumeIntegrator * volume | |
RixPostLighting * postlighting | |
} | scTraits |
shadingCtxTraits conveys a variety of (uniform) ShadingContex traits to shader and integrator. More... | |
int * | integratorCtxIndex |
integratorCtxIndex maps indices to varying ShadingContext entries to the index associated with IntegratorContext. More... | |
int * | rayId |
rayId is similar to integratorCtxIndex. More... | |
RtColorRGB * | transmission |
transmission is a per-point transmission that is associated with the ray that produced the associated hit. More... | |
RtColorRGB * | matteTransmission |
Similar to transmission but restricted to the transmittance computed solely from matte or holdout volumes. More... | |
RtColorRGB * | pointWeight |
If the shading context was created via an importance sampling method, this is the associated weight the integrator needs to multiply in. More... | |
int * | pointSampleCount |
If multiple volume samples are taken for multi scattering, the integrator needs to multiply this value in for thruput. More... | |
RtColorRGB * | opacityThroughput |
RtColorRGB * | opacity |
float * | opacityStochasticWeight |
void * | lightingServicesData |
lightingServicesData is a blind pointer private RixLightingServices data More... | |
RixLight const * | light |
RixRNG * | m_rngCtx |
Protected Member Functions | |
~RixShadingContext () override | |
virtual RixShadingContext * | BeginVolumeSampling () const =0 |
virtual RixShadingContext const * | EndVolumeSampling (const RixShadingContext *, RixBXLobeTraits const *exposeVol=NULL, int const *membership=NULL) const =0 |
Protected Attributes | |
RixRNG::SampleCtx * | m_rngSampleCtx |
Friends | |
class | RixVolumeIntegrator |
class | LightVertexCache |
RixShadingContext is analogous to a RenderMan grid - it is a group of 1 or more points that may be shaded.
The group of points usually arrive through ray traced "hits". In this case, the shading context provides geometric details through its GetPrimVar and GetBuiltinVar methods. Associated with each primvar is a varying filter size that is computed as a function of rendering conditions such as shading rate and ray differentials. The incoming positions are not guaranteed to be neighbors and so do not support requirements for computing first-differences. Rather, differential information is embodied through filter radii and these are only computable for known builtin and primitive variables.
ShadingContexts can also be produced by ray traced "misses". Now only the ray origination information is available and the class of shading activities is limited to cases where no bxdf, builtin and primitive variables are required. RixShadingContexts are comprised exclusively of hits or misses and optionally delivered across the RixIntegratorContext's GetNearestHits method.
ShadingContexts operate in a small number of modes according to the integration requirements.
Enumerator | |
---|---|
k_P | Shading position (type RtFloat3) |
k_PRadius | When raytracing, the ray footprint radius at P, otherwise the micropolygon radius (ie half mpSize) at P (type float) |
k_Po | Undisplaced P (type RtFloat3) |
k_Nn | Normalized shading normal (type RtFloat3) |
k_Ngn | Normalized geometric normal (type RtFloat3) |
k_Non | Normalized undisplaced N (type RtFloat3) |
k_Tn | Normalized shading tangent (type RtFloat3) |
k_Vn | Normalized view vector, points away from shading points (type RtFloat3) |
k_VLen | Length of view vector (type float) |
k_curvature | Local mean surface curvature (type float) |
k_incidentRaySpread | Spread of incident ray (type float): how much the ray radius increased for each unit distance the ray travelled. |
k_incidentRayRadius | Radius of incident ray at P (type float) |
k_incidentLobeSampled | RixBXLobeSampled id of incident rays (type int) |
k_mpSize | Micropolygon size; 0 for non-tessellated surfaces (type float) |
k_biasR | Bias to apply for reflected rays (type float) |
k_biasT | Bias to apply for transmitted rays (type float) |
k_geomShadowTermBias | Bias to apply for shadow rays (Direct Light) to avoid the geometric shadow terminator. |
k_u | Surface U parameterization (type float) |
k_v | Surface V parameterization (type float) |
k_w | Surface W parameterization (type float) |
k_du | Ray footprint (radius) in U (type float) |
k_dufp | |
k_dv | Ray footprint (radius) in V (type float) |
k_dvfp | |
k_dw | Ray footprint (radius) in W (type float) |
k_dwfp | |
k_dPdu | Surface derivative in U (type RtFloat3) |
k_dPdv | Surface derivative in V (type RtFloat3) |
k_dPdw | Surface derivative in W (type RtFloat3) |
k_dPdtime | Instantaneous P velocity relative to the world (type RtFloat3) |
k_time | Shading time, normalized between shutter open and close (type float) |
k_Id | Attribute "identifier" "id" (type int) |
k_Id2 | Attribute "identifier" "id2" (type int) |
k_outsideIOR | Incident index of refraction (type float) |
k_Oi | Opacity (type RtFloat3) |
k_lpeState | Current LPE State (type RixLPEState) |
k_launchShadingCtxId | Parent ray shading context serialization (type int) |
k_motionFore | Forward 2D raster-space motion vector (type RtFloat3) |
k_motionBack | Backward 2D raster-space motion vector (type RtFloat3) |
k_curvatureU | Local principal surface curvature in u dir (type float) |
k_curvatureV | Local principal surface curvature in v dir (type float) |
k_dPcameradtime | Instantaneous P velocity relative to the camera (type RtFloat3) |
k_wavelength | Wavelength of incident ray (type float): 380-780nm visible spectrum. |
k_Naon | Normalized analytical undisplaced N (type RtFloat3) |
k_numBuiltinVars |
|
inlineoverrideprotected |
|
pure virtual |
Allocate: fast memory allocation support from a memory pool tailored to Pattern and Bxdf plugins.
Memory allocated via this interface is managed (freed) by RixShadingContext according to the lifetime requirements of the associated MemCategory. As with many custom memory allocation schemes, clients should use "placement new" and not rely on invocation of a destructor. RixAlloca can be used for intra-procedure dynamic memory allocation.
Referenced by RixShadingContext::Allocator::Allocate(), RixShadingContext::Allocator::AllocFor(), RixShadingContext::Allocator::AllocForBxdf(), RixShadingContext::Allocator::AllocForPattern(), RixShadingContext::Allocator::AllocForVolume(), EvalAndCopyParam(), and New().
|
inline |
two convenience methods
References BeginVolume(), and k_RixSCIncidentVolume.
|
inline |
References BeginVolume(), and k_RixSCOppositeVolume.
|
pure virtual |
|
pure virtual |
Referenced by BeginIncidentVol(), and BeginOppositeVol().
|
protectedpure virtual |
Referenced by RixVolumeIntegrator::BeginVolumeSampling().
|
pure virtual |
Create a context that can be mutated (implements SetBuiltinVar) for the purposes of super sampling a pattern network.
The mutable context is created in the Bxdf memory of its parent context and does not need to be released. It will be automatically reclaimed when its parent context is released.
|
pure virtual |
|
pure virtual |
|
protectedpure virtual |
Referenced by RixVolumeIntegrator::EndVolumeSampling().
|
inline |
EvalAndCopyParam: Templated convenience routine for callers who need to modify input parameters.
Use with care as it incurs an additional memory allocation and memcpy. NB: only a subset of types produce meaningfully writable results. RtUStrings, RixBxdfFactory are not among them.
References Allocate(), EvalParam(), k_RixSCUniform, and k_RixSCVarying.
|
pure virtual |
EvalParam.
Id-based parameter evaluation captures the data flow through graph of connected RixPattern and RixBxdf nodes.
A parameter can be constant or computed. Calls to the Eval method of non-constant parameters may trigger function evaluation. Parameter values may be cached by the renderer for the duration of an execution context (see RixBxdf Begin/End).
Calls to EvalParam must fill an entire ShadingContext of values. The exception to this rule is for RixBxdf composition where a RixBxdf may be obtained. In that case, the 'driver' Bxdf is expected to distribute Begin/Eval/Generate/End messages to subservient Bxdf instances.
Parameter evaluation: Bxdfs and Patterns invoke EvalParam to sample their inputs. Since inputs may or may not obtain values from upstream, the detail, obtained via GetParamInfo, can be consulted to hoist expensive computations out of per-point loops. Again, caller is expected to know the type of its parameters. If the optional EvalParam parameter, promoteToVarying is true, then the detail of the result is guaranteed to be k_RixSCVarying but the returned detail will be that associated with the actual connection state. EvalParam works for array elements as well as simple parameters. In the simple-case, set arrayIndex to -1. Result is const and should usually not be overwritten by by caller.. It's common for Bxdf's to wish to conform (clamp) their inputs to reasonable ranges and this can be done only in bxdf nodes and only by const_cast-ing. If a value can't be obtained via the network nor the Ri parameterlist, we fill the result with the default value provided. If the default value isn't provided we return RixSCInvalidDetail.
Referenced by EvalAndCopyParam(), RixShadingParam::InitEvalC(), RixShadingParam::InitEvalF(), RixShadingParam::InitEvalI(), and RixShadingParam::InitEvalV().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Referenced by RixIntegrator::IntegrateRays(), RixBump(), RixFresnelDielectric(), RixShiftCtxInU(), and RixShiftCtxInV().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
References k_RixSCBakeIntegratorQuery, k_RixSCBakePatternQuery, k_RixSCScatterQuery, k_RixSCVolumeScatterQuery, k_RixSCVolumeTransmissionQuery, and scTraits.
Referenced by PxrGeoAOV::Splat().
|
pure virtual |
GetShadingContextById, given a RixShadingContext::Id, returns a reference to the shading context which has a matching Id, or NULL if no such context can be found.
It is the responsibility of the integrator and the caller to ensure that the shading context has not been returned to the system via RixIntegratorContext::ReleaseShadingContexts.
|
inline |
References k_RixSCDisplacementQuery, and scTraits.
|
pure virtual |
Get access to the display services.
This is the same display service normally offered by the integrator context but is provided here to allow RixPatterns and RixBXDFs to bypass the integrator and write directly into AOV channels for special effects.
|
pure virtual |
Returns a reference to the RixIntegratorContext which created this shading context.
|
pure virtual |
GetLightEmission: returns the sampled emission associated with the shading points.
Nonzero return values are only expected if the shading context is asssociated with a direct light source. This should not be confused with the results of the LocalEmission of a Bxdf, but might overlap as with PxrLightEmission.
|
pure virtual |
GetNearestHits: traces rays to determine the nearest hit in the given direction.
Both arrays must be at least numRays long. Misses are indicated in the RtHitPoint via hits[i].dist == 0. An optional trace subset can be provided to further constrain objects considered. Clients should include RixIntegrator.h for the definition of RtRayGeometry and RtHitPoint structs.
[in] | numRays | Number of rays to trace. Cannot be larger than RixIntegratorContext::k_MaxRaysPerBatch. |
[in] | rays | The rays to trace. Array of size numRays . |
[out] | hits | Resulting ray hits from tracing rays. |
[in] | subset | The method will only yield hits on objects whose group membership matches subset . |
[in] | excludeSubset | The method will ignore hits on objects whose group membership matches excludeSubset . |
[in] | hitSides | The method will only yields hits on the indicated side of objects. |
|
inline |
References k_RixSCOpacityQuery, k_RixSCPresenceQuery, k_RixSCVolumeTransmissionQuery, and scTraits.
|
pure virtual |
Returns a list of shading contexts associated with any overlapping volumes.
|
pure virtual |
GetParamId maps a string name to a more efficient integer reference.
The paramId may be negative to support dynamic inputs. Non-negative values are indices into the parameter table, while negative values are interpretted as indices into the parameterlist of a RIB instance. Returns 0 on success, returns nonzero if named parameter is not found.
|
pure virtual |
GetParamInfo returns additional detail about the parameter such as its connection status, type, and array length.
Its primary use is during pattern-graph execution to determine connectivity or dynamic array sizes. Returns 0 on success, nonzero on failure.
Referenced by GetParamInfo().
|
inline |
This version of GetParamInfo is a convenience for use-cases where a bool notion of connection is sufficient.
References GetParamInfo(), and k_RixSCNetworkValue.
|
inline |
References k_RixSCBakeIntegratorQuery, k_RixSCBakeQuery, k_RixSCScatterQuery, k_RixSCVolumeScatterQuery, and scTraits.
|
pure virtual |
GetPrimaryContext returns a reference to the (immutable) primary shading context.
Only in a case where the caller is operating on a mutable context created by a downstream node should the returned value differ from the invoking ShadingContext.
|
pure virtual |
GetPrimVar: lazily evaluates the named primitive variable.
Caller is expected to know the datatype in advance and invoke the correct variant. The first variant can be used to efficiently query the existence, type and arrayLength of an primvar. The optional radius parameter is filled with an approximate isotropic filter radius associated with the projected ray differentials of each shading point. If the primvar cannot be found, the return value is initialized with the fill value and the return value is k_RixSCInvalidDetail.
Referenced by RixBump().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
This variant of GetPrimVar produces uni/bi/trivariate derivatives of an arbitrary primvar across the surface measured with respect to u and v.
This function is useful in unusual geometric supersampling conditions and for bump mapping. The simpler variant is preferred over this method unless the special features are required.
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
As long as the RixIntegrator used supports the appropriate ray property query, shading plugin authors may want to query ray properties such as the ray depth or eye throughput, in order to allow for artistic control or optimization.
For instance, as an optimization a RixBxdf may want to skip the evaluation of a particularly expensive lobe, if the current ray depth of the hit point is beyond some arbitrary threshold. This service is provided by GetProperty(). Callers of this routine are responsible for allocating and deallocating the result memory. The integrator is responsible for filling in the result.
Referenced by PxrGeoAOV::Splat().
|
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().
|
inline |
References k_RixSCScatterQuery, k_RixSCVolumeScatterQuery, k_RixSCVolumeTransmissionQuery, and scTraits.
|
pure virtual |
Return an array of matrices numPts in size that represents the transformation from "fromSpace" to "toSpace".
If the transformation is time varying, the numMatrices returned will be the same as numPts in the RixShadingContext. If the transformation is uniform, numMatrices will be set to 1. Zero is returned on success. If fromSpace
or toSpace
is US_NULL or an empty string, "current"
is used instead.
|
inline |
|
inline |
References scTraits.
Referenced by PxrGeoAOV::Splat().
|
inline |
References scTraits.
|
pure virtual |
|
pure virtual |
Support for volume integration:
Begin/EndVolume: can be called by primary integrators to acquire a volume integrator for the selected volume subset (incident or opposite). Depending on the ray path and the requirements of the volume integrator itself, the resulting volume integrator may be bound to a different shading context that was associated with the originating rays. For this reason the incoming ray geometries must be non-const, their shadingCtxIndex may change.
|
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().
|
pure virtual |
SetBuiltinVar() allows the values of any builtin variable to be overridden.
However, for normal shading contexts, SetBuiltinVar() is a no-op. Shaders that wish to change the values of builtin variables must operate on a mutable shading context.
The caller is responsible for providing a pointer to memory allocated with a full RixShadingContext::numPts worth of allocation. This memory will subsequently be owned by the RixShadingContext, and therefore should be allocated using the RixShadingContext's own memory allocation methods (i.e. Allocate()) using the appropriate hint for Bxdf memory duration.
Normally, a shader that alters any single builtin variable is responsible for ensuring that all other builtin variables are also updated appropriately. As a special exception to this, any alteration of the builtin variables u, v, or w by a surface shader will automatically trigger recomputation of P, dPdu, dPdv, and Nn to reflect the updated values of u, v, w, as well as any other builtins that are derived from those values. All other built-in variables will be flushed from the cache and recomputed as necessary. For volume shading, any alteration of P will automatically trigger recomputation of all built-in variables derived from P.
Referenced by RixShiftCtxInU(), and RixShiftCtxInV().
|
pure virtual |
|
pure virtual |
SetPrimVar: useful for changing state on mutable shading contexts for consumption by upstream pattern-graph nodes.
However, for normal shading contexts, SetPrimVar() is a no-op. Shaders that wish to change the values of builtin variables must operate on a mutable shading context. The caller is responsible for providing a pointer to memory allocated with a full RixShadingContext::numPts worth of allocation. This memory will subsequently be owned by the RixShadingContext, and therefore should be allocated using the RixShadingContext's own memory allocation methods (i.e. Allocate()) using the appropriate hint for Bxdf memory duration.
Unlike GetPrimVar(), SetPrimVar() allows for the creation of primitive variables that are not specified in the original geometry description.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
|
pure virtual |
|
pure virtual |
Transform an array of RtFloat3 (and optional radius) the same size as the numPts in the RixShadingContext.
The type of transformation is specified with TransformInterpretation. If fromSpace
or toSpace
is US_NULL or an empty string, "current"
is used instead. If the call is successful it will return 0.
|
friend |
|
friend |
RixBxdf* RixShadingContext::bxdf |
The bxdf shader is non-NULL for radiance queries and is responsible for computing light scattering.
RixDisplacement* RixShadingContext::displacement |
unsigned RixShadingContext::eyePath |
int* RixShadingContext::integratorCtxIndex |
integratorCtxIndex maps indices to varying ShadingContext entries to the index associated with IntegratorContext.
The ith element of our integratorCtxIndex tells us the index of the associated primaryRay and other subsidiary channels. The integratorCtxIndex is critical for proper integrator functionality and should be considered "opaque" to the Bxdf.
Referenced by RtRayGeometry::InitOrigination(), RtRayGeometry::InitTransmitOrigination(), and RixIntegrator::IntegrateRays().
RixLight const* RixShadingContext::light |
|
mutable |
lightingServicesData is a blind pointer private RixLightingServices data
unsigned RixShadingContext::lightPath |
true if shading for an eye path
|
mutable |
|
mutableprotected |
RtColorRGB* RixShadingContext::matteTransmission |
Similar to transmission but restricted to the transmittance computed solely from matte or holdout volumes.
unsigned RixShadingContext::missContext |
true if shading for a first hit
int RixShadingContext::numPts |
numPts is the number of shading points.
All other non-uniform values can be assumed to have this length.
Referenced by RixIntegrator::IntegrateRays(), RixBump(), RixFresnelDielectric(), RixShiftCtxInU(), RixShiftCtxInV(), and PxrGeoAOV::Splat().
RixOpacity* RixShadingContext::opacity |
RtColorRGB* RixShadingContext::opacity |
float* RixShadingContext::opacityStochasticWeight |
RtColorRGB* RixShadingContext::opacityThroughput |
int* RixShadingContext::pointSampleCount |
If multiple volume samples are taken for multi scattering, the integrator needs to multiply this value in for thruput.
RtColorRGB* RixShadingContext::pointWeight |
If the shading context was created via an importance sampling method, this is the associated weight the integrator needs to multiply in.
RixPostLighting* RixShadingContext::postlighting |
unsigned RixShadingContext::primaryHit |
true if shading for a light path
int* RixShadingContext::rayId |
rayId is similar to integratorCtxIndex.
This array can be used by integrators to track a correspondence between the ShadingContext entries and integrator-specific data structures. The rayId may be critical for proper functionality of a given integrator and should be considered "opaque" to the Bxdf.
unsigned RixShadingContext::reyesGrid |
true if this context represents misses
struct { ... } RixShadingContext::scTraits |
shadingCtxTraits conveys a variety of (uniform) ShadingContex traits to shader and integrator.
Referenced by GetBxdf(), GetDisplacement(), GetOpacity(), GetPostLighting(), GetSubsurface(), GetVolume(), HasHits(), and HasMisses().
struct RixShadingContext::Id RixShadingContext::shadingCtxId |
Referenced by RtRayGeometry::InitOrigination(), and RtRayGeometry::InitTransmitOrigination().
RixSCShadingMode RixShadingContext::shadingMode |
true if we're operating on a reyes grid this may occur in a variety of caching conditions
shadingMode contains the current mode of operation associated with this shading context.
RixVolumeIntegrator* RixShadingContext::subsurface |
RtColorRGB* RixShadingContext::transmission |
transmission is a per-point transmission that is associated with the ray that produced the associated hit.
It's used by interiors and volumes to "occlude" the results of the radiance computation of each point.
RixVolumeIntegrator* RixShadingContext::volume |