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