RenderManAPI  24.0
RixShading.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef RixShading_h
38 #define RixShading_h
39 
40 #include <algorithm> // for fill_n
41 #include <cassert> // for assert
42 #include <cstddef> // for NULL, size_t
43 #include <cstring> // for memcpy
44 #include <new> // for operator new
45 #include <vector> // for vector
46 #include "RixInterfaces.h" // for RixContext
47 #include "RixRNG.h" // for random number generation
48 #include "RiTypesHelper.h" // for RtColorRGB, etc
49 
50 class RixBxdf;
51 class RixBxdfFactory;
52 class RixDisplacement;
53 class RixDisplayFilter;
54 class RixDisplayServices;
56 class RixLPEState;
57 class RixLight;
58 class RixLightFilter;
59 class RixOpacity;
60 class RixParameterList;
61 class RixPostLighting;
62 class RixSampleFilter;
64 struct RixBXLobeTraits;
65 struct RixSCParamInfo;
66 struct RtHitPoint;
67 struct RtRayGeometry;
68 
97 #define k_RixShadingVersion 240 // XXY (XX: MAJOR, Y:MINOR)
98 
100 {
104 };
105 
110 {
121 };
122 
128 {
129  // delivered in primary thread...
132  k_RixSCInstanceEdit, // Currently unused
133  k_RixSCCancel, // Currently unused
134  k_RixSCCheckpointRecover, // Restarting at "int increment"
135  // delivered by one (arbitrary) thread...
136  k_RixSCCheckpointWrite, // Writing "int increment" for "string reason" ("checkpoint",
137  // "exiting", or "finished").
138  k_RixSCIncrementBarrier, // Indicates "int increment" about to begin (only sent if
139  // wantsIncrementBarrier is true.)
140 };
141 
169 {
170 public:
171  virtual int GetVersion() const
172  {
173  return m_version;
174  }
175  virtual int GetInterface() const
176  {
177  return k_RixInvalid;
178  }
179 
190  virtual int Init(RixContext& ctx, RtUString const pluginPath) = 0;
191 
195  virtual void Finalize(RixContext& ctx) = 0;
196 
209  virtual RixSCParamInfo const* GetParamTable() = 0;
210 
215  virtual void Synchronize(RixContext& ctx, RixSCSyncMsg syncMsg,
216  RixParameterList const* syncParams) = 0;
217 
275  {
276  k_None = 0x00000000,
277  k_All = 0xFFFFFFFF
278  };
279 
281  {
283  : data(NULL),
284  datalen(0),
285  freefunc(NULL),
286  paramtable(NULL),
288  {}
289  void* data;
290  size_t datalen;
291  void (*freefunc)(void*);
294  };
295 
303  virtual void CreateInstanceData(RixContext& rixCtx, RtUString const handle,
304  RixParameterList const* parameterList,
305  InstanceData* instanceData)
306  {
307  PIXAR_ARGUSED(rixCtx);
308  PIXAR_ARGUSED(handle);
309  PIXAR_ARGUSED(parameterList);
310  PIXAR_ARGUSED(instanceData);
311  }
312 
326  virtual void SynchronizeInstanceData(RixContext& rixCtx, RtUString const handle,
327  RixParameterList const* instanceParams,
328  uint32_t const editHints,
329  InstanceData* instanceData)
330  {
331  PIXAR_ARGUSED(rixCtx);
332  PIXAR_ARGUSED(handle);
333  PIXAR_ARGUSED(instanceParams);
334  PIXAR_ARGUSED(editHints);
335  PIXAR_ARGUSED(instanceData);
336  }
337 
338 protected:
339  RixShadingPlugin(int version) : m_version(version)
340  {}
342  {}
344 };
345 
350 {
352  k_RixSCAnyType, // signals a dynamic binding scenario
363  k_RixSCBxdf, // always uniform
364  k_RixSCLightFilter, // always uniform
365  k_RixSCStructBegin, // always uniform
366  k_RixSCStructEnd, // always uniform
367  k_RixSCSampleFilter, // always uniform
368  k_RixSCDisplayFilter, // always uniform
370 };
371 
375 PRMAN_INLINE size_t
377 {
378  size_t typeSize = 0;
379  switch(type)
380  {
381  case k_RixSCInteger:
382  typeSize = sizeof(int);
383  break;
384  case k_RixSCFloat:
385  typeSize = sizeof(float);
386  break;
387  case k_RixSCFloat2:
388  typeSize = sizeof(RtFloat2);
389  break;
390  case k_RixSCFloat3:
391  typeSize = sizeof(RtFloat3);
392  break;
393  case k_RixSCColor:
394  typeSize = sizeof(RtColorRGB);
395  break;
396  case k_RixSCPoint:
397  typeSize = sizeof(RtPoint3);
398  break;
399  case k_RixSCVector:
400  typeSize = sizeof(RtVector3);
401  break;
402  case k_RixSCNormal:
403  typeSize = sizeof(RtNormal3);
404  break;
405  case k_RixSCMatrix:
406  typeSize = sizeof(RtMatrix4x4);
407  break;
408  case k_RixSCString:
409  typeSize = sizeof(RtUString);
410  break;
411  case k_RixSCBxdf:
412  case k_RixSCLightFilter:
413  case k_RixSCSampleFilter:
415  typeSize = sizeof(void*);
416  break;
417  case k_RixSCStructBegin:
418  case k_RixSCStructEnd:
419  case k_RixSCInvalidType:
420  case k_RixSCAnyType:
421  default:
422  typeSize = 0;
423  break;
424  }
425  return typeSize;
426 }
427 
433 {
435  k_RixSCUniform, // needs an eval per shading "grid"
436  k_RixSCVarying, // needs an eval per shading point
438 };
439 
454 {
455  // clang-format off
457  k_RixSCOutput = 1 << 0,
465  // use Input + output at the same time to indicate invalid
467  // clang-format on
468 };
469 
475 {
480 };
481 
487 {
491 };
492 
500 {
501  k_RayDepth, // ray depth (scattering events)
506  k_RayTrueDepth // ray depth (scattering events + volume envelopes etc.)
507 };
508 
513 {
514  // most common constructor of POD parameters.
516  int length = -1)
517  : name(_name), customtype(US_NULL), type(t), access(a), arraylen(length)
518  {}
519 
520  // full constructor
521  RixSCParamInfo(RtUString const structName, RtUString const _name, RixSCType t,
522  RixSCAccess a = k_RixSCInput, int length = -1)
523  : name(_name), customtype(structName), type(t), access(a), arraylen(length)
524  {}
525 
526  // default constructor, useful to signal end of paraminfo table
528  : name(US_NULL),
532  arraylen(-1)
533  {}
534 
536  RtUString customtype; // NULL unless struct
539  int arraylen; // -1 means no array, 0 means empty
540  bool IsArray() const
541  {
542  return (arraylen != -1);
543  }
544 };
545 
554 {
567 };
568 
576 {
577 public:
578  virtual int GetNumParams() const = 0;
579 
586  virtual int GetParamId(const RtUString name, int* paramId) const = 0;
587 
591  virtual int GetParamId(int plistIndex, int* paramId) const = 0;
592 
598  virtual int GetParamInfo(int paramId, RixSCType* type, RixSCConnectionInfo* cInfo,
599  int* arrayLength = NULL) const = 0;
600 
603  int GetParamInfo(int paramId, RixSCType* type, bool* isConnected, int* arrayLength = NULL) const
604  {
605  RixSCConnectionInfo cInfo;
606  int err = GetParamInfo(paramId, type, &cInfo, arrayLength);
607  if (isConnected) *isConnected = (cInfo == k_RixSCNetworkValue);
608  return err;
609  }
610 
621  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, int* result) const = 0;
622  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, float* result) const = 0;
623  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtColorRGB* result) const = 0;
624  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtFloat3* result) const = 0;
625  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtMatrix4x4* result) const = 0;
626  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtUString* result) const = 0;
627  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RixLightFilter** result,
628  void const** instance) const = 0;
629  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RixSampleFilter** result,
630  void const** instance) const = 0;
631  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RixDisplayFilter** result,
632  void const** instance) const = 0;
633 
634 protected:
636  {}
637 };
638 
664 {
665 public:
672  struct Id
673  {
674  Id() : shadingCtxNum(-6666)
675  {}
676  Id(unsigned int i) : shadingCtxNum(static_cast<short>(i & 0xFFFF))
677  {}
678  // Convert to a serialized integral representation.
679  unsigned int Serialize() const
680  {
681  return shadingCtxNum;
682  }
683  void Invalidate()
684  {
685  shadingCtxNum = -6666;
686  }
687  bool IsValid() const
688  {
689  return shadingCtxNum != -6666;
690  }
692  } shadingCtxId;
693 
696  int numPts;
697 
700  struct
701  {
702  // clang-format off
703  unsigned eyePath : 1;
704  unsigned lightPath : 1;
705  unsigned primaryHit : 1;
706  unsigned missContext : 1;
707  unsigned reyesGrid : 1;
708  // clang-format on
711 
715 
719 
720  // The opacity shader is non-NULL when computing presence and
721  // transmission.
723 
724  // The displacement shader is non-NULL when computing displacement
726 
727  // The subsurface shader is non-NULL when invoking subsurf. integrators
729 
730  // The volume shader is non-NULL when invoking volume integrators.
732 
733  // The postlighting shader is non-NULL when invoking postlighting
735  } scTraits; // "uniform" traits associated with the shading context
736 
737  bool HasHits() const
738  {
739  return (scTraits.missContext == 0);
740  }
741  bool HasMisses() const
742  {
743  return (scTraits.missContext == 1);
744  }
745 
746  RixBxdf* GetBxdf() const
747  {
748  assert(scTraits.shadingMode == k_RixSCScatterQuery ||
749  scTraits.shadingMode == k_RixSCVolumeScatterQuery ||
750  scTraits.shadingMode == k_RixSCVolumeTransmissionQuery ||
751  scTraits.shadingMode == k_RixSCBakePatternQuery ||
752  scTraits.shadingMode == k_RixSCBakeIntegratorQuery);
753  return scTraits.bxdf;
754  }
755 
757  {
758  assert(scTraits.shadingMode == k_RixSCOpacityQuery ||
759  scTraits.shadingMode == k_RixSCPresenceQuery ||
761  return scTraits.opacity;
762  }
763 
765  {
766  assert(scTraits.shadingMode == k_RixSCDisplacementQuery);
767  return scTraits.displacement;
768  }
769 
771  {
772  assert(scTraits.shadingMode == k_RixSCScatterQuery ||
773  scTraits.shadingMode == k_RixSCVolumeScatterQuery ||
775  return scTraits.subsurface;
776  }
777 
779  {
780  assert(scTraits.shadingMode == k_RixSCScatterQuery ||
781  scTraits.shadingMode == k_RixSCVolumeScatterQuery ||
782  scTraits.shadingMode == k_RixSCVolumeTransmissionQuery ||
783  scTraits.shadingMode == k_RixSCEmissionQuery);
784  return scTraits.volume;
785  }
786 
788  {
789  assert(scTraits.shadingMode == k_RixSCScatterQuery ||
790  scTraits.shadingMode == k_RixSCVolumeScatterQuery ||
791  scTraits.shadingMode == k_RixSCBakeQuery ||
792  scTraits.shadingMode == k_RixSCBakeIntegratorQuery);
793  return scTraits.postlighting;
794  }
795 
796  virtual bool HasSubsurface() const = 0;
797  virtual RixVolumeIntegrator* BeginSubsurface(int numRays, RtRayGeometry* rays) const = 0;
798  virtual void EndSubsurface(RixVolumeIntegrator*) const = 0;
799 
810  virtual bool HasVolume(RixSCVolumeSelector) const = 0;
812  RtRayGeometry* rays) const = 0;
813  virtual void EndVolume(RixVolumeIntegrator*) const = 0;
816  {
817  return BeginVolume(k_RixSCIncidentVolume, numRays, rays);
818  }
820  {
821  return BeginVolume(k_RixSCOppositeVolume, numRays, rays);
822  }
823 
826  virtual std::vector<const RixShadingContext*> const* GetOverlappingVolumes() const = 0;
827 
832  enum BuiltinVolume // built-in subsurface interior integrator
833  {
834  k_SSDiffusion, // sss using Burley's normalized diffusion model
835  k_SSPathTraced // sss using brute-force volume scattering
836  };
838  void* instanceData) const = 0;
839 
847 
853  int* rayId;
854 
860 
864 
868 
872 
873  // When dealing with non-fully-opaque surfaces, and when using probabilistic hit-testing, the
874  // total opacity (product of the `presence` and the `opacity` values returned by RixOpacity) can
875  // be interpreted as the probability that we actually hit the surface.
876  //
877  // When only considering a scalar presence value (i.e. opacity is one, so the total opacity is
878  // monochromatic), the hit probability is usually the inverse of the scalar presence value, and
879  // no special weighting needs to be applied to the shading on hits.
880  //
881  // However, when dealing with arbitrary (i.e. colored) total opacity, it is necessary to weight
882  // the shading on hit by the product of:
883  // - `opacityThroughput`: a colored weight resulting from stochastic continuations that
884  // happened before reaching the selected hit
885  // - `opacityStochasticWeight`: inverse of the local probability of having selected the hit,
886  // knowing that we have reached it
887  // - `opacity`: the total opacity of the selected hit
888 
889  // Per-point colored weight resulting from stochastic continuations that happened before
890  // reaching the selected hit.
891  //
892  // If no probabilistic hit-testing was involved before reaching the current point, or if the ray
893  // only went through surfaces with monochromatic opacity, then this quantity is [1 1 1]. If the
894  // ray went through surfaces with colored opacity, then this quantity is the total transmission
895  // (up to the current point) divided by the probability of reaching this point.
897 
898  // Per-point combined opacity: the product of presence and opacity for the current point.
900 
901  // Per-point probabilistic hit-testing weight.
902  //
903  // If the current hit's opacity is monochromatic, or if the `opacityThroughput` up to it is
904  // monochromatic, then this quantity only depends on the hit's total opacity. Otherwise, this
905  // weight also depends on the accumulated transmission up to the hit.
907 
909  mutable void* lightingServicesData;
910 
911  // The light shader is non-NULL when the shading context contains
912  // points on the surface of a light
913  RixLight const* light;
914 
915  // This is accessed and used by patterns to generate random numbers
916  // A NULL value of m_rngCtx means the integrator in use does not support
917  // this functionality. Pattern writer needs to check against NULL pointer
918  // before using m_rngCtx. See PxrRand pattern for example code.
919  mutable RixRNG* m_rngCtx;
920  virtual void SetupRngCtxForPattern() const = 0;
921 
926  {
928  };
929  virtual RixBxdf* GetBuiltinBxdf(BuiltinBxdf, RixBxdfFactory*) const = 0;
930 
935  virtual RixDisplayServices* GetDisplayServices(int version = 1) const = 0;
936 
938  {
939  // clang-format off
940  k_P = 0,
942  k_Po,
958  k_u,
959  k_v,
960  k_w,
986  // clang-format on
987  };
988  virtual void GetBuiltinVar(BuiltinVar, int const** var) const = 0;
989  virtual void GetBuiltinVar(BuiltinVar, float const** var) const = 0;
990  virtual void GetBuiltinVar(BuiltinVar, RtFloat3 const** var) const = 0;
991  virtual void GetBuiltinVar(BuiltinVar, RixLPEState* const** var) const = 0;
992 
1018  virtual void SetBuiltinVar(BuiltinVar, float* var) = 0;
1019  virtual void SetBuiltinVar(BuiltinVar, RtFloat3* var) = 0;
1020 
1031  virtual RixSCDetail GetPrimVar(const RtUString name, RixSCType* type, int* arraylen) const = 0;
1032 
1033  virtual RixSCDetail GetPrimVar(const RtUString name, float fill, float const** var,
1034  float const** radius = NULL) const = 0;
1035 
1036  virtual RixSCDetail GetPrimVar(const RtUString name, RtFloat2 fill, RtFloat2 const** var,
1037  float const** radius = NULL) const = 0;
1038 
1039  virtual RixSCDetail GetPrimVar(const RtUString name, RtFloat3 fill, RtFloat3 const** var,
1040  float const** radius = NULL) const = 0;
1041 
1042  virtual RixSCDetail GetPrimVar(const RtUString name, RtUString const** var) const = 0;
1043 
1044  virtual RixSCDetail GetPrimVar(const RtUString name, RtMatrix4x4 const& fill,
1045  RtMatrix4x4 const** var) const = 0;
1046 
1052 
1053  virtual RixSCDetail GetPrimVar(const RtUString name, float const** var, float const** dXdu,
1054  float const** dXdv) const = 0;
1055 
1056  virtual RixSCDetail GetPrimVar(const RtUString name, RtFloat2 const** var, float const** dXdu,
1057  float const** dYdu, float const** dXdv,
1058  float const** dYdv) const = 0;
1059 
1060  virtual RixSCDetail GetPrimVar(const RtUString name, RtFloat3 const** var, float const** dXdu,
1061  float const** dYdu, float const** dZdu, float const** dXdv,
1062  float const** dYdv, float const** dZdv) const = 0;
1063 
1080  virtual void SetPrimVar(const RtUString name, RixSCDetail d, float* var, float* radius) = 0;
1081 
1082  virtual void SetPrimVar(const RtUString name, RixSCDetail d, RtFloat2* var, float* radius) = 0;
1083 
1084  virtual void SetPrimVar(const RtUString name, RixSCDetail d, RtFloat3* var, float* radius) = 0;
1085 
1086  virtual void SetPrimVar(const RtUString name, RixSCDetail d, RtUString* var) = 0;
1087 
1088  virtual void SetPrimVar(const RtUString name, RixSCDetail d, RtMatrix4x4* var) = 0;
1089 
1100  virtual bool GetProperty(RayProperty, void const* /* result */) const
1101  {
1102  return false;
1103  }
1104 
1105  // Shading context obtains the pointer to the corresponding
1106  // integrator and integrator context.
1107  // The integrator is responsible for setting the values.
1108  virtual bool SetProperty(RayProperty, void const* /* in */) const
1109  {
1110  return false;
1111  }
1112 
1114  {
1118  };
1119 
1124  virtual int Transform(TransformInterpretation interp, const RtUString fromSpace,
1125  const RtUString toSpace, RtFloat3* var, float* radius = NULL) const = 0;
1126 
1133  virtual int GetTransform(const RtUString fromSpace, const RtUString toSpace,
1134  RtMatrix4x4 const** matrix, int* numMatrices) const = 0;
1135 
1141  virtual RixShadingContext* CreateMutableContext() const = 0;
1142 
1147  virtual RixShadingContext const* GetPrimaryContext() const = 0;
1148 
1151  virtual RixIntegratorContext* GetIntegratorContext() const = 0;
1152 
1159  virtual RixShadingContext const* GetContextById(RixShadingContext::Id sCtxId) const = 0;
1160 
1195 
1196  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, int const** result,
1197  int const* dflt = NULL, bool promoteToVarying = false) const = 0;
1198 
1199  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, float const** result,
1200  float const* dflt = NULL,
1201  bool promoteToVarying = false) const = 0;
1202 
1203  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtColorRGB const** result,
1204  RtColorRGB const* dflt = NULL,
1205  bool promoteToVarying = false) const = 0;
1206 
1207  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtFloat3 const** result,
1208  RtFloat3 const* dflt = NULL,
1209  bool promoteToVarying = false) const = 0;
1210 
1211  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtMatrix4x4 const** result,
1212  RtMatrix4x4 const* dflt = NULL,
1213  bool promoteToVarying = false) const = 0;
1214 
1215  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RtUString const** result,
1216  RtUString const* dflt = NULL,
1217  bool promoteToVarying = false) const = 0;
1218 
1219  virtual RixSCDetail EvalParam(int paramId, int arrayIndex, RixBxdfFactory** result,
1220  RixBxdfFactory* dflt = NULL,
1221  bool promoteToVarying = false) const = 0;
1222 
1224  {
1227  };
1228 
1235  template <class T>
1236  RixSCDetail EvalAndCopyParam(int paramId, int arrayIndex, T** result, T const* dflt = NULL,
1237  bool promoteToVarying = false, MemCategory mcat = k_BxdfMem) const
1238  {
1239  T const* constResult;
1240  RixSCDetail d = EvalParam(paramId, arrayIndex, &constResult, dflt);
1241  switch (d)
1242  {
1243  case k_RixSCVarying:
1244  *result = (T*)Allocate(this->numPts, sizeof(T), mcat);
1245  memcpy(*result, constResult, this->numPts * sizeof(T));
1246  break;
1247  case k_RixSCUniform:
1248  if (promoteToVarying)
1249  {
1250  *result = (T*)Allocate(this->numPts, sizeof(T), mcat);
1251  std::fill_n(*result, this->numPts, constResult[0]);
1252  }
1253  else
1254  {
1255  *result = (T*)Allocate(1, sizeof(T), mcat);
1256  (*result)[0] = constResult[0];
1257  }
1258  break;
1259  default:
1260  *result = 0x0;
1261  break;
1262  }
1263  return d;
1264  }
1265 
1271  virtual int GetParamId(const RtUString name, int* paramId) const = 0;
1272 
1278  virtual int GetParamInfo(int paramId, RixSCType* type, RixSCConnectionInfo* cInfo,
1279  int* arrayLength = NULL) const = 0;
1280 
1283  int GetParamInfo(int paramId, RixSCType* type, bool* isConnected, int* arrayLength = NULL) const
1284  {
1285  RixSCConnectionInfo cInfo;
1286  int err = GetParamInfo(paramId, type, &cInfo, arrayLength);
1287  if (isConnected) *isConnected = (cInfo == k_RixSCNetworkValue);
1288  return err;
1289  }
1290 
1313  virtual void GetNearestHits(int numRays, RtRayGeometry const* rays,
1314  // result:
1315  RtHitPoint* hits,
1316  // optional parameters:
1317  const RtUString subset = US_NULL,
1318  const RtUString excludeSubset = US_NULL,
1319  RtHitSides hitSides = k_SidesBoth) const = 0;
1320 
1326  virtual bool GetLightEmission(RtColorRGB* emission, int* lightGroupIds = NULL) const = 0;
1327 
1336  virtual void* Allocate(size_t n, size_t size, MemCategory m) const = 0;
1337 
1345  template <class T>
1346  T* New(size_t nObjs, MemCategory cat = k_BxdfMem) const
1347  {
1348  T* mem = static_cast<T*>(Allocate(nObjs, sizeof(T), cat));
1349  return new (mem) T[nObjs];
1350  }
1351 
1364  {
1365  public:
1366  Allocator(RixShadingContext const* sCtx) : m_sCtx(sCtx)
1367  {}
1368  template <typename T>
1369  T* Allocate(int num)
1370  {
1371  if (num == 0) return NULL;
1372  return (T*)m_sCtx->Allocate(num, sizeof(T), k_BxdfMem);
1373  }
1374  template <typename T>
1375  T* AllocFor(MemCategory memcat, int num)
1376  {
1377  if (num == 0) return NULL;
1378  return (T*)m_sCtx->Allocate(num, sizeof(T), memcat);
1379  }
1380  template <typename T>
1381  T* AllocForVolume(int num)
1382  {
1383  // currently the memory-pool lifetime of volumes matches
1384  // that of Bxdf.
1385  if (num == 0) return NULL;
1386  return (T*)m_sCtx->Allocate(num, sizeof(T), k_BxdfMem);
1387  }
1388  template <typename T>
1389  T* AllocForBxdf(int num)
1390  {
1391  if (num == 0) return NULL;
1392  return (T*)m_sCtx->Allocate(num, sizeof(T), k_BxdfMem);
1393  }
1394  template <typename T>
1395  T* AllocForPattern(int num)
1396  {
1397  if (num == 0) return NULL;
1398  return (T*)m_sCtx->Allocate(num, sizeof(T), k_PatternMem);
1399  }
1400 
1401  private:
1402  RixShadingContext const* m_sCtx;
1403  };
1404 
1405 protected:
1407  {}
1408 
1409  // Hide these interfaces. These are not useful/relevant for clients to
1410  // directly call. However, they need to be accessed by the
1411  // RixVolumeIntegrator internals, so allow access for this class only.
1412  friend class RixVolumeIntegrator;
1413  // LightVertexCache::RayDensityEstimation() in UPBP needs to call
1414  // BeginVolumeSampling() so allow it access, too.
1415  friend class LightVertexCache;
1416  virtual RixShadingContext* BeginVolumeSampling() const = 0;
1418  RixBXLobeTraits const* exposeVol = NULL,
1419  int const* membership = NULL) const = 0;
1420 
1421  mutable RixRNG::SampleCtx* m_rngSampleCtx; // assembled by querying into the integrator
1422 };
1423 
1424 #endif
RixBxdf * GetBxdf() const
Definition: RixShading.h:746
#define US_NULL
Definition: RiTypesHelper.h:683
Surface V parameterization (type float)
Definition: RixShading.h:959
Definition: RixShading.h:505
unsigned eyePath
Definition: RixShading.h:703
All-inlined interface for generating sample points for use by Monte Carlo integration and multiple-im...
Definition: RixRNG.h:59
RixShadingPlugin(int version)
Definition: RixShading.h:339
virtual int GetInterface() const
Definition: RixShading.h:175
PRMAN_INLINE size_t GetRixSCTypeSize(RixSCType type)
Gets the storage size for the valid atomic datatypes.
Definition: RixShading.h:376
Definition: RixShading.h:138
Definition: RixBxdf.h:264
RixShadingContext is analogous to a RenderMan grid - it is a group of 1 or more points that may be sh...
Definition: RixShading.h:663
void * data
Definition: RixShading.h:289
Definition: RixShading.h:503
int * pointSampleCount
If multiple volume samples are taken for multi scattering, the integrator needs to multiply this valu...
Definition: RixShading.h:871
Definition: RixShading.h:1226
Wavelength of incident ray (type float): 380-780nm visible spectrum.
Definition: RixShading.h:983
Bias to apply for transmitted rays (type float)
Definition: RixShading.h:956
Definition: RixShading.h:501
Definition: RixShading.h:966
Definition: RixShading.h:1117
friend class LightVertexCache
Definition: RixShading.h:1415
T * AllocForPattern(int num)
Definition: RixShading.h:1395
virtual bool GetProperty(RayProperty, void const *) const
As long as the RixIntegrator used supports the appropriate ray property query, shading plugin authors...
Definition: RixShading.h:1100
Current LPE State (type RixLPEState)
Definition: RixShading.h:976
Definition: RixShading.h:352
Definition: RixShading.h:504
virtual void SynchronizeInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *instanceParams, uint32_t const editHints, InstanceData *instanceData)
SynchronizeInstanceData() will only be called if InstanceData::synchronizeHints was set to a non-zero...
Definition: RixShading.h:326
BuiltinBxdf
BuiltinBxdfs can be constructed cheaply and offer a basic set of capabilities.
Definition: RixShading.h:925
RixVolumeIntegrator * BeginOppositeVol(int numRays, RtRayGeometry *rays) const
Definition: RixShading.h:819
bool HasMisses() const
Definition: RixShading.h:741
Surface W parameterization (type float)
Definition: RixShading.h:960
float * opacityStochasticWeight
Definition: RixShading.h:906
virtual void SetBuiltinVar(BuiltinVar, float *var)=0
SetBuiltinVar() allows the values of any builtin variable to be overridden.
Definition: RixShading.h:437
size_t datalen
Definition: RixShading.h:290
virtual ~RixShadingPlugin()
Definition: RixShading.h:341
RixLight This base class defines the interface for light sources.
Definition: RixLight.h:117
Definition: RixShading.h:356
Definition: RixShading.h:133
Definition: RixShading.h:835
Definition: RixShading.h:368
int m_version
Definition: RixShading.h:343
pxrcore::ColorRGB RtColorRGB
Definition: RiTypesHelper.h:520
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...
Definition: RixShading.h:1346
SampleCtx identifies a sample domain (an index into an arbitrary scheme of sample points)...
Definition: RixRNG.h:76
bool IsArray() const
Definition: RixShading.h:540
virtual RixSCDetail EvalParam(int paramId, int arrayIndex, int *result) const =0
EvalParam fills the provided result with the value of the parameter.
Rix interfaces are obtained from an RixContext.
Definition: RixInterfaces.h:172
BuiltinVar
Definition: RixShading.h:937
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 RixShadingCon...
Definition: RixShading.h:117
RixShadingPlugin is the base class for RixBxdfFactory, RixDisplacementFactory, RixDisplayFilter, RixIntegrator, RixLightFilter, RixLightFactory, RixPattern, RixProjection, and RixSampleFilter.
Definition: RixShading.h:168
Definition: RixShading.h:119
RixBxdfFactory::BeginScatter mode.
Definition: RixShading.h:560
Definition: RixShading.h:456
T * Allocate(int num)
Definition: RixShading.h:1369
RixSCParamInfo captures the characteristics of an individual ScParam.
Definition: RixShading.h:512
virtual RixVolumeIntegrator * BeginVolume(RixSCVolumeSelector, int numRays, RtRayGeometry *rays) const =0
Definition: RixShading.h:436
RixPostLighting * GetPostLighting() const
Definition: RixShading.h:787
Definition: RixShading.h:562
RixSCConnectionInfo
RixSCConnectionInfo identifies the origin of values associated with parameters evaluated through RixS...
Definition: RixShading.h:486
virtual RixShadingContext * CreateMutableContext() const =0
Create a context that can be mutated (implements SetBuiltinVar) for the purposes of super sampling a ...
Shading time, normalized between shutter open and close (type float)
Definition: RixShading.h:971
Definition: RixShading.h:476
RixShadingInterface
RixShadingInterface enumerates the known ShadingPlugin types.
Definition: RixShading.h:109
MemCategory
Definition: RixShading.h:1223
RixVolumeIntegrator * volume
Definition: RixShading.h:731
Definition: RixShading.h:488
Definition: RixShading.h:834
RtFloat3 RtPoint3
Definition: RiTypesHelper.h:70
Definition: RixShading.h:102
Instantaneous P velocity relative to the world (type RtFloat3)
Definition: RixShading.h:970
Ray footprint (radius) in W (type float)
Definition: RixShading.h:965
RixBxdf * bxdf
The bxdf shader is non-NULL for radiance queries and is responsible for computing light scattering...
Definition: RixShading.h:718
Definition: RixShading.h:113
RixDisplacementFactory::BeginDisplacement mode.
Definition: RixShading.h:563
virtual int Init(RixContext &ctx, RtUString const pluginPath)=0
In order to initialize the plugin, the renderer will call Init() once.
Definition: RixShading.h:358
Definition: RixIntegrator.h:615
SynchronizeHints
The renderer offers the ability to shading plugins to track custom data with every instance of the pl...
Definition: RixShading.h:274
virtual bool SetProperty(RayProperty, void const *) const
Definition: RixShading.h:1108
RtColorRGB * pointWeight
If the shading context was created via an importance sampling method, this is the associated weight t...
Definition: RixShading.h:867
virtual std::vector< const RixShadingContext * > const * GetOverlappingVolumes() const =0
Returns a list of shading contexts associated with any overlapping volumes.
Invalid shading context.
Definition: RixShading.h:555
Definition: RixShading.h:366
When raytracing, the ray footprint radius at P, otherwise the micropolygon radius (ie half mpSize) at...
Definition: RixShading.h:941
void Invalidate()
Definition: RixShading.h:683
Backward 2D raster-space motion vector (type RtFloat3)
Definition: RixShading.h:979
RixSCParamInfo(RtUString const structName, RtUString const _name, RixSCType t, RixSCAccess a=k_RixSCInput, int length=-1)
Definition: RixShading.h:521
RixSCDetail
RixSCDetail enumerates the valid sizing qualifiers for SC parameters.
Definition: RixShading.h:432
Definition: RixShading.h:365
Definition: RixBxdf.h:694
Definition: RixShading.h:462
virtual RixVolumeIntegrator * GetBuiltinVolume(BuiltinVolume builtin, RixBxdfFactory *factory, void *instanceData) const =0
RixSCShadingMode shadingMode
true if we&#39;re operating on a reyes grid this may occur in a variety of caching conditions ...
Definition: RixShading.h:714
RixBxdfFactory::BeginOpacity opacity mode.
Definition: RixShading.h:557
Ray footprint (radius) in V (type float)
Definition: RixShading.h:963
Definition: RixShading.h:435
Definition: RixShading.h:466
unsigned lightPath
true if shading for an eye path
Definition: RixShading.h:704
Definition: RixShading.h:459
Definition: RixShading.h:489
Definition: RixShading.h:112
short shadingCtxNum
Definition: RixShading.h:691
RtColorRGB * matteTransmission
Similar to transmission but restricted to the transmittance computed solely from matte or holdout vol...
Definition: RixShading.h:863
RixSCVolumeSelector
RixSCVolumeSelector identifies a volume region relative to an incident rays.
Definition: RixShading.h:474
Surface derivative in U (type RtFloat3)
Definition: RixShading.h:967
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...
Opacity (type RtFloat3)
Definition: RixShading.h:975
virtual void EndVolume(RixVolumeIntegrator *) const =0
Definition: RixShading.h:118
Bias to apply for reflected rays (type float)
Definition: RixShading.h:955
RixBXLobeSampled id of incident rays (type int)
Definition: RixShading.h:953
Definition: RixShading.h:985
Definition: RixShading.h:359
unsigned missContext
true if shading for a first hit
Definition: RixShading.h:706
Instantaneous P velocity relative to the camera (type RtFloat3)
Definition: RixShading.h:982
virtual void GetBuiltinVar(BuiltinVar, int const **var) const =0
struct RixShadingContext::@4 scTraits
shadingCtxTraits conveys a variety of (uniform) ShadingContex traits to shader and integrator...
Definition: RiTypesHelper.h:82
Definition: RixIntegrator.h:234
Definition: RixShading.h:114
RtColorRGB * opacityThroughput
Definition: RixShading.h:896
TransformInterpretation
Definition: RixShading.h:1113
Ray footprint (radius) in U (type float)
Definition: RixShading.h:961
Normalized shading normal (type RtFloat3)
Definition: RixShading.h:944
Spread of incident ray (type float): how much the ray radius increased for each unit distance the ray...
Definition: RixShading.h:951
RtHitSides
Definition: RixShading.h:99
Definition: RixShading.h:460
Local principal surface curvature in u dir (type float)
Definition: RixShading.h:980
virtual ~RixParameterList()
Definition: RixShading.h:635
RixBxdfFactory::BeginOpacity presence mode.
Definition: RixShading.h:556
RixParameterList exposes the non-varying values that are associated with the definition or editing of...
Definition: RixShading.h:575
RixSCShadingMode
RixSCShadingMode conveys the current operating mode associated with the shading context.
Definition: RixShading.h:553
RixOpacity * opacity
Definition: RixShading.h:722
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 suff...
Definition: RixShading.h:603
RixSCParamInfo(RtUString const _name, RixSCType t, RixSCAccess a=k_RixSCInput, int length=-1)
Definition: RixShading.h:515
RtUString customtype
Definition: RixShading.h:536
Definition: RixShading.h:116
Definition: RixShading.h:434
Definition: RixShading.h:964
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...
Definition: RixBxdf.h:769
Definition: RixShading.h:478
Definition: RixShading.h:362
pxrcore::Float3 RtFloat3
Definition: RiTypesHelper.h:69
Definition: RixShading.h:506
Surface U parameterization (type float)
Definition: RixShading.h:958
Definition: RixShading.h:134
RtUString name
Definition: RixShading.h:535
int numPts
numPts is the number of shading points.
Definition: RixShading.h:696
RixDisplayFilter plugins sit between the framebuffer and the display system.
Definition: RixDisplayFilter.h:54
Definition: RixShading.h:1115
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.
Definition: RixShading.h:111
Undisplaced P (type RtFloat3)
Definition: RixShading.h:943
Definition: RixShading.h:502
Definition: RixShading.h:461
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 "to...
int * integratorCtxIndex
integratorCtxIndex maps indices to varying ShadingContext entries to the index associated with Integr...
Definition: RixShading.h:846
Definition: RixShading.h:360
RixBxdfFactory::BeginScatter mode.
Definition: RixShading.h:558
RixSCType
RixSCType enumerates the valid atomic datatypes.
Definition: RixShading.h:349
RixSCParamInfo const * paramtable
Definition: RixShading.h:292
Definition: RixShading.h:458
Local principal surface curvature in v dir (type float)
Definition: RixShading.h:981
virtual RixBxdf * GetBuiltinBxdf(BuiltinBxdf, RixBxdfFactory *) const =0
RixVolumeIntegrator * BeginIncidentVol(int numRays, RtRayGeometry *rays) const
two convenience methods
Definition: RixShading.h:815
virtual void Synchronize(RixContext &ctx, RixSCSyncMsg syncMsg, RixParameterList const *syncParams)=0
This method is used to deliver occasional status information from the renderer.
Definition: RixIntegrator.h:458
Forward 2D raster-space motion vector (type RtFloat3)
Definition: RixShading.h:978
RixSCType type
Definition: RixShading.h:537
Definition: RixShading.h:927
Definition: RixShading.h:479
RixLight const * light
Definition: RixShading.h:913
Definition: RixShading.h:361
RtFloat3 RtNormal3
Definition: RiTypesHelper.h:73
RixSCSyncMsg
RixSCSyncMsgs - are the possible states delivered through Synchronize methods.
Definition: RixShading.h:127
#define PRMAN_INLINE
Definition: prmanapi.h:99
RtColorRGB * transmission
transmission is a per-point transmission that is associated with the ray that produced the associated...
Definition: RixShading.h:859
RixLightFilter plugins modify the lighting contribution to a surface point after a light has been sam...
Definition: RixLightFilter.h:66
void(* freefunc)(void *)
Definition: RixShading.h:291
Multiple methods of RixDisplayServices require similar parameters:
Definition: RixIntegrator.h:97
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 suff...
Definition: RixShading.h:1283
Definition: RixBxdf.h:972
Definition: RixShading.h:354
RixSampleFilter plugins sit between the integrator and the framebuffer and filter the shaded camera s...
Definition: RixSampleFilter.h:54
Definition: RixShading.h:463
unsigned reyesGrid
true if this context represents misses
Definition: RixShading.h:707
Radius of incident ray at P (type float)
Definition: RixShading.h:952
virtual int GetParamInfo(int paramId, RixSCType *type, RixSCConnectionInfo *cInfo, int *arrayLength=NULL) const =0
GetParamInfo returns additional details about a parameter such as its connection status, type, and array length.
RixRNG::SampleCtx * m_rngSampleCtx
Definition: RixShading.h:1421
Id(unsigned int i)
Definition: RixShading.h:676
RixSCAccess
RixSCAccess characterizes parameters as input or output.
Definition: RixShading.h:453
Definition: RixShading.h:464
unsigned primaryHit
true if shading for a light path
Definition: RixShading.h:705
Shading position (type RtFloat3)
Definition: RixShading.h:940
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...
Definition: RixShading.h:1236
Definition: RixShading.h:353
Definition: RixShading.h:1225
struct RixShadingContext::Id shadingCtxId
Definition: RixShading.h:369
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...
virtual RixSCDetail EvalParam(int paramId, int arrayIndex, int const **result, int const *dflt=NULL, bool promoteToVarying=false) const =0
EvalParam.
~RixShadingContext() override
Definition: RixShading.h:1406
Definition: RixShading.h:357
virtual RixShadingContext const * GetPrimaryContext() const =0
GetPrimaryContext returns a reference to the (immutable) primary shading context. ...
Allocator is a utility (fully inlined) class to assist with tedious memory pool allocations.
Definition: RixShading.h:1363
Definition: RixShading.h:136
unsigned int Serialize() const
Definition: RixShading.h:679
virtual RixSCParamInfo const * GetParamTable()=0
All shading plugins are expected to return a description of their input and output parameters via the...
Definition: RixShading.h:120
Normalized shading tangent (type RtFloat3)
Definition: RixShading.h:947
void * lightingServicesData
lightingServicesData is a blind pointer private RixLightingServices data
Definition: RixShading.h:909
virtual bool HasVolume(RixSCVolumeSelector) const =0
Support for volume integration:
bool IsValid() const
Definition: RixShading.h:687
Normalized geometric normal (type RtFloat3)
Definition: RixShading.h:945
Definition: RixShading.h:490
RixPostLighting * postlighting
Definition: RixShading.h:734
Definition: RixShading.h:364
Parent ray shading context serialization (type int)
Definition: RixShading.h:977
Length of view vector (type float)
Definition: RixShading.h:949
Local mean surface curvature (type float)
Definition: RixShading.h:950
RixSCAccess access
Definition: RixShading.h:538
Definition: RixShading.h:131
RixRNG * m_rngCtx
Definition: RixShading.h:919
Definition: RixShading.h:367
Texture baking mode.
Definition: RixShading.h:561
RixBxdfFactory::BeginInterior mode.
Definition: RixShading.h:559
Definition: RixDisplacement.h:62
pxrcore::Matrix4x4 RtMatrix4x4
Definition: RiTypesHelper.h:74
virtual RixSCDetail GetPrimVar(const RtUString name, RixSCType *type, int *arraylen) const =0
GetPrimVar: lazily evaluates the named primitive variable.
Surface derivative in V (type RtFloat3)
Definition: RixShading.h:968
T * AllocForVolume(int num)
Definition: RixShading.h:1381
Incident index of refraction (type float)
Definition: RixShading.h:974
virtual void EndSubsurface(RixVolumeIntegrator *) const =0
Represents the LPE system state of a light transport path.
Definition: RixLPE.h:439
Normalized undisplaced N (type RtFloat3)
Definition: RixShading.h:946
Attribute "identifier" "id2" (type int)
Definition: RixShading.h:973
Surface derivative in W (type RtFloat3)
Definition: RixShading.h:969
virtual void CreateInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *parameterList, InstanceData *instanceData)
CreateInstanceData() is called once per plugin-instance.
Definition: RixShading.h:303
Definition: RixShading.h:115
virtual RixVolumeIntegrator * BeginSubsurface(int numRays, RtRayGeometry *rays) const =0
Attribute "identifier" "id" (type int)
Definition: RixShading.h:972
Definition: RixShading.h:276
uint32_t synchronizeHints
Definition: RixShading.h:293
This struct represents the characteristics of potentially several lobes of a bxdf in aggregate...
Definition: RixBxdfLobe.h:178
virtual bool HasSubsurface() const =0
bool HasHits() const
Definition: RixShading.h:737
T * AllocForBxdf(int num)
Definition: RixShading.h:1389
T * AllocFor(MemCategory memcat, int num)
Definition: RixShading.h:1375
Definition: RixShading.h:477
RayProperty
There are a set of &#39;properties&#39; of a ray the integrator could provide the bxdf that can potentially p...
Definition: RixShading.h:499
pxrcore::UString RtUString
Definition: RiTypesHelper.h:682
Definition: RixShading.h:277
int arraylen
Definition: RixShading.h:539
PxrMeshLight emission mode.
Definition: RixShading.h:564
shadingCtxId is a unique identifier for this shading context.
Definition: RixShading.h:672
virtual RixIntegratorContext * GetIntegratorContext() const =0
Returns a reference to the RixIntegratorContext which created this shading context.
Definition: RixShading.h:101
InstanceData()
Definition: RixShading.h:282
Micropolygon size; 0 for non-tessellated surfaces (type float)
Definition: RixShading.h:954
virtual RixShadingContext * BeginVolumeSampling() const =0
Definition: RixShading.h:280
virtual RixShadingContext const * GetContextById(RixShadingContext::Id sCtxId) const =0
GetShadingContextById, given a RixShadingContext::Id, returns a reference to the shading context whic...
Definition: RixShading.h:962
RixVolumeIntegrator * subsurface
Definition: RixShading.h:728
virtual int GetNumParams() const =0
Bias to apply for shadow rays (Direct Light) to avoid the geometric shadow terminator.
Definition: RixShading.h:957
Definition: RixShading.h:355
Id()
Definition: RixShading.h:674
Definition: RixShading.h:132
RixVolumeIntegrator * GetSubsurface() const
Definition: RixShading.h:770
RtFloat3 RtVector3
Definition: RiTypesHelper.h:72
int * rayId
rayId is similar to integratorCtxIndex.
Definition: RixShading.h:853
Definition: RixShading.h:1116
Definition: RixShading.h:103
virtual void SetupRngCtxForPattern() const =0
BuiltinVolume
BuiltinVolumes are "preloaded" and initialized by the renderer.
Definition: RixShading.h:832
RixOpacity * GetOpacity() const
Definition: RixShading.h:756
RixSCParamInfo()
Definition: RixShading.h:527
Normalized view vector, points away from shading points (type RtFloat3)
Definition: RixShading.h:948
Definition: RixShading.h:130
Number of shading modes.
Definition: RixShading.h:566
virtual int GetVersion() const
Definition: RixShading.h:171
RixVolumeIntegrator * GetVolume() const
Definition: RixShading.h:778
Illumination baking mode.
Definition: RixShading.h:565
Definition: RixShading.h:351
virtual int GetParamId(const RtUString name, int *paramId) const =0
GetParamId maps a string name to a more efficient integer reference.
Normalized analytical undisplaced N (type RtFloat3)
Definition: RixShading.h:984
RixDisplacement * displacement
Definition: RixShading.h:725
RixDisplacement * GetDisplacement() const
Definition: RixShading.h:764
virtual RixDisplayServices * GetDisplayServices(int version=1) const =0
Get access to the display services.
RtColorRGB * opacity
Definition: RixShading.h:899
virtual int GetParamId(const RtUString name, int *paramId) const =0
GetParamId maps a string name to a more efficient integer reference.
Allocator(RixShadingContext const *sCtx)
Definition: RixShading.h:1366
Definition: RixBxdf.h:518
virtual RixShadingContext const * EndVolumeSampling(const RixShadingContext *, RixBXLobeTraits const *exposeVol=NULL, int const *membership=NULL) const =0
Definition: RixShading.h:457
Definition: RixShading.h:363
#define PIXAR_ARGUSED(x)
Definition: prmanapi.h:170
virtual bool GetLightEmission(RtColorRGB *emission, int *lightGroupIds=NULL) const =0
GetLightEmission: returns the sampled emission associated with the shading points.
virtual void Finalize(RixContext &ctx)=0
Finalize() is the companion to Init(), called at the end of rendering with the expectation that any d...