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