All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tokens.h
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_TOKENS_H
25 #define PXR_IMAGING_HD_TOKENS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/base/tf/staticTokens.h"
31 
32 PXR_NAMESPACE_OPEN_SCOPE
33 
34 #define HD_TOKENS \
35  (accelerations) \
36  (adjacency) \
37  (bboxLocalMin) \
38  (bboxLocalMax) \
39  (bbox) \
40  (bezier) \
41  (bSpline) \
42  (camera) \
43  (catmullRom) \
44  (collection) \
45  (computeShader) \
46  (coordSysBindings) \
47  (cubic) \
48  (cullStyle) \
49  (doubleSided) \
50  (dispatchCount) \
51  (displayColor) \
52  (displayOpacity) \
53  (displayStyle) \
54  (drawDispatch) \
55  (drawingShader) \
56  (drawingCoord0) \
57  (drawingCoord1) \
58  (drawingCoord2) \
59  (drawingCoordI) \
60  (edgeIndices) \
61  (elementCount) \
62  (elementsVisibility) \
63  (extent) \
64  (faceColors) \
65  (filters) \
66  (full) \
67  (geometry) \
68  (hermite) \
69  (hullIndices) \
70  (indices) \
71  (isFlipped) \
72  (itemsDrawn) \
73  (layout) \
74  (leftHanded) \
75  (linear) \
76  (lightLink) \
77  (materialParams) \
78  (nonperiodic) \
79  (normals) \
80  (params) \
81  (patchParam) \
82  (periodic) \
83  (points) \
84  (pointsIndices) \
85  (power) \
86  (preview) \
87  (pointsVisibility) \
88  (primvar) \
89  (primID) \
90  (primitiveParam) \
91  (quadInfo) \
92  (renderTags) \
93  (rightHanded) \
94  (segmented) \
95  (shadowLink) \
96  (subdivTags) \
97  (taskState) \
98  (taskParams) \
99  (topology) \
100  (topologyVisibility) \
101  (totalItemCount) \
102  (transform) \
103  (transformInverse) \
104  (velocities) \
105  (visibility) \
106  (widths)
107 
108 #define HD_INSTANCER_TOKENS \
109  (culledInstanceIndices) \
110  (instancer) \
111  (instancerTransform) \
112  (instancerTransformInverse) \
113  (instanceIndices) \
114  (instanceIndexBase) \
115  (instanceTransform) \
116  (rotate) \
117  (scale) \
118  (translate)
119 
120 #define HD_REPR_TOKENS \
121  (disabled) \
122  (hull) \
123  (points) \
124  (smoothHull) \
125  (refined) \
126  (refinedWire) \
127  (refinedWireOnSurf) \
128  (wire) \
129  (wireOnSurf)
130 
131 #define HD_PERF_TOKENS \
132  (adjacencyBufSize) \
133  (basisCurvesTopology) \
134  (bufferSourcesResolved) \
135  (bufferArrayRangeMerged) \
136  (bufferArrayRangeContainerResized) \
137  (collectionsRefreshed) \
138  (computationsCommited) \
139  (drawBatches) \
140  (drawCalls) \
141  (dirtyLists) \
142  (dirtyListsRebuilt) \
143  (garbageCollected) \
144  (garbageCollectedSsbo) \
145  (garbageCollectedUbo) \
146  (garbageCollectedVbo) \
147  (glBufferSubData) \
148  (glCopyBufferSubData) \
149  (gpuMemoryUsed) \
150  (instBasisCurvesTopology) \
151  (instBasisCurvesTopologyRange) \
152  (instExtComputationDataRange) \
153  (instMeshTopology) \
154  (instMeshTopologyRange) \
155  (instPrimvarRange) \
156  (instVertexAdjacency) \
157  (meshTopology) \
158  (nonUniformSize) \
159  (numCompletedSamples) \
160  (quadrangulateCPU) \
161  (quadrangulateGPU) \
162  (quadrangulateFaceVarying) \
163  (quadrangulatedVerts) \
164  (rebuildBatches) \
165  (singleBufferSize) \
166  (ssboSize) \
167  (skipInvisibleRprimSync) \
168  (subdivisionRefineCPU) \
169  (subdivisionRefineGPU) \
170  (textureResourceMemory) \
171  (textureMemory) \
172  (triangulateFaceVarying) \
173  (uboSize) \
174  (vboRelocated)
175 
176 #define HD_SHADER_TOKENS \
177  (alphaThreshold) \
178  (clipPlanes) \
179  (commonShaderSource) \
180  (computeShader) \
181  (cullStyle) \
182  (drawRange) \
183  (environmentMap) \
184  (fragmentShader) \
185  (geometryShader) \
186  (indicatorColor) \
187  (lightingBlendAmount) \
188  (overrideColor) \
189  (maskColor) \
190  (projectionMatrix) \
191  (pointColor) \
192  (pointSize) \
193  (pointSelectedSize) \
194  (materialTag) \
195  (tessControlShader) \
196  (tessEvalShader) \
197  (tessLevel) \
198  (viewport) \
199  (vertexShader) \
200  (wireframeColor) \
201  (worldToViewMatrix) \
202  (worldToViewInverseMatrix)
203 
204 // Deprecated. Use: HdStMaterialTagTokens
205 #define HD_MATERIALTAG_TOKENS \
206  (defaultMaterialTag)
207 
208 /* Terminal keys used in material networks.
209  */
210 #define HD_MATERIAL_TERMINAL_TOKENS \
211  (surface) \
212  (displacement) \
213  (volume)
214 
215 #define HD_RENDERTAG_TOKENS \
216  (geometry) \
217  (guide) \
218  (hidden) \
219  (proxy) \
220  (render)
221 
222 #define HD_OPTION_TOKENS \
223  (parallelRprimSync)
224 
225 #define HD_PRIMTYPE_TOKENS \
226  /* Rprims */ \
227  (mesh) \
228  (basisCurves) \
229  (points) \
230  (volume) \
231  \
232  /* Sprims */ \
233  (camera) \
234  (drawTarget) \
235  (material) \
236  (coordSys) \
237  /* Sprims Lights */ \
238  (simpleLight) \
239  (cylinderLight) \
240  (diskLight) \
241  (distantLight) \
242  (domeLight) \
243  (rectLight) \
244  (sphereLight) \
245  /* Sprims ExtComputations */ \
246  (extComputation) \
247  \
248  /* Bprims */ \
249  (texture) \
250  (renderBuffer)
251 
252 #define HD_PRIMVAR_ROLE_TOKENS \
253  ((none, "")) \
254  (color) \
255  (vector) \
256  (normal) \
257  (point) \
258  (textureCoordinate)
259 
260 /* Schema for "Alternate Output Values" rendering,
261  * describing which values a renderpass should
262  * compute and write at render time.
263  */
264 #define HD_AOV_TOKENS \
265  /* Standard rendering outputs */ \
266  \
267  /* HdAovTokens->color represents the final
268  * fragment RGBA color. For correct compositing
269  * using Hydra, it should have pre-multiplied alpha.
270  */ \
271  (color) \
272  /* HdAovTokens->depth represents the clip-space
273  * depth of the final fragment.
274  */ \
275  (depth) \
276  /* HdAovTokens->cameraDepth represents the camera-space
277  * depth of the final fragment.
278  */ \
279  (cameraDepth) \
280  /* ID rendering - these tokens represent the
281  * prim, instance, and subprim ids of the final
282  * fragment.
283  */ \
284  (primId) \
285  (instanceId) \
286  (elementId) \
287  (edgeId) \
288  (pointId) \
289  /* Geometric data */ \
290  (Peye) \
291  (Neye) \
292  (patchCoord) \
293  (primitiveParam) \
294  (normal) \
295  /* Others we might want to add:
296  * https://rmanwiki.pixar.com/display/REN/Arbitrary+Output+Variables
297  * - curvature
298  * - tangent
299  * - velocity
300  */ \
301  /* Primvars:
302  * The tokens don't try to enumerate primvars,
303  * but instead provide an identifying namespace.
304  * The "color" primvar is addressable as "primvars:color".
305  */ \
306  ((primvars, "primvars:")) \
307  /* Light path expressions:
308  * Applicable only to raytracers, these tell
309  * the renderer to output specific shading
310  * components for specific classes of lightpath.
311  *
312  * Lightpath syntax is defined here:
313  * https://rmanwiki.pixar.com/display/REN/Light+Path+Expressions
314  * ... so for example, you could specify
315  * "lpe:CD[<L.>O]"
316  */ \
317  ((lpe, "lpe:")) \
318  /* Shader signals:
319  * This tells the renderer to output a partial shading signal,
320  * whether from the BXDF (e.g. bxdf.diffuse) or from an intermediate
321  * shading node (e.g. fractal.rgb).
322  * XXX: The exact format is TBD.
323  */ \
324  ((shader, "shader:"))
325 
326 HD_API
327 TfToken HdAovTokensMakePrimvar(TfToken const& primvar);
328 
329 HD_API
330 TfToken HdAovTokensMakeLpe(TfToken const& lpe);
331 
332 HD_API
333 TfToken HdAovTokensMakeShader(TfToken const& shader);
334 
335 /* Schema for application-configurable render settings. */
336 #define HD_RENDER_SETTINGS_TOKENS \
337  /* General graphical options */ \
338  (enableShadows) \
339  (enableSceneMaterials) \
340  (enableSceneLights) \
341  /* Raytracer sampling settings */ \
342  (convergedVariance) \
343  (convergedSamplesPerPixel) \
344  /* thread limit settings */ \
345  (threadLimit)
346 
347 TF_DECLARE_PUBLIC_TOKENS(HdTokens, HD_API, HD_TOKENS);
348 TF_DECLARE_PUBLIC_TOKENS(HdInstancerTokens, HD_API, HD_INSTANCER_TOKENS);
349 TF_DECLARE_PUBLIC_TOKENS(HdReprTokens, HD_API, HD_REPR_TOKENS);
350 TF_DECLARE_PUBLIC_TOKENS(HdPerfTokens, HD_API, HD_PERF_TOKENS);
351 TF_DECLARE_PUBLIC_TOKENS(HdShaderTokens, HD_API, HD_SHADER_TOKENS);
352 TF_DECLARE_PUBLIC_TOKENS(HdMaterialTagTokens, HD_API, HD_MATERIALTAG_TOKENS);
353 TF_DECLARE_PUBLIC_TOKENS(HdMaterialTerminalTokens, HD_API,
354  HD_MATERIAL_TERMINAL_TOKENS);
355 TF_DECLARE_PUBLIC_TOKENS(HdRenderTagTokens, HD_API, HD_RENDERTAG_TOKENS);
356 TF_DECLARE_PUBLIC_TOKENS(HdOptionTokens, HD_API, HD_OPTION_TOKENS);
357 TF_DECLARE_PUBLIC_TOKENS(HdPrimTypeTokens, HD_API, HD_PRIMTYPE_TOKENS);
358 TF_DECLARE_PUBLIC_TOKENS(HdPrimvarRoleTokens, HD_API, HD_PRIMVAR_ROLE_TOKENS);
359 TF_DECLARE_PUBLIC_TOKENS(HdAovTokens, HD_API, HD_AOV_TOKENS);
360 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsTokens, HD_API, HD_RENDER_SETTINGS_TOKENS);
361 
362 PXR_NAMESPACE_CLOSE_SCOPE
363 
364 #endif //PXR_IMAGING_HD_TOKENS_H
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118