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"
31
32PXR_NAMESPACE_OPEN_SCOPE
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
323HD_API
324bool HdPrimTypeIsGprim(TfToken const& primType);
325
326HD_API
327bool HdPrimTypeIsLight(TfToken const& primType);
328
329HD_API
330const TfTokenVector &HdLightPrimTypeTokens();
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
410HD_API
411TfToken HdAovTokensMakePrimvar(TfToken const& primvar);
412
413HD_API
414TfToken HdAovTokensMakeLpe(TfToken const& lpe);
415
416HD_API
417TfToken HdAovTokensMakeShader(TfToken const& shader);
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 (shutterInterval)
442
443#define HD_RESOURCE_TYPE_TOKENS \
444 (texture) \
445 (shaderFile)
446
447#define HD_SCENE_INDEX_EMULATION_TOKENS \
448 (sceneDelegate) \
449
450TF_DECLARE_PUBLIC_TOKENS(HdTokens, HD_API, HD_TOKENS);
451TF_DECLARE_PUBLIC_TOKENS(HdInstancerTokens, HD_API, HD_INSTANCER_TOKENS);
452TF_DECLARE_PUBLIC_TOKENS(HdReprTokens, HD_API, HD_REPR_TOKENS);
453TF_DECLARE_PUBLIC_TOKENS(HdCullStyleTokens, HD_API, HD_CULLSTYLE_TOKENS);
454TF_DECLARE_PUBLIC_TOKENS(HdModelDrawModeTokens, HD_API,
455 HD_MODEL_DRAWMODE_TOKENS);
456TF_DECLARE_PUBLIC_TOKENS(HdPerfTokens, HD_API, HD_PERF_TOKENS);
457TF_DECLARE_PUBLIC_TOKENS(HdShaderTokens, HD_API, HD_SHADER_TOKENS);
458TF_DECLARE_PUBLIC_TOKENS(HdMaterialTagTokens, HD_API, HD_MATERIALTAG_TOKENS);
459TF_DECLARE_PUBLIC_TOKENS(HdMaterialTerminalTokens, HD_API,
460 HD_MATERIAL_TERMINAL_TOKENS);
461TF_DECLARE_PUBLIC_TOKENS(HdRenderTagTokens, HD_API, HD_RENDERTAG_TOKENS);
462TF_DECLARE_PUBLIC_TOKENS(HdRenderContextTokens, HD_API, HD_RENDER_CONTEXT_TOKENS);
463TF_DECLARE_PUBLIC_TOKENS(HdOptionTokens, HD_API, HD_OPTION_TOKENS);
464TF_DECLARE_PUBLIC_TOKENS(HdRprimTypeTokens, HD_API, HD_RPRIMTYPE_TOKENS);
465TF_DECLARE_PUBLIC_TOKENS(HdSprimTypeTokens, HD_API, HD_SPRIMTYPE_TOKENS);
466TF_DECLARE_PUBLIC_TOKENS(HdBprimTypeTokens, HD_API, HD_BPRIMTYPE_TOKENS);
467TF_DECLARE_PUBLIC_TOKENS(HdPrimTypeTokens, HD_API, HD_PRIMTYPE_TOKENS);
468TF_DECLARE_PUBLIC_TOKENS(HdPrimvarRoleTokens, HD_API, HD_PRIMVAR_ROLE_TOKENS);
469TF_DECLARE_PUBLIC_TOKENS(HdAovTokens, HD_API, HD_AOV_TOKENS);
470TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsTokens, HD_API, HD_RENDER_SETTINGS_TOKENS);
471TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsPrimTokens, HD_API,
472 HD_RENDER_SETTINGS_PRIM_TOKENS);
473TF_DECLARE_PUBLIC_TOKENS(HdResourceTypeTokens, HD_API, HD_RESOURCE_TYPE_TOKENS);
474TF_DECLARE_PUBLIC_TOKENS(HdSceneIndexEmulationTokens, HD_API,
475 HD_SCENE_INDEX_EMULATION_TOKENS);
476
477PXR_NAMESPACE_CLOSE_SCOPE
478
479#endif //PXR_IMAGING_HD_TOKENS_H
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
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:115
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442