HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tokens.h
Go to the documentation of this file.
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"
31 #include "pxr/base/tf/envSetting.h"
32 
34 
36 
37 #define HD_TOKENS \
38  (accelerations) \
39  (adjacency) \
40  (bboxLocalMin) \
41  (bboxLocalMax) \
42  (bbox) \
43  (bezier) \
44  (bspline) \
45  (blurScale) \
46  (camera) \
47  (catmullRom) \
48  (centripetalCatmullRom) \
49  (collection) \
50  (computeShader) \
51  (coordSysBindings) \
52  (cubic) \
53  (cullStyle) \
54  (doubleSided) \
55  (dispatchCount) \
56  (displayColor) \
57  (displayOpacity) \
58  (displayStyle) \
59  (drawDispatch) \
60  (drawingShader) \
61  (drawingCoord0) \
62  (drawingCoord1) \
63  (drawingCoord2) \
64  (drawingCoordI) \
65  (drivers) \
66  (edgeIndices) \
67  (elementCount) \
68  (elementsVisibility) \
69  (extent) \
70  (faceColors) \
71  (filters) \
72  (full) \
73  (geometry) \
74  (hermite) \
75  (hullIndices) \
76  (indices) \
77  (isFlipped) \
78  (itemsDrawn) \
79  (layout) \
80  (leftHanded) \
81  (linear) \
82  (lightLink) \
83  (lightFilterLink) \
84  (lightFilterType) \
85  (meshLight) \
86  (materialParams) \
87  (materialSyncMode) \
88  (nonlinearSampleCount) \
89  (nonperiodic) \
90  (normals) \
91  (params) \
92  (patchParam) \
93  (periodic) \
94  (pinned) \
95  (points) \
96  (pointsIndices) \
97  (portals) \
98  (power) \
99  (preview) \
100  (pointsVisibility) \
101  (primvar) \
102  (primID) \
103  (primitiveParam) \
104  (tessFactors) \
105  (quadInfo) \
106  (renderTags) \
107  (rightHanded) \
108  (segmented) \
109  (shadowLink) \
110  (subdivTags) \
111  (taskState) \
112  (taskParams) \
113  (topology) \
114  (topologyVisibility) \
115  (totalItemCount) \
116  (transform) \
117  (transformInverse) \
118  (velocities) \
119  (visibility) \
120  (widths) \
121  (isLight) \
122  \
123  /* Legacy tokens. */ \
124  \
125  /* bSpline is a legacy alias so that */ \
126  /* render delegates can compile without */ \
127  /* code change. The new token for */ \
128  /* bspline follows USD and has no */ \
129  /* capital letters. */ \
130  ((bSpline, "bspline"))
131 
132 #define HD_INSTANCER_TOKENS \
133  (culledInstanceIndices) \
134  (instancer) \
135  (instancerTransform) \
136  (instancerTransformInverse) \
137  (instanceIndices) \
138  (instanceIndexBase) \
139  \
140  /* New instance xform tokens */ \
141  ((instanceTransforms, "hydra:instanceTransforms")) \
142  ((instanceRotations, "hydra:instanceRotations")) \
143  ((instanceScales, "hydra:instanceScales")) \
144  ((instanceTranslations, "hydra:instanceTranslations")) \
145  \
146  /* Deprecated versions of the above */ \
147  /* To be removed in 2024, along with the */ \
148  /* HD_USE_DEPRECATED_INSTANCER_PRIMVAR_NAMES env var*/ \
149  (instanceTransform) \
150  (rotate) \
151  (scale) \
152  (translate)
153 
154 #define HD_REPR_TOKENS \
155  (disabled) \
156  (hull) \
157  (points) \
158  (smoothHull) \
159  (refined) \
160  (refinedWire) \
161  (refinedWireOnSurf) \
162  (wire) \
163  (wireOnSurf)
164 
165 #define HD_CULLSTYLE_TOKENS \
166  (dontCare) \
167  (nothing) \
168  (back) \
169  (front) \
170  (backUnlessDoubleSided) \
171  (frontUnlessDoubleSided)
172 
173 #define HD_MODEL_DRAWMODE_TOKENS \
174  (inherited) \
175  (origin) \
176  (bounds) \
177  (cards) \
178  ((default_, "default")) \
179  (cross) \
180  (box) \
181  (fromTexture)
182 
183 #define HD_PERF_TOKENS \
184  (adjacencyBufSize) \
185  (basisCurvesTopology) \
186  (bufferSourcesResolved) \
187  (bufferArrayRangeMigrated) \
188  (bufferArrayRangeContainerResized) \
189  (computationsCommited) \
190  (drawBatches) \
191  (drawCalls) \
192  (dirtyLists) \
193  (dirtyListsRebuilt) \
194  (garbageCollected) \
195  (garbageCollectedSsbo) \
196  (garbageCollectedUbo) \
197  (garbageCollectedVbo) \
198  (gpuMemoryUsed) \
199  (instBasisCurvesTopology) \
200  (instBasisCurvesTopologyRange) \
201  (instExtComputationDataRange) \
202  (instMeshTopology) \
203  (instMeshTopologyRange) \
204  (instPrimvarRange) \
205  (instVertexAdjacency) \
206  (meshTopology) \
207  (nonUniformSize) \
208  (numCompletedSamples) \
209  (quadrangulateCPU) \
210  (quadrangulateGPU) \
211  (quadrangulateFaceVarying) \
212  (quadrangulatedVerts) \
213  (rebuildBatches) \
214  (singleBufferSize) \
215  (ssboSize) \
216  (skipInvisibleRprimSync) \
217  (subdivisionRefineCPU) \
218  (subdivisionRefineGPU) \
219  (textureMemory) \
220  (triangulateFaceVarying) \
221  (uboSize) \
222  (vboRelocated)
223 
224 // XXX Move to hdSt.
225 #define HD_SHADER_TOKENS \
226  (alphaThreshold) \
227  (clipPlanes) \
228  (commonShaderSource) \
229  (computeShader) \
230  (cullStyle) \
231  (drawRange) \
232  (environmentMap) \
233  (displacementShader) \
234  (fragmentShader) \
235  (geometryShader) \
236  (imageToWorldMatrix) \
237  (imageToHorizontallyNormalizedFilmback) \
238  (indicatorColor) \
239  (lightingBlendAmount) \
240  (overrideColor) \
241  (maskColor) \
242  (projectionMatrix) \
243  (pointColor) \
244  (pointSize) \
245  (pointSelectedSize) \
246  (materialTag) \
247  (numClipPlanes) \
248  (tessControlShader) \
249  (tessEvalShader) \
250  (postTessControlShader) \
251  (postTessVertexShader) \
252  (tessLevel) \
253  (viewport) \
254  (vertexShader) \
255  (wireframeColor) \
256  (worldToViewMatrix) \
257  (worldToViewInverseMatrix) \
258  (stepSize) \
259  (stepSizeLighting)
260 
261 // Deprecated. Use: HdStMaterialTagTokens
262 #define HD_MATERIALTAG_TOKENS \
263  (defaultMaterialTag)
264 
265 /* Terminal keys used in material networks.
266  */
267 #define HD_MATERIAL_TERMINAL_TOKENS \
268  (surface) \
269  (displacement) \
270  (volume) \
271  (light) \
272  (lightFilter)
273 
274 #define HD_RENDERTAG_TOKENS \
275  (geometry) \
276  (guide) \
277  (hidden) \
278  (proxy) \
279  (render) \
280  (widget)
281 
282 #define HD_RENDER_CONTEXT_TOKENS \
283  ((universal, ""))
284 
285 #define HD_OPTION_TOKENS \
286  (parallelRprimSync)
287 
288 #define HD_RPRIMTYPE_TOKENS \
289  /* Rprims */ \
290  (capsule) \
291  (capsule_1) \
292  (cone) \
293  (cube) \
294  (cylinder) \
295  (cylinder_1) \
296  (mesh) \
297  (nurbsPatch) \
298  (basisCurves) \
299  (nurbsCurves) \
300  (points) \
301  (sphere) \
302  (volume) \
303  (model)
304 
305 #define HD_SPRIMTYPE_TOKENS \
306  /* Sprims */ \
307  (camera) \
308  (drawTarget) \
309  (material) \
310  (coordSys) \
311  (instancer) \
312  (instance) \
313  (integrator) \
314  (sampleFilter) \
315  (displayFilter) \
316  (imageShader) \
317  /* Sprims Lights */ \
318  (simpleLight) \
319  (cylinderLight) \
320  (diskLight) \
321  (distantLight) \
322  (domeLight) \
323  (light) \
324  (lightFilter) \
325  (meshLight) \
326  (pluginLight) \
327  (rectLight) \
328  (sphereLight) \
329  /* Sprims ExtComputations */ \
330  (extComputation) \
331 
332 #define HD_BPRIMTYPE_TOKENS \
333  /* Bprims */ \
334  (renderBuffer) \
335  (renderSettings)
336 
337 #define HD_PRIMTYPE_TOKENS \
338  HD_RPRIMTYPE_TOKENS \
339  HD_SPRIMTYPE_TOKENS \
340  HD_BPRIMTYPE_TOKENS \
341 
342 HD_API
343 bool HdPrimTypeIsGprim(TfToken const& primType);
344 
345 HD_API
346 bool HdPrimTypeIsLight(TfToken const& primType);
347 
348 HD_API
350 
351 #define HD_PRIMVAR_ROLE_TOKENS \
352  ((none, "")) \
353  (color) \
354  (vector) \
355  (normal) \
356  (point) \
357  (textureCoordinate)
358 
359 /* Schema for "Alternate Output Values" rendering,
360  * describing which values a renderpass should
361  * compute and write at render time.
362  */
363 #define HD_AOV_TOKENS \
364  /* Standard rendering outputs */ \
365  \
366  /* HdAovTokens->color represents the final
367  * fragment RGBA color. For correct compositing
368  * using Hydra, it should have pre-multiplied alpha.
369  */ \
370  (color) \
371  /* HdAovTokens->depth represents the clip-space
372  * depth of the final fragment.
373  */ \
374  (depth) \
375  /* HdAovTokens->depthStencil represents the clip-space
376  * depth of the final fragment w/ 8-bit stencil.
377  */ \
378  (depthStencil) \
379  /* HdAovTokens->cameraDepth represents the camera-space
380  * depth of the final fragment.
381  */ \
382  (cameraDepth) \
383  /* ID rendering - these tokens represent the
384  * prim, instance, and subprim ids of the final
385  * fragment.
386  */ \
387  (primId) \
388  (instanceId) \
389  (elementId) \
390  (edgeId) \
391  (pointId) \
392  /* Geometric data */ \
393  (Peye) \
394  (Neye) \
395  (patchCoord) \
396  (primitiveParam) \
397  (normal) \
398  /* Others we might want to add:
399  * https://rmanwiki.pixar.com/display/REN/Arbitrary+Output+Variables
400  * - curvature
401  * - tangent
402  * - velocity
403  */ \
404  /* Primvars:
405  * The tokens don't try to enumerate primvars,
406  * but instead provide an identifying namespace.
407  * The "color" primvar is addressable as "primvars:color".
408  */ \
409  ((primvars, "primvars:")) \
410  /* Light path expressions:
411  * Applicable only to raytracers, these tell
412  * the renderer to output specific shading
413  * components for specific classes of lightpath.
414  *
415  * Lightpath syntax is defined here:
416  * https://rmanwiki.pixar.com/display/REN/Light+Path+Expressions
417  * ... so for example, you could specify
418  * "lpe:CD[<L.>O]"
419  */ \
420  ((lpe, "lpe:")) \
421  /* Shader signals:
422  * This tells the renderer to output a partial shading signal,
423  * whether from the BXDF (e.g. bxdf.diffuse) or from an intermediate
424  * shading node (e.g. fractal.rgb).
425  * XXX: The exact format is TBD.
426  */ \
427  ((shader, "shader:"))
428 
429 HD_API
430 TfToken HdAovTokensMakePrimvar(TfToken const& primvar);
431 
432 HD_API
434 
435 HD_API
437 
438 /* Schema for application-configurable render settings. */
439 #define HD_RENDER_SETTINGS_TOKENS \
440  /* General graphical options */ \
441  (enableShadows) \
442  (enableSceneMaterials) \
443  (enableSceneLights) \
444  (domeLightCameraVisibility) \
445  /* Raytracer sampling settings */ \
446  (convergedVariance) \
447  (convergedSamplesPerPixel) \
448  /* thread limit settings */ \
449  (threadLimit) \
450  /* interactive vs offline */ \
451  (enableInteractive)
452 
453 #define HD_RENDER_SETTINGS_PRIM_TOKENS \
454  (active) \
455  (namespacedSettings) \
456  (renderProducts) \
457  (includedPurposes) \
458  (materialBindingPurposes) \
459  (renderingColorSpace) \
460  (shutterInterval)
461 
462 /* Aspect Ratio Conform Policy Tokens used on render settings prims
463  * Note that these mirror the conform policy tokens in UsdRenderTokens */
464 #define HD_ASPECT_RATIO_CONFORM_POLICY \
465  (adjustApertureWidth) \
466  (adjustApertureHeight) \
467  (expandAperture) \
468  (cropAperture) \
469  (adjustPixelAspectRatio) \
470 
471 #define HD_RESOURCE_TYPE_TOKENS \
472  (texture) \
473  (shaderFile)
474 
475 #define HD_SCENE_INDEX_EMULATION_TOKENS \
476  (sceneDelegate) \
477 
482 TF_DECLARE_PUBLIC_TOKENS(HdModelDrawModeTokens, HD_API,
487 TF_DECLARE_PUBLIC_TOKENS(HdMaterialTerminalTokens, HD_API,
499 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsPrimTokens, HD_API,
501 TF_DECLARE_PUBLIC_TOKENS(HdAspectRatioConformPolicyTokens, HD_API,
504 TF_DECLARE_PUBLIC_TOKENS(HdSceneIndexEmulationTokens, HD_API,
506 
508 
509 #endif //PXR_IMAGING_HD_TOKENS_H
#define HD_MATERIAL_TERMINAL_TOKENS
Definition: tokens.h:267
#define HD_REPR_TOKENS
Definition: tokens.h:154
HD_API const TfTokenVector & HdLightPrimTypeTokens()
#define HD_OPTION_TOKENS
Definition: tokens.h:285
#define HD_INSTANCER_TOKENS
Definition: tokens.h:132
HD_API TfToken HdAovTokensMakePrimvar(TfToken const &primvar)
HD_API TfToken HdAovTokensMakeShader(TfToken const &shader)
#define HD_API
Definition: api.h:40
HD_API bool HdPrimTypeIsLight(TfToken const &primType)
#define HD_BPRIMTYPE_TOKENS
Definition: tokens.h:332
#define HD_PERF_TOKENS
Definition: tokens.h:183
#define HD_MATERIALTAG_TOKENS
Definition: tokens.h:262
Definition: token.h:87
#define HD_MODEL_DRAWMODE_TOKENS
Definition: tokens.h:173
#define HD_SCENE_INDEX_EMULATION_TOKENS
Definition: tokens.h:475
#define HD_ASPECT_RATIO_CONFORM_POLICY
Definition: tokens.h:464
#define HD_RESOURCE_TYPE_TOKENS
Definition: tokens.h:471
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
#define HD_RENDERTAG_TOKENS
Definition: tokens.h:274
#define HD_PRIMTYPE_TOKENS
Definition: tokens.h:337
#define HD_RPRIMTYPE_TOKENS
Definition: tokens.h:288
ARCH_PRAGMA_PUSH ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS TF_DECLARE_PUBLIC_TOKENS(GusdTokens, GUSD_TOKENS)
GLuint shader
Definition: glcorearb.h:785
#define HD_TOKENS
Definition: tokens.h:37
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define HD_SPRIMTYPE_TOKENS
Definition: tokens.h:305
PXR_NAMESPACE_OPEN_SCOPE HD_API TfEnvSetting< bool > HD_USE_DEPRECATED_INSTANCER_PRIMVAR_NAMES
#define HD_RENDER_CONTEXT_TOKENS
Definition: tokens.h:282
HD_API TfToken HdAovTokensMakeLpe(TfToken const &lpe)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
#define HD_PRIMVAR_ROLE_TOKENS
Definition: tokens.h:351
#define HD_RENDER_SETTINGS_PRIM_TOKENS
Definition: tokens.h:453
#define HD_SHADER_TOKENS
Definition: tokens.h:225
#define HD_CULLSTYLE_TOKENS
Definition: tokens.h:165
#define HD_AOV_TOKENS
Definition: tokens.h:363
#define HD_RENDER_SETTINGS_TOKENS
Definition: tokens.h:439
HD_API bool HdPrimTypeIsGprim(TfToken const &primType)