RixShadingBuiltin.h Source File

RixShadingBuiltin.h
1 #ifndef RixBuiltinShading_h
2 #define RixBuiltinShading_h
3 /* $Revision: #6 $ $Date: 2015/09/01 $
4 # ------------------------------------------------------------------------------
5 #
6 # Copyright (c) 2013-2015 Pixar Animation Studios. All rights reserved.
7 #
8 # The information in this file (the "Software") is provided for the
9 # exclusive use of the software licensees of Pixar. Licensees have
10 # the right to incorporate the Software into other products for use
11 # by other authorized software licensees of Pixar, without fee.
12 # Except as expressly permitted herein, the Software may not be
13 # disclosed to third parties, copied or duplicated in any form, in
14 # whole or in part, without the prior written permission of
15 # Pixar Animation Studios.
16 #
17 # The copyright notices in the Software and this entire statement,
18 # including the above license grant, this restriction and the
19 # following disclaimer, must be included in all copies of the
20 # Software, in whole or in part, and all permitted derivative works of
21 # the Software, unless such copies or derivative works are solely
22 # in the form of machine-executable object code generated by a
23 # source language processor.
24 #
25 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26 # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
27 # SHALL PIXAR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
28 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31 # SOFTWARE.
32 #
33 # Pixar
34 # 1200 Park Ave
35 # Emeryville CA 94608
36 #
37 # ------------------------------------------------------------------------------
38 */
39 
40 #include "RixBxdf.h"
41 
43 {
44 public:
46  RixVolumeIntegrator(sCtx, f) {}
47  struct Params
48  {
49  Params() : _version(4), dmfp(NULL), mfp(NULL), bumpNormal(NULL),
50  continuationRays(0), followTopology(0.0f) {}
51 
52  int const _version;
53 
56  RtColorRGB const *albedo;
57  RixSCDetail albedoDetail;
58  RtColorRGB const *dmfp;
59  RixSCDetail dmfpDetail;
60  RtColorRGB const *mfp;
61  RixSCDetail mfpDetail;
62 
64  RtColorRGB const *color1, *color2, *color3;
65  RixSCDetail color1Detail, color2Detail, color3Detail;
66  RtFloat const *weight1, *weight2, *weight3;
67  RixSCDetail weight1Detail, weight2Detail, weight3Detail;
68  RtFloat const *dmfp1, *dmfp2, *dmfp3;
69  RixSCDetail dmfp1Detail, dmfp2Detail, dmfp3Detail;
70 
71  RtFloat unitLength;
72 
73  RtVector3 const *bumpNormal;
74 
76 
77  RtFloat followTopology;
78 
79  // future parameters will appear here.
80 
81  char _reserved[32];
82  };
83  virtual void GetNearestHits(RtInt nRays, RtRayGeometry const *rays,
84  RixRNG *rng,
85  RixBXLobeTraits const &lobesWanted,
86  RixIntegratorContext &iCtx,
87  RixLightingServices *lightingServices,
88  IntegratorDelegate *lcb,
89  RtInt *nGrps,
90  RixShadingContext const **shadeGrps,
91  char const *subset=NULL,
92  bool isLightPath=false,
93  RtHitSides hitSides=k_SidesBoth,
94  bool isPrimary=false
95  ) = 0;
96 
97 protected:
99  virtual ~RixSSDiffusion() {}
100 };
101 
102 class RixNullBsdf : public RixBsdf
103 {
104 public:
105  virtual RixBXEvaluateDomain GetEvaluateDomain() = 0;
106  virtual void GetAllLobeTraits(RixBXLobeTraits *) = 0;
107  virtual RtInt GetNumLobes() = 0;
108  virtual void GenerateSample(RixBXTransportTrait transportTrait,
109  RixBXLobeTraits const *lobesWanted,
110  RixRNG *rng,
111  RixBXLobeSampled *lobeSampled,
112  RtVector3 *sampleDirs,
113  RixBXLobeWeights &weights,
114  RtFloat *forwardPdfs, RtFloat *reversePdfs) = 0;
115  virtual void EvaluateSample(RixBXTransportTrait transportTrait,
116  RixBXLobeTraits const *lobesWanted,
117  RixBXLobeTraits *lobesEvaluated,
118  RtVector3 const *sampleDirs,
119  RixBXLobeWeights &weights,
120  RtFloat *forwardPdfs, RtFloat *reversePdfs) = 0;
121  virtual void EvaluateSamplesAtIndex(RixBXTransportTrait transportTrait,
122  RixBXLobeTraits const &lobesWanted,
123  RtInt index,
124  RtInt nSamples,
125  RixBXLobeTraits *lobesEvaluated,
126  RtVector3 const *sampleDirs,
127  RixBXLobeWeights &weights,
128  RtFloat *forwardPdfs, RtFloat *reversePdfs) = 0;
129 private:
130  // no parameters..
131  virtual ~RixNullBsdf() {}
132 };
133 
134 // RixLambertBxdf and RixDirac may go here...
135 
136 
137 #endif