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