1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 //    names, trademarks, service marks, or product names of the Licensor
11 //    and its affiliates, except as required to comply with Section 4(c) of
12 //    the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 //     http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HD_ENUMS_H
25 #define PXR_IMAGING_HD_ENUMS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 
30 PXR_NAMESPACE_OPEN_SCOPE
31 
32 /// \enum HdCompareFunction
33 ///
34 /// Abstraction of the Graphics compare functions.
35 ///
36 enum HdCompareFunction
37 {
38     HdCmpFuncNever,
39     HdCmpFuncLess,
40     HdCmpFuncEqual,
41     HdCmpFuncLEqual,
42     HdCmpFuncGreater,
43     HdCmpFuncNotEqual,
44     HdCmpFuncGEqual,
45     HdCmpFuncAlways,
46 
47     HdCmpFuncLast
48 };
49 
50 /// \enum HdStencilOp
51 ///
52 /// Abstraction of the Graphics stencil test operations.
53 ///
54 enum HdStencilOp
55 {
56     HdStencilOpKeep,
57     HdStencilOpZero,
58     HdStencilOpReplace,
59     HdStencilOpIncrement,
60     HdStencilOpIncrementWrap,
61     HdStencilOpDecrement,
62     HdStencilOpDecrementWrap,
63     HdStencilOpInvert,
64 
65     HdStencilOpLast
66 };
67 
68 /// \enum HdBlendOp
69 ///
70 /// Abstraction of the Graphics blend operations.
71 ///
72 enum HdBlendOp
73 {
74     HdBlendOpAdd,
75     HdBlendOpSubtract,
76     HdBlendOpReverseSubtract,
77     HdBlendOpMin,
78     HdBlendOpMax,
79 
80     HdBlendOpLast
81 };
82 
83 /// \enum HdBlendFactor
84 ///
85 /// Abstraction of the Graphics blend factors.
86 ///
87 enum HdBlendFactor
88 {
89     HdBlendFactorZero,
90     HdBlendFactorOne,
91     HdBlendFactorSrcColor,
92     HdBlendFactorOneMinusSrcColor,
93     HdBlendFactorDstColor,
94     HdBlendFactorOneMinusDstColor,
95     HdBlendFactorSrcAlpha,
96     HdBlendFactorOneMinusSrcAlpha,
97     HdBlendFactorDstAlpha,
98     HdBlendFactorOneMinusDstAlpha,
99     HdBlendFactorConstantColor,
100     HdBlendFactorOneMinusConstantColor,
101     HdBlendFactorConstantAlpha,
102     HdBlendFactorOneMinusConstantAlpha,
103     HdBlendFactorSrcAlphaSaturate,
104     HdBlendFactorSrc1Color,
105     HdBlendFactorOneMinusSrc1Color,
106     HdBlendFactorSrc1Alpha,
107     HdBlendFactorOneMinusSrc1Alpha,
108 
109     HdBlendFactorLast
110 };
111 
112 /// \enum HdCullStyle
113 ///
114 /// Face culling options.
115 ///
116 /// DontCare indicates this prim doesn't determine what should be culled.
117 /// Any other CullStyle opinion will override this (such as from the viewer).
118 ///
119 /// BackUnlessDoubleSided and FrontUnlessDoubleSided will only cull back or
120 /// front faces if prim isn't marked as doubleSided.
121 ///
122 enum HdCullStyle
123 {
124     HdCullStyleDontCare,
125     HdCullStyleNothing,
126     HdCullStyleBack,
127     HdCullStyleFront,
128     HdCullStyleBackUnlessDoubleSided,
129     HdCullStyleFrontUnlessDoubleSided
130 };
131 
132 /// Returns the opposite of the given cullstyle; backface culling becomes
133 /// frontface and vice versa.
134 HD_API
135 HdCullStyle HdInvertCullStyle(HdCullStyle cs);
136 
137 enum HdPolygonMode
138 {
139     HdPolygonModeFill,
140     HdPolygonModeLine
141 };
142 
143 /// \enum HdMeshGeomStyle
144 ///
145 /// Hydra native geom styles.
146 ///
147 enum HdMeshGeomStyle {
148     HdMeshGeomStyleInvalid,
149     HdMeshGeomStyleSurf,
150     HdMeshGeomStyleEdgeOnly,
151     HdMeshGeomStyleEdgeOnSurf,
152     HdMeshGeomStyleHull,
153     HdMeshGeomStyleHullEdgeOnly,
154     HdMeshGeomStyleHullEdgeOnSurf,
155     HdMeshGeomStylePoints
156 };
157 
158 enum HdBasisCurvesGeomStyle {
159     HdBasisCurvesGeomStyleInvalid,
160     HdBasisCurvesGeomStyleWire,
161     HdBasisCurvesGeomStylePatch,
162     HdBasisCurvesGeomStylePoints
163 };
164 
165 enum HdPointsGeomStyle {
166     HdPointsGeomStyleInvalid,
167     HdPointsGeomStylePoints
168 };
169 
170 ///
171 /// \enum HdInterpolation
172 ///
173 /// Enumerates Hydra's primvar interpolation modes.
174 ///
175 /// Constant:    One value remains constant over the entire surface primitive.
176 ///
177 /// Uniform:     One value remains constant for each uv patch segment of the
178 ///              surface primitive.
179 ///
180 /// Varying:     Four values are interpolated over each uv patch segment of
181 ///              the surface. Bilinear interpolation is used for interpolation
182 ///              between the four values.
183 ///
184 /// Vertex:      Values are interpolated between each vertex in the surface
185 ///              primitive. The basis function of the surface is used for
186 ///              interpolation between vertices.
187 ///
188 /// Facevarying: For polygons and subdivision surfaces, four values are
189 ///              interpolated over each face of the mesh. Bilinear interpolation
190 ///              is used for interpolation between the four values.
191 ///
192 /// Instance:    One value remains constant across each instance.
193 ///
194 enum HdInterpolation
195 {
196     HdInterpolationConstant = 0,
197     HdInterpolationUniform,
198     HdInterpolationVarying,
199     HdInterpolationVertex,
200     HdInterpolationFaceVarying,
201     HdInterpolationInstance,
202 
203     HdInterpolationCount
204 };
205 
206 ///
207 /// \enum HdTextureType
208 /// Enumerates Hydra's supported texture types.
209 ///
210 /// Uv:    Sample the uv coordinates and accesses a single 2d texture.
211 ///
212 /// Field: Transform coordinates by matrix before accessing a single 3d
213 ///        texture.
214 ///
215 /// Ptex:  Use the ptex connectivity information to sample a ptex texture.
216 ///
217 /// Udim:  Remap the uv coordinates into udim coordinates using a maximum
218 ///        tile width of 10 and sample all the udim tiles found in the
219 ///        file system.
220 ///
221 enum class HdTextureType
222 {
223     Uv,
224     Field,
225     Ptex,
226     Udim
227 };
228 
229 /// \enum HdDepthPriority
230 /// Sets the priorities for a depth based operation
231 ///
232 /// <ul>
233 ///     <li>HdDepthPriorityNearest     Prioritize objects nearest to the camera</li>
234 ///     <li>HdDepthPriorityFarthest    Prioritize objects farthest from the camera</li>
235 /// </ul>
236 ///
237 enum HdDepthPriority
238 {
239     HdDepthPriorityNearest = 0,
240     HdDepthPriorityFarthest,
241 
242     HdDepthPriorityCount
243 };
244 
245 PXR_NAMESPACE_CLOSE_SCOPE
246 
247 #endif // PXR_IMAGING_HD_ENUMS_H
248