RenderMan API  23.0
RixIntegrator.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 1986-2019 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 RixIntegrator_h
38 #define RixIntegrator_h
39 
40 #include <math.h> // for sqrtf
41 #include <algorithm> // for max
42 #include <cassert> // for assert
43 #include <cstddef> // for size_t
44 #include "RixBxdfLobe.h" // for RixBXLobeSampled, etc
45 #include "RixInterfaces.h" // for RixContext
46 #include "RixShading.h" // for RixShadingContext, etc
47 #include "RixShadingUtils.h" // for RixIsFinite
48 #include "prmanapi.h" // for PRMANEXPORT, PRMAN_INLINE
49 #include "ri.h" // for RtNormal3, Dot, RtPoint3, etc
50 
51 class RixLPE;
52 class RixLPEState;
54 class RixRNG;
56 
57 typedef unsigned int RixChannelId;
58 static const RixChannelId k_InvalidChannelId = 2147483647;
59 
69 {
72  {
75  } style;
77  {
83  } type;
85 };
86 
98 {
99 public:
111  //
112  virtual bool Splat(RixChannelId id, int iCtxIndex, float const value) = 0;
114  virtual bool Splat(RixChannelId id, int iCtxIndex, RtColorRGB const value) = 0;
115 
127  virtual bool SplatMulti(
128  int nChans, RixChannelId const* ids, int iCtxIndex, float const value) = 0;
130  virtual bool SplatMulti(
131  int nChans, RixChannelId const* id, int iCtxIndex, RtColorRGB const value) = 0;
132 
146  virtual bool Write(RixChannelId id, int iCtxIndex, float const value) = 0;
148  virtual bool Write(RixChannelId id, int iCtxIndex, RtColorRGB const value) = 0;
150  virtual bool Write(RixChannelId id, int iCtxIndex, int const value) = 0;
151 
169  virtual void WriteDistance(
170  int const iCtxIndex,
171  float const distance,
172  bool const isVolume = true,
173  RixShadingContext const* sCtx = nullptr) = 0;
174 
182  virtual void WriteOpacity(RixChannelId id, int iCtxIndex, float const value) = 0;
183  virtual void WriteOpacity(RixChannelId id, int iCtxIndex, RtColorRGB& value) = 0;
184 
192  virtual void SplatOpacity(RixChannelId id, int iCtxIndex, float const opacity) = 0;
193  virtual void SplatOpacity(RixChannelId id, int iCtxIndex, RtColorRGB& opacity) = 0;
194 
208  virtual int AddSample(int iCtxIndex) = 0;
209 
219  virtual void GetDisplayChannels(int* numDisplays, RixDisplayChannel const** displays) = 0;
220 
228  virtual void DiscardIteration(bool redo = false) = 0;
229 
230 protected:
231  virtual ~RixDisplayServices() {}
232 };
233 
235 {
236  enum RayType
237  {
238  k_rtInvalid = 0,
239  k_rtCamera = 1, /* primary visibility ray from a camera */
240  k_rtLight = 2, /* photon ray directly from a light source */
241  k_rtTransmission = 3, /* shadow ray */
242  k_rtDirectlight = 4, /* directlighting ray */
243  k_rtIndirect = 5, /* indirect ray */
244  k_rtNumRayTypes = 6
245  };
246 
248  float originRadius;
250 
251  float raySpread;
252  float minDist;
256  float maxDist;
257  float time;
258 
259  uint16_t raytype;
263  uint16_t shadingCtxIndex;
264  uint16_t rayId;
266 
267  uint32_t private0[5];
269  mutable uint16_t hitId;
272  uint16_t flags;
273 
277  uint16_t wavelength;
278 
291  void InitOrigination(RixShadingContext const* sCtx, RtNormal3 const* Ngn, int _shadingCtxIndex)
292  {
293  this->shadingCtxId = sCtx->shadingCtxId;
294  this->shadingCtxIndex = _shadingCtxIndex;
295  this->integratorCtxIndex = sCtx->integratorCtxIndex[_shadingCtxIndex];
296  if (this->lobeSampled.GetTransmit())
297  {
298  bool const entering = Dot(Ngn[_shadingCtxIndex], this->direction) <= 0.f;
299  this->lobeSampled.SetEntering(entering);
300  }
301  }
302 
311  void InitTransmitOrigination(RixShadingContext const* sCtx, int _shadingCtxIndex)
312  {
313  this->shadingCtxId = sCtx->shadingCtxId;
314  this->shadingCtxIndex = _shadingCtxIndex;
315  this->integratorCtxIndex = sCtx->integratorCtxIndex[_shadingCtxIndex];
316  this->lobeSampled.Set(
317  true, // discrete
318  false, // specular
319  false, // transmit, not reflect
320  false, // scattering
321  false, // not user
322  0, // lpeid
323  0 // lobeid (unused)
324  );
325  this->lobeSampled.SetEntering(true);
326  }
327 
353  RixBXLobeSampled lobe,
354  float rayOriginRadius,
355  float rayOriginSpread,
356  float curvature,
357  float fPdf,
358  bool lightPath = false)
359  {
360  float pdfSpread = 0.0f;
361  float newSpread;
362 
363  // Compute ray spread based on pdf (and hence surface roughness). If Dirac delta, don't use
364  // pdf -- it is 1.0 by convention.
365  if (!lightPath && lobe.GetSolidAngle() && fPdf > 0.0f)
366  {
367  // Inverse square root of pdf is a heuristic that seems to work.
368  assert(fPdf > 0.0f); // Avoid division by 0 (fPdf=inf is okay here).
369  pdfSpread = 0.125f / sqrtf(fPdf);
370  assert(RixIsFinite(pdfSpread));
371  }
372 
373  // Compute ray spread based on surface curvature.
374  if (lobe.GetReflect())
375  {
376  // Treat this as reflection:
377  // - `k_RixBXReflectSpecular`
378  // - `k_RixBXReflectGlossy`
379  // - `k_RixBXReflectDiffuse`
380 
381  // Spread for specular reflection: The new ray spread is the incident ray spread plus
382  // change induced by local curvature. The factor of 2 comes from differentiating the
383  // formula for mirror reflection direction -- see [Igehy99].
384  // Note that we clamp the spread so it doesn't become negative for highly negative
385  // curvature, for example a concave mirror.
386  float curvatureSpread = rayOriginSpread + 2.0f * curvature * rayOriginRadius;
387  newSpread = std::max(curvatureSpread, pdfSpread);
388  }
389  else if (lobe.GetTransmit())
390  {
391  // Treat this as refraction:
392  // - `k_RixBXTransmitSpecular`
393  // - `k_RixBXTransmitGlossy`
394 
395  // Spread for specular transmission -- simpler than [Igehy99] since we only need spread
396  // amount, not differential direction vector:
397  // - newSpread = eta * raySpread - (1.0f - eta) * curvature * rayOriginRadius;
398  //
399  // This can give negative spread and focusing of the ray, with the width of the ray
400  // increasing beyond the focus distance. This is all good and fine, but we skip this
401  // effect for now. For now: simply copy parent ray spread to avoid having to deal with
402  // ior vs. 1/ior
403  newSpread = std::max(rayOriginSpread, pdfSpread);
404 
405  // - `k_RixBXTransmitDiffuse`
406 
407  // Use very conservative spread for diffuse reflection and transmission: same as for
408  // specular/glossy reflection.
409  // (Could do better if we know PixelSamples and diffusemultfactor: compute ray solid
410  // angle = 2pi / (pixsam*diffmultfac)
411  }
412  else
413  {
414  // We have no idea what this ray is, let's use the provided ray spread.
415  newSpread = rayOriginSpread;
416  }
417 
418  // Disallow |newSpread| > 1 or newSpread == nan
419  if (!(newSpread <= 1.0f)) newSpread = 1.0f;
420  if (newSpread < -1.0f) newSpread = -1.0f;
421  assert(-1.0f <= newSpread && newSpread <= 1.0f);
422 
423  this->raySpread = newSpread;
424  }
425 
433  static PRMAN_INLINE uint16_t EncodeWavelength(float wavelength)
434  {
435  return wavelength != 0.0f ?
436  (int((wavelength - 380.0f) * (65534.0f / (780.0f - 380.0f)) + 0.5f) + 1) :
437  0;
438  }
439 
447  static PRMAN_INLINE float DecodeWavelength(uint16_t encodedWavelength)
448  {
449  return encodedWavelength != 0 ?
450  (float(encodedWavelength - 1) * ((780.0f - 380.0f) / 65534.0f) + 380.0f) :
451  0.0f;
452  }
453 };
454 
456 {
459  float dist;
461  float filterSize;
462  float mpSize;
463 };
464 
469 {
470 public:
473  {
475  k_Fixed = 1,
476  k_Adaptive = 2,
477  k_Incremental = 4,
478 
479  k_AllModes = (k_Fixed | k_Adaptive | k_Incremental)
480  };
481 
484  {
485  k_UnidirectionalLighting = 0,
486  k_BidirectionalLighting = 1
487  };
488 
490  : m_version(2),
491  maxIntegrateSize(1024),
492  maxShadingCtxSize(1024),
493  supportedSamplingModes(k_AllModes),
494  lightingRequirements(k_UnidirectionalLighting),
495  numDisplays(0),
496  displays(0),
497  wantsEmptyIntegrate(false),
498  wantsIncrementBarrier(false),
499  numRaysPerIncrement(-1),
500  numIncrements(0),
501  numBootstrapIncrements(0),
502  lobesWanted(k_RixBXTraitsAllLobe),
503  cameraMediumIOR(1.f),
504  cameraMediumPriority(0),
505  wantsTransmission(false),
506  usesLightingServices(true)
507  {}
508 
519  {
520  for (int i = 0; i < numDisplays; ++i)
521  if (displays[i].channel == name) return &displays[i];
522  return nullptr;
523  }
524 
527 
528  // Some of the following quantities can be modified by the integrator on the object provided to
529  // `RixIntegrator::RenderBegin()`.
530 
545 
547  int const numDisplays;
549 
558 
563  int const numIncrements;
564 
567 
580 
584  char _reserved[30];
585 };
586 
587 namespace RixConstants
588 {
591  static const int k_MaxRaysPerBatch = 32768;
592 }
593 
595 {
596 public:
598  int numRays;
599  int numActiveRays;
609  float* time;
610 
611  virtual RixDisplayServices* GetDisplayServices(int version = 1) const = 0;
612  virtual RixLightingServices* GetLightingServices(int version = 1) const = 0;
613  virtual RixVolumeServices* GetVolumeServices(int version = 1) const = 0;
614  virtual RixRefCntPtr<RixLPE> GetRixLPE(int version = 1) const = 0;
615  virtual RixIntegratorEnvironment const& GetEnv(int version = 1) const = 0;
616 
618  {
619  k_None = 0,
620  k_Primary = 1,
621  k_IncludeMisses = 2,
622  k_ConstrainToVolume = 4,
623  k_ContinuationOpacity = 8,
624  k_SkipVolumes = 0x10
625  };
626 
665  virtual void GetNearestHits(
666  int nRays,
667  RtRayGeometry const* rays,
668  RixBXLobeTraits const& lobesWanted,
669  RtRayGeometry::RayType rayType,
670  int nearestHitFlags,
671  RtUString const subset,
672  RtUString const excludeSubset,
673  RtHitSides hitSides,
674  int* numShadingCtxs,
675  RixShadingContext const** shadingCtxs) = 0;
676 
704  virtual void GetNearestHits(
705  int nRays,
706  RtRayGeometry const* rays,
707  RtRayGeometry::RayType rayType,
708  int nearestHitFlags,
709  RtUString const subset,
710  RtUString const excludeSubset,
711  RtHitSides hitSides,
712  RtHitPoint* hits) = 0;
713 
757  virtual void GetNearestHits(
758  int nRays,
759  RtRayGeometry const* rays,
760  RixBXLobeTraits const& lobesWanted,
761  bool wantsMisses,
762  int* numShadingCtxs,
763  RixShadingContext const** shadingCtxs,
764  // optional inputs:
765  RtUString const subset = US_NULL,
766  RtUString const excludeSubset = US_NULL,
767  bool isLightPath = false,
768  RtHitSides hitSides = k_SidesBoth,
769  bool isPrimary = false,
770  bool isVolume = false,
771  bool stochasticMode = true)
772  {
773  int nearestHitFlags =
774  (isPrimary ? k_Primary : k_None) |
775  (wantsMisses ? k_IncludeMisses : k_None) |
776  (isVolume ? k_ConstrainToVolume : k_None) |
777  (stochasticMode ? k_None : k_ContinuationOpacity);
778  RtRayGeometry::RayType raytype =
779  (isLightPath ? RtRayGeometry::k_rtLight :
781  GetNearestHits(nRays, rays, lobesWanted,
782  raytype, nearestHitFlags, subset, excludeSubset, hitSides, numShadingCtxs, shadingCtxs);
783  }
784 
791  virtual void GetNearestHits(
792  int nRays,
793  RtRayGeometry const* rays,
794  RtHitPoint* hits,
795  // optional inputs:
796  RtUString const subset = US_NULL,
797  RtUString const excludeSubset = US_NULL,
798  RtHitSides hitSides = k_SidesBoth,
799  bool isPrimary = false,
800  bool isVolume = false,
801  bool stochasticMode = true)
802  {
803  int nearestHitFlags =
804  (isPrimary ? k_Primary : k_None) |
805  (isVolume ? k_ConstrainToVolume : k_None) |
806  (stochasticMode ? k_None : k_ContinuationOpacity);
808  GetNearestHits(nRays, rays, raytype,
809  nearestHitFlags, subset, excludeSubset, hitSides, hits);
810  }
811 
835  virtual void GetTransmission(
836  int nRays,
837  RtRayGeometry const* rays,
838  RtColorRGB* transmissions,
839  RtColorRGB* volumeEmissions,
840  // optional input:
841  RtUString const subset = US_NULL,
842  RtUString const excludeSubset = US_NULL) = 0;
843 
852  virtual void ReleaseShadingContexts(
853  int numShadingCtxs, RixShadingContext const** shadingCtxs) = 0;
854 
861  {
862  k_IntegratorMem
863  };
864  virtual void* Allocate(size_t nObjs, size_t objSize, MemCategory) = 0;
865 
866  // contexts for ray misses
867  template <class T> T* Allocate(size_t nObjs)
868  {
869  T* mem = static_cast<T*>(Allocate(nObjs, sizeof(T), k_IntegratorMem));
870  return mem;
871  }
872 
873  template <class T> T* New(size_t nObjs)
874  {
875  T* mem = static_cast<T*>(Allocate(nObjs, sizeof(T), k_IntegratorMem));
876  return new (mem) T[nObjs];
877  }
878 
879 protected:
881 
882 public:
883 };
884 
886 {
887 public:
898  virtual void RenderBegin(
899  RixContext& rCtx,
900  RixIntegratorEnvironment& rixIntegratorEnv,
901  RixParameterList const* rixParameterList) = 0;
902  virtual void RenderEnd(RixContext& ctx) = 0;
903 
911  virtual void Synchronize(
912  RixContext& rCtx,
913  RixSCSyncMsg rixSCSyncMsg,
914  RixParameterList const* rixParameterList)
915  {
916  PIXAR_ARGUSED(rCtx);
917  PIXAR_ARGUSED(rixSCSyncMsg);
918  PIXAR_ARGUSED(rixParameterList);
919  }
920 
921 
939  virtual void IntegrateRays(
940  RixBXLobeTraits const& lobesWanted,
941  int* numShadingCtxs,
942  RixShadingContext const** shadingCtxs,
943  RixIntegratorContext& iCtx)
944  {
945  if (iCtx.numActiveRays)
946  {
947  iCtx.GetNearestHits(
948  iCtx.numActiveRays,
949  iCtx.primaryRays,
950  lobesWanted,
953  US_NULL, /*subset*/
954  US_NULL, /*excludeSubset*/
955  k_SidesFront,
956  numShadingCtxs,
957  shadingCtxs);
958  RixDisplayServices* displayServices = iCtx.GetDisplayServices();
959  for (int i = 0; i < *numShadingCtxs; ++i)
960  {
961  RixShadingContext const* sCtx = shadingCtxs[i];
962  RtFloat const* VLen;
964  for (int j = 0; j < sCtx->numPts; ++j)
965  {
966  int ctxIdx = sCtx->integratorCtxIndex[j];
967  displayServices->WriteDistance(ctxIdx, VLen[j], false);
968  }
969  }
970  Integrate(*numShadingCtxs, shadingCtxs, iCtx);
971  }
972  }
973 
988  virtual void Integrate(
989  int numShadingCtxs, RixShadingContext const* shadingCtxs[], RixIntegratorContext& iCtx) = 0;
990 
1004  virtual void GetTransmission(
1005  int nRays,
1006  RtRayGeometry const* rays,
1007  RtColorRGB* transmissions,
1008  RtColorRGB* volumeEmissions,
1009  RtUString const subset,
1010  RtUString const excludeSubset,
1011  RixIntegratorContext& iCtx)
1012  {
1013  PIXAR_ARGUSED(nRays);
1014  PIXAR_ARGUSED(rays);
1015  PIXAR_ARGUSED(transmissions);
1016  PIXAR_ARGUSED(volumeEmissions);
1017  PIXAR_ARGUSED(subset);
1018  PIXAR_ARGUSED(excludeSubset);
1019  PIXAR_ARGUSED(iCtx);
1020  }
1021 
1041  virtual bool GetProperty(
1042  RixIntegratorContext& iCtx,
1043  const int* rayIds,
1044  int nRays,
1045  RayProperty rayProperty,
1046  void const* results)
1047  {
1048  PIXAR_ARGUSED(iCtx);
1049  PIXAR_ARGUSED(rayIds);
1050  PIXAR_ARGUSED(nRays);
1051  PIXAR_ARGUSED(rayProperty);
1052  PIXAR_ARGUSED(results);
1053 
1054  return false;
1055  }
1056 
1080  virtual bool SetProperty(
1081  RixIntegratorContext& iCtx,
1082  const int* rayIds,
1083  int nRays,
1084  RayProperty rayProperty,
1085  void const* values)
1086  {
1087  PIXAR_ARGUSED(iCtx);
1088  PIXAR_ARGUSED(rayIds);
1089  PIXAR_ARGUSED(nRays);
1090  PIXAR_ARGUSED(rayProperty);
1091  PIXAR_ARGUSED(values);
1092 
1093  return false;
1094  }
1095 
1096 protected:
1097  virtual ~RixIntegrator() {}
1098 };
1099 
1101 {
1102 public:
1103  virtual int GetInterface() const override
1104  {
1105  return k_RixIntegratorFactory;
1106  }
1107 
1108  // Projection plugins do not support InstanceData. As a consequence, the following methods are
1109  // not expected to be implemented and won't be called by the renderer.
1110  virtual void CreateInstanceData(RixContext& rixCtx, RtUString const handle,
1111  RixParameterList const* instanceParams,
1112  InstanceData* instanceData) override final
1113  {
1114  PIXAR_ARGUSED(rixCtx);
1115  PIXAR_ARGUSED(handle);
1116  PIXAR_ARGUSED(instanceParams);
1117  PIXAR_ARGUSED(instanceData);
1118  }
1119 
1120  virtual void SynchronizeInstanceData(RixContext& rixCtx, RtUString const handle,
1121  RixParameterList const* instanceParams,
1122  uint32_t const editHints,
1123  InstanceData* instanceData) override final
1124  {
1125  PIXAR_ARGUSED(rixCtx);
1126  PIXAR_ARGUSED(handle);
1127  PIXAR_ARGUSED(instanceParams);
1128  PIXAR_ARGUSED(editHints);
1129  PIXAR_ARGUSED(instanceData);
1130  }
1131 
1132  virtual RixIntegrator* CreateIntegrator(RixContext& rCtx, RtUString const handle,
1133  RixParameterList const* pList) = 0;
1134 
1135  virtual void DestroyIntegrator(RixIntegrator const* integrator) = 0;
1136 
1137 protected:
1139  {}
1141  {}
1142 };
1143 
1144 #define RIX_INTEGRATORFACTORYCREATE \
1145  extern "C" PRMANEXPORT RixIntegratorFactory* CreateRixIntegratorFactory(const char* hint)
1146 
1147 #define RIX_INTEGRATORFACTORYDESTROY \
1148  extern "C" PRMANEXPORT void DestroyRixIntegratorFactory(RixIntegratorFactory* factory)
1149 
1150 #endif
LightingModes
Indicates the lighting modes supported by the integrator.
RixBXLobeSampled lobeSampled
See RayType for possible values.
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
virtual int GetInterface() const override
void InitOrigination(RixShadingContext const *sCtx, RtNormal3 const *Ngn, int _shadingCtxIndex)
int m_version
Interface version.
RtHitSides
Definition: RixShading.h:99
pxrcore::ColorRGB RtColorRGB
uint16_t raytype
Shutter-normalized time of ray launch.
#define US_NULL
int * integratorCtxIndex
Definition: RixShading.h:784
This struct represents the characteristics of just one lobe of a bxdf.
Definition: RixBxdfLobe.h:64
float raySpread
Ray direction.
PRMAN_INLINE bool GetSolidAngle() const
Definition: RixBxdfLobe.h:661
float dist
Geometric normal on hit.
LightingModes lightingRequirements
Deprecated.
float RtFloat
Definition: ri.h:54
uint16_t shadingCtxIndex
Associated primary ray index.
RtFloat3 RtPoint3
Definition: RiTypesHelper.h:69
float opacityThreshold
Data for internal use.
int16_t integratorCtxIndex
Shading context unique identifier.
RixShadingContext::Id shadingCtxId
Characteristics of the BxDF lobe this ray samples.
uint16_t rayId
Index into the lauching shading context.
PRMAN_INLINE bool GetTransmit(bool *entering=NULL) const
Definition: RixBxdfLobe.h:685
Definition: RixLPE.h:128
RixBXLobeTraits lobesWanted
RixRNG * rngCtx
A pointer to single RixRNG object, properly configured for numRays samples.
Indicate if the ray should be considered as a primary ray or a continuation of one, uninterrupted from the camera or a light source.
enum RixDisplayChannel::ChannelType type
enum RixDisplayChannel::ChannelStyle style
RtRayGeometry * primaryRays
The primary camera rays.
RixLPEState * lpeState
User-provided index in the ray bundle.
RtFloat3 RtNormal3
Definition: RiTypesHelper.h:72
virtual RixDisplayServices * GetDisplayServices(int version=1) const =0
SamplingModes
Indicates the sampling modes supported by the integrator.
float maxDist
Minimum hit distance. Used only for primary rays.
void InitTransmitOrigination(RixShadingContext const *sCtx, int _shadingCtxIndex)
#define PRMAN_ALIGNED_16
Definition: prmanapi.h:96
virtual ~RixIntegratorContext()
T * Allocate(size_t nObjs)
T * New(size_t nObjs)
int cameraMediumPriority
Priority of the medium surrounding the camera. Defaults to 0.
bool wantsTransmission
Expresses whether integrator has a non trivial GetTransmission() method.
struct RixShadingContext::Id shadingCtxId
virtual void SynchronizeInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *instanceParams, uint32_t const editHints, InstanceData *instanceData) override final
void Splat(RtInt numShadingContexts, RixShadingContext const **sctxs, RixDisplayServices *dspsvc, RtFloat3 *aovValue, RtFloat *savedFloat, RixChannelId *aovIdList, RixBXLobeTraits const *lobesWanted=NULL, RtUString coordinateSystem=Rix::k_camera)
Definition: PxrGeoAovs.h:201
PRMAN_INLINE void SetEntering(bool entering)
Definition: RixBxdfLobe.h:784
int const numDisplays
Display state (unmutable).
float filterSize
(u,v) coordinates of the hit.
pxrcore::UString RtUString
virtual bool SetProperty(RixIntegratorContext &iCtx, const int *rayIds, int nRays, RayProperty rayProperty, void const *values)
#define PRMAN_INLINE
Definition: prmanapi.h:86
virtual ~RixDisplayServices()
#define k_RixShadingVersion
Definition: RixShading.h:97
virtual ~RixIntegratorFactory()
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)
PRMAN_INLINE int RixIsFinite(float x)
Length of view vector (type float)
Definition: RixShading.h:883
PRMAN_INLINE bool GetReflect() const
Definition: RixBxdfLobe.h:679
RayProperty
Definition: RixShading.h:443
static PRMAN_INLINE uint16_t EncodeWavelength(float wavelength)
virtual void WriteDistance(int const iCtxIndex, float const distance, bool const isVolume=true, RixShadingContext const *sCtx=nullptr)=0
Definition: RixRNG.h:59
uint16_t wavelength
Flags for internal use.
virtual bool GetProperty(RixIntegratorContext &iCtx, const int *rayIds, int nRays, RayProperty rayProperty, void const *results)
virtual void Synchronize(RixContext &rCtx, RixSCSyncMsg rixSCSyncMsg, RixParameterList const *rixParameterList)
virtual void CreateInstanceData(RixContext &rixCtx, RtUString const handle, RixParameterList const *instanceParams, InstanceData *instanceData) override final
virtual void IntegrateRays(RixBXLobeTraits const &lobesWanted, int *numShadingCtxs, RixShadingContext const **shadingCtxs, RixIntegratorContext &iCtx)
float mpSize
Used for texture filtering.
virtual void GetTransmission(int nRays, RtRayGeometry const *rays, RtColorRGB *transmissions, RtColorRGB *volumeEmissions, RtUString const subset, RtUString const excludeSubset, RixIntegratorContext &iCtx)
SamplingModes supportedSamplingModes
Deprecated.
RtPoint3 origin
virtual ~RixIntegrator()
RtPoint3 P
int numBootstrapIncrements
Used to request iterations which do not contribute to the final result.
uint16_t flags
Internal hit id, zero means &#39;no hit.&#39;.
float originRadius
Ray origin.
RixChannelId id
Definition: RixIntegrator.h:70
PRMAN_INLINE RixDisplayChannel const * GetDisplayChannel(RtUString name) const
int numRays
Unique identifier for integrator context.
PRMAN_INLINE void Set(bool vDiscrete, bool vSpecular, bool vReflect, bool vContinuation, bool vUser, unsigned char vLpeId, unsigned char vLobeId, bool vThinShadowFlag=false)
Set all fields and also sets the valid bit to true.
Definition: RixBxdfLobe.h:828
Invalid shading node.
unsigned int RixChannelId
Definition: RixIntegrator.h:55
static PRMAN_INLINE float DecodeWavelength(uint16_t encodedWavelength)
RtVector3 direction
Radius of ray at its origin.
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)
int const numIncrements
Total number of increments. This is usually maxsamples.
RixSCSyncMsg
Definition: RixShading.h:127
RixDisplayChannel const *const displays
float time
Maximum hit distance.
RtNormal3 Ng
Hit position.
void SetRaySpread(RixBXLobeSampled lobe, float rayOriginRadius, float rayOriginSpread, float curvature, float fPdf, bool lightPath=false)
virtual void GetBuiltinVar(BuiltinVar, int const **var) const =0
RtPoint2 uv
Distance to hit point. 0 means &#39;no hit&#39;.
#define PIXAR_ARGUSED(x)
Definition: prmanapi.h:171
RtFloat3 RtVector3
Definition: RiTypesHelper.h:71