97 #define k_RixShadingVersion 230 // XXY (XX: MAJOR, Y:MINOR) 328 uint32_t
const editHints,
461 : name(_name), customtype(
US_NULL), type(t), access(a), arraylen(length)
467 : name(_name), customtype(structName), type(t), access(a), arraylen(length)
486 return (arraylen != -1);
520 virtual int GetNumParams()
const = 0;
528 virtual int GetParamId(
const RtUString name,
int* paramId)
const = 0;
533 virtual int GetParamId(
int plistIndex,
int* paramId)
const = 0;
541 int* arrayLength = NULL)
const = 0;
548 int err = GetParamInfo(paramId, type, &cInfo, arrayLength);
563 virtual RixSCDetail EvalParam(
int paramId,
int arrayIndex,
int* result)
const = 0;
564 virtual RixSCDetail EvalParam(
int paramId,
int arrayIndex,
float* result)
const = 0;
616 Id() : shadingCtxNum(-6666)
618 Id(
unsigned int i) : shadingCtxNum(static_cast<short>(i & 0xFFFF))
623 return shadingCtxNum;
627 shadingCtxNum = -6666;
631 return shadingCtxNum != -6666;
681 return (scTraits.missContext == 0);
685 return (scTraits.missContext == 1);
693 return scTraits.bxdf;
701 return scTraits.opacity;
707 return scTraits.displacement;
715 return scTraits.subsurface;
724 return scTraits.volume;
731 return scTraits.postlighting;
734 virtual bool HasSubsurface()
const = 0;
764 virtual std::vector<const RixShadingContext*>
const* GetOverlappingVolumes()
const = 0;
854 virtual void SetupRngCtxForPattern()
const = 0;
921 virtual void GetBuiltinVar(
BuiltinVar,
int const** var)
const = 0;
922 virtual void GetBuiltinVar(
BuiltinVar,
float const** var)
const = 0;
951 virtual void SetBuiltinVar(
BuiltinVar,
float* var) = 0;
967 float const** radius = NULL)
const = 0;
970 float const** radius = NULL)
const = 0;
973 float const** radius = NULL)
const = 0;
987 float const** dXdv)
const = 0;
990 float const** dYdu,
float const** dXdv,
991 float const** dYdv)
const = 0;
994 float const** dYdu,
float const** dZdu,
float const** dXdv,
995 float const** dYdv,
float const** dZdv)
const = 0;
1066 RtMatrix4x4 const** matrix,
int* numMatrices)
const = 0;
1128 virtual RixSCDetail EvalParam(
int paramId,
int arrayIndex,
int const** result,
1129 int const* dflt = NULL,
bool promoteToVarying =
false)
const = 0;
1131 virtual RixSCDetail EvalParam(
int paramId,
int arrayIndex,
float const** result,
1132 float const* dflt = NULL,
1133 bool promoteToVarying =
false)
const = 0;
1137 bool promoteToVarying =
false)
const = 0;
1141 bool promoteToVarying =
false)
const = 0;
1145 bool promoteToVarying =
false)
const = 0;
1149 bool promoteToVarying =
false)
const = 0;
1153 bool promoteToVarying =
false)
const = 0;
1169 bool promoteToVarying =
false,
MemCategory mcat = k_BxdfMem)
const 1171 T
const* constResult;
1172 RixSCDetail d = EvalParam(paramId, arrayIndex, &constResult, dflt);
1176 *result = (T*)Allocate(this->numPts,
sizeof(T), mcat);
1177 memcpy(*result, constResult, this->numPts *
sizeof(T));
1180 if (promoteToVarying)
1182 *result = (T*)Allocate(this->numPts,
sizeof(T), mcat);
1183 std::fill_n(*result, this->numPts, constResult[0]);
1187 *result = (T*)Allocate(1,
sizeof(T), mcat);
1188 (*result)[0] = constResult[0];
1203 virtual int GetParamId(
const RtUString name,
int* paramId)
const = 0;
1211 int* arrayLength = NULL)
const = 0;
1218 int err = GetParamInfo(paramId, type, &cInfo, arrayLength);
1245 virtual void GetNearestHits(
int numRays,
RtRayGeometry const* rays,
1258 virtual bool GetLightEmission(
RtColorRGB* emission,
int* lightGroupIds = NULL)
const = 0;
1268 virtual void* Allocate(
size_t n,
size_t size,
MemCategory m)
const = 0;
1280 T* mem =
static_cast<T*
>(Allocate(nObjs,
sizeof(T), cat));
1281 return new (mem) T[nObjs];
1300 template <
typename T>
1303 if (num == 0)
return NULL;
1304 return (T*)m_sCtx->Allocate(num,
sizeof(T), k_BxdfMem);
1306 template <
typename T>
1309 if (num == 0)
return NULL;
1310 return (T*)m_sCtx->Allocate(num,
sizeof(T), memcat);
1312 template <
typename T>
1317 if (num == 0)
return NULL;
1318 return (T*)m_sCtx->Allocate(num,
sizeof(T), k_BxdfMem);
1320 template <
typename T>
1323 if (num == 0)
return NULL;
1324 return (T*)m_sCtx->Allocate(num,
sizeof(T), k_BxdfMem);
1326 template <
typename T>
1329 if (num == 0)
return NULL;
1330 return (T*)m_sCtx->Allocate(num,
sizeof(T), k_PatternMem);
1347 friend class LightVertexCache;
1351 int const* membership = NULL)
const = 0;
unsigned reyesGrid
true if this context represents misses
RtColorRGB * transmission
Attribute "identifier" "id2" (type int)
RixPostLighting * GetPostLighting() const
PxrMeshLight emission mode.
RixShadingPlugin(int version)
Instantaneous P velocity relative to the camera (type RtFloat3)
Wavelength of incident ray (type float): 380-780nm visible spectrum.
T * AllocFor(MemCategory memcat, int num)
Micropolygon size; 0 for non-tessellated surfaces (type float)
Normalized shading tangent (type RtFloat3)
virtual ~RixParameterList()
virtual bool SetProperty(RayProperty, void const *) const
pxrcore::ColorRGB RtColorRGB
unsigned lightPath
true if shading for an eye path
PRMANAPI const RtUString k_Po
"Po"
T * AllocForVolume(int num)
virtual ~RixShadingPlugin()
int GetParamInfo(int paramId, RixSCType *type, bool *isConnected, int *arrayLength=NULL) const
Local principal surface curvature in u dir (type float)
Local principal surface curvature in v dir (type float)
RixBxdf * GetBxdf() const
Attribute "identifier" "id" (type int)
RixVolumeIntegrator * volume
unsigned primaryHit
true if shading for a light path
Ray footprint (radius) in V (type float)
void(* freefunc)(RtPointer)
Normalized shading normal (type RtFloat3)
T * AllocForPattern(int num)
RixRNG::SampleCtx * m_rngSampleCtx
T * New(size_t nObjs, MemCategory cat=k_BxdfMem) const
Instantaneous P velocity relative to the world (type RtFloat3)
RixBxdfFactory::BeginScatter mode.
RixDisplacementFactory::BeginDisplacement mode.
Normalized undisplaced N (type RtFloat3)
unsigned int Serialize() const
virtual int GetInterface() const
virtual void Synchronize(RixContext &ctx, RixSCSyncMsg syncMsg, RixParameterList const *syncParams)=0
RixSCParamInfo(RtUString const structName, RtUString const _name, RixSCType t, RixSCAccess a=k_RixSCInput, int length=-1)
Backward 2D raster-space motion vector (type RtFloat3)
PRMANAPI const RtUString k_dv
"dv"
RixVolumeIntegrator * GetVolume() const
Ray footprint (radius) in U (type float)
Surface derivative in U (type RtFloat3)
Surface derivative in W (type RtFloat3)
RixPostLighting * postlighting
Allocator(RixShadingContext const *sCtx)
Bias to apply for transmitted rays (type float)
RixSCShadingMode shadingMode
Radius of incident ray at P (type float)
RixBxdfFactory::BeginOpacity opacity mode.
RixBXLobeSampled id of incident rays (type int)
Local mean surface curvature (type float)
Forward 2D raster-space motion vector (type RtFloat3)
Normalized view vector, points away from shading points (type RtFloat3)
virtual RixSCParamInfo const * GetParamTable()=0
RtColorRGB * opacityThroughput
T * AllocForBxdf(int num)
pxrcore::UString RtUString
virtual void SynchronizeInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *instanceParams, uint32_t const editHints, InstanceData *instanceData)
Normalized analytical undisplaced N (type RtFloat3)
void * lightingServicesData
lightingServicesData is a blind pointer private RixLightingServices data
Shading time, normalized between shutter open and close (type float)
uint32_t synchronizeHints
Surface V parameterization (type float)
Parent ray shading context serialization (type int)
Ray footprint (radius) in W (type float)
virtual void CreateInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *parameterList, InstanceData *instanceData)
virtual int Init(RixContext &ctx, RtUString const pluginPath)=0
RixDisplacement * displacement
pxrcore::Matrix4x4 RtMatrix4x4
Length of view vector (type float)
void const * RtConstPointer
RixBxdfFactory::BeginInterior mode.
PRMANAPI const RtUString k_P
"P"
Surface W parameterization (type float)
int GetParamInfo(int paramId, RixSCType *type, bool *isConnected, int *arrayLength=NULL) const
Spread of incident ray (type float): how much the ray radius increased for each unit distance the ray...
Incident index of refraction (type float)
virtual bool GetProperty(RayProperty, void const *) const
Bias to apply for reflected rays (type float)
Surface U parameterization (type float)
RixBxdfFactory::BeginScatter mode.
RixVolumeIntegrator * BeginOppositeVol(int numRays, RtRayGeometry *rays) const
RixOpacity * GetOpacity() const
float * opacityStochasticWeight
RixSCParamInfo(RtUString const _name, RixSCType t, RixSCAccess a=k_RixSCInput, int length=-1)
Surface derivative in V (type RtFloat3)
RixSCParamInfo const * paramtable
Current LPE State (type RixLPEState)
RixVolumeIntegrator * GetSubsurface() const
Normalized geometric normal (type RtFloat3)
RixVolumeIntegrator * BeginIncidentVol(int numRays, RtRayGeometry *rays) const
two convenience methods
RixSCDetail EvalAndCopyParam(int paramId, int arrayIndex, T **result, T const *dflt=NULL, bool promoteToVarying=false, MemCategory mcat=k_BxdfMem) const
virtual void Finalize(RixContext &ctx)=0
RixDisplacement * GetDisplacement() const
RixBxdfFactory::BeginOpacity presence mode.
PRMANAPI const RtUString k_du
"du"
virtual ~RixShadingContext()
unsigned missContext
true if shading for a first hit
RixVolumeIntegrator * subsurface
virtual int GetVersion() const