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