All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
30 #include "pxr/base/tf/staticTokens.h"
31 
32 PXR_NAMESPACE_OPEN_SCOPE
33 
34 #define HD_TOKENS \
35  (accelerations) \
36  (adjacency) \
37  (bboxLocalMin) \
38  (bboxLocalMax) \
39  (bbox) \
40  (bezier) \
41  (bSpline) \
42  (camera) \
43  (catmullRom) \
44  (collection) \
45  (computeShader) \
46  (coordSysBindings) \
47  (cubic) \
48  (cullStyle) \
49  (doubleSided) \
50  (dispatchCount) \
51  (displayColor) \
52  (displayOpacity) \
53  (displayStyle) \
54  (drawDispatch) \
55  (drawingShader) \
56  (drawingCoord0) \
57  (drawingCoord1) \
58  (drawingCoord2) \
59  (drawingCoordI) \
60  (drivers) \
61  (edgeIndices) \
62  (elementCount) \
63  (elementsVisibility) \
64  (extent) \
65  (faceColors) \
66  (filters) \
67  (full) \
68  (geometry) \
69  (hermite) \
70  (hullIndices) \
71  (indices) \
72  (isFlipped) \
73  (itemsDrawn) \
74  (layout) \
75  (leftHanded) \
76  (linear) \
77  (lightLink) \
78  (lightFilterLink) \
79  (materialParams) \
80  (nonperiodic) \
81  (normals) \
82  (params) \
83  (patchParam) \
84  (periodic) \
85  (pinned) \
86  (points) \
87  (pointsIndices) \
88  (power) \
89  (preview) \
90  (pointsVisibility) \
91  (primvar) \
92  (primID) \
93  (primitiveParam) \
94  (quadInfo) \
95  (renderTags) \
96  (rightHanded) \
97  (segmented) \
98  (shadowLink) \
99  (subdivTags) \
100  (taskState) \
101  (taskParams) \
102  (topology) \
103  (topologyVisibility) \
104  (totalItemCount) \
105  (transform) \
106  (transformInverse) \
107  (velocities) \
108  (visibility) \
109  (widths)
110 
111 #define HD_INSTANCER_TOKENS \
112  (culledInstanceIndices) \
113  (instancer) \
114  (instancerTransform) \
115  (instancerTransformInverse) \
116  (instanceIndices) \
117  (instanceIndexBase) \
118  (instanceTransform) \
119  (rotate) \
120  (scale) \
121  (translate)
122 
123 #define HD_REPR_TOKENS \
124  (disabled) \
125  (hull) \
126  (points) \
127  (smoothHull) \
128  (refined) \
129  (refinedWire) \
130  (refinedWireOnSurf) \
131  (wire) \
132  (wireOnSurf)
133 
134 #define HD_PERF_TOKENS \
135  (adjacencyBufSize) \
136  (basisCurvesTopology) \
137  (bufferSourcesResolved) \
138  (bufferArrayRangeMigrated) \
139  (bufferArrayRangeContainerResized) \
140  (collectionsRefreshed) \
141  (computationsCommited) \
142  (drawBatches) \
143  (drawCalls) \
144  (dirtyLists) \
145  (dirtyListsRebuilt) \
146  (garbageCollected) \
147  (garbageCollectedSsbo) \
148  (garbageCollectedUbo) \
149  (garbageCollectedVbo) \
150  (glBufferSubData) \
151  (glCopyBufferSubData) \
152  (gpuMemoryUsed) \
153  (instBasisCurvesTopology) \
154  (instBasisCurvesTopologyRange) \
155  (instExtComputationDataRange) \
156  (instMeshTopology) \
157  (instMeshTopologyRange) \
158  (instPrimvarRange) \
159  (instVertexAdjacency) \
160  (meshTopology) \
161  (nonUniformSize) \
162  (numCompletedSamples) \
163  (quadrangulateCPU) \
164  (quadrangulateGPU) \
165  (quadrangulateFaceVarying) \
166  (quadrangulatedVerts) \
167  (rebuildBatches) \
168  (singleBufferSize) \
169  (ssboSize) \
170  (skipInvisibleRprimSync) \
171  (subdivisionRefineCPU) \
172  (subdivisionRefineGPU) \
173  (textureResourceMemory) \
174  (textureMemory) \
175  (triangulateFaceVarying) \
176  (uboSize) \
177  (vboRelocated)
178 
179 #define HD_SHADER_TOKENS \
180  (alphaThreshold) \
181  (clipPlanes) \
182  (commonShaderSource) \
183  (computeShader) \
184  (cullStyle) \
185  (drawRange) \
186  (environmentMap) \
187  (fragmentShader) \
188  (geometryShader) \
189  (indicatorColor) \
190  (lightingBlendAmount) \
191  (overrideColor) \
192  (maskColor) \
193  (projectionMatrix) \
194  (pointColor) \
195  (pointSize) \
196  (pointSelectedSize) \
197  (materialTag) \
198  (tessControlShader) \
199  (tessEvalShader) \
200  (tessLevel) \
201  (viewport) \
202  (vertexShader) \
203  (wireframeColor) \
204  (worldToViewMatrix) \
205  (worldToViewInverseMatrix)
206 
207 // Deprecated. Use: HdStMaterialTagTokens
208 #define HD_MATERIALTAG_TOKENS \
209  (defaultMaterialTag)
210 
211 /* Terminal keys used in material networks.
212  */
213 #define HD_MATERIAL_TERMINAL_TOKENS \
214  (surface) \
215  (displacement) \
216  (volume)
217 
218 #define HD_RENDERTAG_TOKENS \
219  (geometry) \
220  (guide) \
221  (hidden) \
222  (proxy) \
223  (render)
224 
225 #define HD_OPTION_TOKENS \
226  (parallelRprimSync)
227 
228 #define HD_PRIMTYPE_TOKENS \
229  /* Rprims */ \
230  (mesh) \
231  (basisCurves) \
232  (points) \
233  (volume) \
234  \
235  /* Sprims */ \
236  (camera) \
237  (drawTarget) \
238  (material) \
239  (coordSys) \
240  /* Sprims Lights */ \
241  (simpleLight) \
242  (cylinderLight) \
243  (diskLight) \
244  (distantLight) \
245  (domeLight) \
246  (lightFilter) \
247  (rectLight) \
248  (sphereLight) \
249  /* Sprims ExtComputations */ \
250  (extComputation) \
251  \
252  /* Bprims */ \
253  (texture) \
254  (renderBuffer)
255 
256 #define HD_PRIMVAR_ROLE_TOKENS \
257  ((none, "")) \
258  (color) \
259  (vector) \
260  (normal) \
261  (point) \
262  (textureCoordinate)
263 
264 /* Schema for "Alternate Output Values" rendering,
265  * describing which values a renderpass should
266  * compute and write at render time.
267  */
268 #define HD_AOV_TOKENS \
269  /* Standard rendering outputs */ \
270  \
271  /* HdAovTokens->color represents the final
272  * fragment RGBA color. For correct compositing
273  * using Hydra, it should have pre-multiplied alpha.
274  */ \
275  (color) \
276  /* HdAovTokens->depth represents the clip-space
277  * depth of the final fragment.
278  */ \
279  (depth) \
280  /* HdAovTokens->cameraDepth represents the camera-space
281  * depth of the final fragment.
282  */ \
283  (cameraDepth) \
284  /* ID rendering - these tokens represent the
285  * prim, instance, and subprim ids of the final
286  * fragment.
287  */ \
288  (primId) \
289  (instanceId) \
290  (elementId) \
291  (edgeId) \
292  (pointId) \
293  /* Geometric data */ \
294  (Peye) \
295  (Neye) \
296  (patchCoord) \
297  (primitiveParam) \
298  (normal) \
299  /* Others we might want to add:
300  * https://rmanwiki.pixar.com/display/REN/Arbitrary+Output+Variables
301  * - curvature
302  * - tangent
303  * - velocity
304  */ \
305  /* Primvars:
306  * The tokens don't try to enumerate primvars,
307  * but instead provide an identifying namespace.
308  * The "color" primvar is addressable as "primvars:color".
309  */ \
310  ((primvars, "primvars:")) \
311  /* Light path expressions:
312  * Applicable only to raytracers, these tell
313  * the renderer to output specific shading
314  * components for specific classes of lightpath.
315  *
316  * Lightpath syntax is defined here:
317  * https://rmanwiki.pixar.com/display/REN/Light+Path+Expressions
318  * ... so for example, you could specify
319  * "lpe:CD[<L.>O]"
320  */ \
321  ((lpe, "lpe:")) \
322  /* Shader signals:
323  * This tells the renderer to output a partial shading signal,
324  * whether from the BXDF (e.g. bxdf.diffuse) or from an intermediate
325  * shading node (e.g. fractal.rgb).
326  * XXX: The exact format is TBD.
327  */ \
328  ((shader, "shader:"))
329 
330 HD_API
331 TfToken HdAovTokensMakePrimvar(TfToken const& primvar);
332 
333 HD_API
334 TfToken HdAovTokensMakeLpe(TfToken const& lpe);
335 
336 HD_API
337 TfToken HdAovTokensMakeShader(TfToken const& shader);
338 
339 /* Schema for application-configurable render settings. */
340 #define HD_RENDER_SETTINGS_TOKENS \
341  /* General graphical options */ \
342  (enableShadows) \
343  (enableSceneMaterials) \
344  (enableSceneLights) \
345  /* Raytracer sampling settings */ \
346  (convergedVariance) \
347  (convergedSamplesPerPixel) \
348  /* thread limit settings */ \
349  (threadLimit)
350 
351 #define HD_RESOURCE_TYPE_TOKENS \
352  (texture)
353 
354 TF_DECLARE_PUBLIC_TOKENS(HdTokens, HD_API, HD_TOKENS);
355 TF_DECLARE_PUBLIC_TOKENS(HdInstancerTokens, HD_API, HD_INSTANCER_TOKENS);
356 TF_DECLARE_PUBLIC_TOKENS(HdReprTokens, HD_API, HD_REPR_TOKENS);
357 TF_DECLARE_PUBLIC_TOKENS(HdPerfTokens, HD_API, HD_PERF_TOKENS);
358 TF_DECLARE_PUBLIC_TOKENS(HdShaderTokens, HD_API, HD_SHADER_TOKENS);
359 TF_DECLARE_PUBLIC_TOKENS(HdMaterialTagTokens, HD_API, HD_MATERIALTAG_TOKENS);
360 TF_DECLARE_PUBLIC_TOKENS(HdMaterialTerminalTokens, HD_API,
361  HD_MATERIAL_TERMINAL_TOKENS);
362 TF_DECLARE_PUBLIC_TOKENS(HdRenderTagTokens, HD_API, HD_RENDERTAG_TOKENS);
363 TF_DECLARE_PUBLIC_TOKENS(HdOptionTokens, HD_API, HD_OPTION_TOKENS);
364 TF_DECLARE_PUBLIC_TOKENS(HdPrimTypeTokens, HD_API, HD_PRIMTYPE_TOKENS);
365 TF_DECLARE_PUBLIC_TOKENS(HdPrimvarRoleTokens, HD_API, HD_PRIMVAR_ROLE_TOKENS);
366 TF_DECLARE_PUBLIC_TOKENS(HdAovTokens, HD_API, HD_AOV_TOKENS);
367 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsTokens, HD_API, HD_RENDER_SETTINGS_TOKENS);
368 TF_DECLARE_PUBLIC_TOKENS(HdResourceTypeTokens, HD_API, HD_RESOURCE_TYPE_TOKENS);
369 
370 PXR_NAMESPACE_CLOSE_SCOPE
371 
372 #endif //PXR_IMAGING_HD_TOKENS_H
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118