HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HwShaderGenerator.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_HWSHADERGENERATOR_H
7 #define MATERIALX_HWSHADERGENERATOR_H
8 
9 /// @file
10 /// Hardware shader generator base class
11 
13 
16 
18 
19 /*
20 The HW shader generators have a number of predefined variables (inputs and uniforms) with binding rules.
21 When these are used by a shader the application must bind them to the expected data. The following table is
22 a listing of the variables with a description of what data they should be bound to.
23 
24 However, different renderers can have different requirements on naming conventions for these variables.
25 In order to facilitate this the generators will use token substitution for naming the variables. The
26 first column below shows the token names that should be used in source code before the token substitution
27 is done. The second row shows the real identifier names that will be used by default after substitution.
28 An generator can override these identifier names in order to use a custom naming convention for these.
29 Overriding identifier names is done by changing the entries in the identifiers map given to the function
30 replaceIdentifiers(), which is handling the token substitution on a shader stage.
31 
32 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
33  TOKEN NAME DEFAULT IDENTIFIER NAME TYPE BINDING
34 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
35 
36 Vertex input variables :
37  $inPosition i_position vec3 Vertex position in object space
38  $inNormal i_normal vec3 Vertex normal in object space
39  $inTangent i_tangent vec3 Vertex tangent in object space
40  $inBitangent i_bitangent vec3 Vertex bitangent in object space
41  $inTexcoord_N i_texcoord_N vec2 Vertex texture coordinate for the N:th uv set
42  $inColor_N i_color_N vec4 Vertex color for the N:th color set (RGBA)
43 
44 Uniform variables :
45  $worldMatrix u_worldMatrix mat4 World transformation
46  $worldInverseMatrix u_worldInverseMatrix mat4 World transformation, inverted
47  $worldTransposeMatrix u_worldTransposeMatrix mat4 World transformation, transposed
48  $worldInverseTransposeMatrix u_worldInverseTransposeMatrix mat4 World transformation, inverted and transposed
49  $viewMatrix u_viewMatrix mat4 View transformation
50  $viewInverseMatrix u_viewInverseMatrix mat4 View transformation, inverted
51  $viewTransposeMatrix u_viewTransposeMatrix mat4 View transformation, transposed
52  $viewInverseTransposeMatrix u_viewInverseTransposeMatrix mat4 View transformation, inverted and transposed
53  $projectionMatrix u_projectionMatrix mat4 Projection transformation
54  $projectionInverseMatrix u_projectionInverseMatrix mat4 Projection transformation, inverted
55  $projectionTransposeMatrix u_projectionTransposeMatrix mat4 Projection transformation, transposed
56  $projectionInverseTransposeMatrix u_projectionInverseTransposeMatrix mat4 Projection transformation, inverted and transposed
57  $worldViewMatrix u_worldViewMatrix mat4 World-view transformation
58  $viewProjectionMatrix u_viewProjectionMatrix mat4 View-projection transformation
59  $worldViewProjectionMatrix u_worldViewProjectionMatrix mat4 World-view-projection transformation
60  $viewPosition u_viewPosition vec3 World-space position of the view (camera)
61  $viewDirection u_viewDirection vec3 World-space direction of the view (camera)
62  $frame u_frame float The current frame number as defined by the host application
63  $time u_time float The current time in seconds
64  $geomprop_<name> u_geomprop_<name> <type> A named property of given <type> where <name> is the name of the variable on the geometry
65  $numActiveLightSources u_numActiveLightSources int The number of currently active light sources. Note that in shader this is clamped against
66  the maximum allowed number of lights sources. The maximum number is set by the generation
67  option GenOptions.hwMaxActiveLightSources.
68  $lightData[] u_lightData[] struct Array of struct LightData holding parameters for active light sources.
69  The LightData struct is built dynamically depending on requirements for
70  bound light shaders.
71  $envMatrix u_envMatrix mat4 Rotation matrix for the environment.
72  $envIrradiance u_envIrradiance sampler2D Sampler for the texture used for diffuse environment lighting.
73  $envRadiance u_envRadiance sampler2D Sampler for the texture used for specular environment lighting.
74  $envLightIntensity u_envLightIntensity float Linear multiplier for environment lighting
75  $envRadianceMips u_envRadianceMips int Number of mipmaps used on the specular environment texture.
76  $envRadianceSamples u_envRadianceSamples int Samples to use if Filtered Importance Sampling is used for specular environment lighting.
77 
78 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
79 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
80 */
81 
82 /// HW specific identifiers.
83 namespace HW
84 {
85 /// Token identifiers
86 extern MX_GENSHADER_API const string T_IN_POSITION;
87 extern MX_GENSHADER_API const string T_IN_NORMAL;
88 extern MX_GENSHADER_API const string T_IN_TANGENT;
89 extern MX_GENSHADER_API const string T_IN_BITANGENT;
90 extern MX_GENSHADER_API const string T_IN_TEXCOORD;
91 extern MX_GENSHADER_API const string T_IN_GEOMPROP;
92 extern MX_GENSHADER_API const string T_IN_COLOR;
93 extern MX_GENSHADER_API const string T_POSITION_WORLD;
94 extern MX_GENSHADER_API const string T_NORMAL_WORLD;
95 extern MX_GENSHADER_API const string T_TANGENT_WORLD;
96 extern MX_GENSHADER_API const string T_BITANGENT_WORLD;
97 extern MX_GENSHADER_API const string T_POSITION_OBJECT;
98 extern MX_GENSHADER_API const string T_NORMAL_OBJECT;
99 extern MX_GENSHADER_API const string T_TANGENT_OBJECT;
100 extern MX_GENSHADER_API const string T_BITANGENT_OBJECT;
101 extern MX_GENSHADER_API const string T_TEXCOORD;
102 extern MX_GENSHADER_API const string T_COLOR;
103 extern MX_GENSHADER_API const string T_WORLD_MATRIX;
104 extern MX_GENSHADER_API const string T_WORLD_INVERSE_MATRIX;
105 extern MX_GENSHADER_API const string T_WORLD_TRANSPOSE_MATRIX;
107 extern MX_GENSHADER_API const string T_VIEW_MATRIX;
108 extern MX_GENSHADER_API const string T_VIEW_INVERSE_MATRIX;
109 extern MX_GENSHADER_API const string T_VIEW_TRANSPOSE_MATRIX;
111 extern MX_GENSHADER_API const string T_PROJ_MATRIX;
112 extern MX_GENSHADER_API const string T_PROJ_INVERSE_MATRIX;
113 extern MX_GENSHADER_API const string T_PROJ_TRANSPOSE_MATRIX;
115 extern MX_GENSHADER_API const string T_WORLD_VIEW_MATRIX;
116 extern MX_GENSHADER_API const string T_VIEW_PROJECTION_MATRIX;
118 extern MX_GENSHADER_API const string T_VIEW_POSITION;
119 extern MX_GENSHADER_API const string T_VIEW_DIRECTION;
120 extern MX_GENSHADER_API const string T_FRAME;
121 extern MX_GENSHADER_API const string T_TIME;
122 extern MX_GENSHADER_API const string T_GEOMPROP;
123 extern MX_GENSHADER_API const string T_ALPHA_THRESHOLD;
124 extern MX_GENSHADER_API const string T_NUM_ACTIVE_LIGHT_SOURCES;
125 extern MX_GENSHADER_API const string T_ENV_MATRIX;
126 extern MX_GENSHADER_API const string T_ENV_RADIANCE;
127 extern MX_GENSHADER_API const string T_ENV_RADIANCE_MIPS;
128 extern MX_GENSHADER_API const string T_ENV_RADIANCE_SAMPLES;
129 extern MX_GENSHADER_API const string T_ENV_IRRADIANCE;
130 extern MX_GENSHADER_API const string T_ENV_LIGHT_INTENSITY;
131 extern MX_GENSHADER_API const string T_ENV_PREFILTER_MIP;
132 extern MX_GENSHADER_API const string T_REFRACTION_TWO_SIDED;
133 extern MX_GENSHADER_API const string T_ALBEDO_TABLE;
134 extern MX_GENSHADER_API const string T_ALBEDO_TABLE_SIZE;
135 extern MX_GENSHADER_API const string T_AMB_OCC_MAP;
136 extern MX_GENSHADER_API const string T_AMB_OCC_GAIN;
137 extern MX_GENSHADER_API const string T_SHADOW_MAP;
138 extern MX_GENSHADER_API const string T_SHADOW_MATRIX;
139 extern MX_GENSHADER_API const string T_VERTEX_DATA_INSTANCE;
140 extern MX_GENSHADER_API const string T_LIGHT_DATA_INSTANCE;
141 
142 /// Default names for identifiers.
143 /// Replacing above tokens in final code.
144 extern MX_GENSHADER_API const string IN_POSITION;
145 extern MX_GENSHADER_API const string IN_NORMAL;
146 extern MX_GENSHADER_API const string IN_TANGENT;
147 extern MX_GENSHADER_API const string IN_BITANGENT;
148 extern MX_GENSHADER_API const string IN_TEXCOORD;
149 extern MX_GENSHADER_API const string IN_GEOMPROP;
150 extern MX_GENSHADER_API const string IN_COLOR;
151 extern MX_GENSHADER_API const string POSITION_WORLD;
152 extern MX_GENSHADER_API const string NORMAL_WORLD;
153 extern MX_GENSHADER_API const string TANGENT_WORLD;
154 extern MX_GENSHADER_API const string BITANGENT_WORLD;
155 extern MX_GENSHADER_API const string POSITION_OBJECT;
156 extern MX_GENSHADER_API const string NORMAL_OBJECT;
157 extern MX_GENSHADER_API const string TANGENT_OBJECT;
158 extern MX_GENSHADER_API const string BITANGENT_OBJECT;
159 extern MX_GENSHADER_API const string TEXCOORD;
160 extern MX_GENSHADER_API const string COLOR;
161 extern MX_GENSHADER_API const string WORLD_MATRIX;
162 extern MX_GENSHADER_API const string WORLD_INVERSE_MATRIX;
163 extern MX_GENSHADER_API const string WORLD_TRANSPOSE_MATRIX;
165 extern MX_GENSHADER_API const string VIEW_MATRIX;
166 extern MX_GENSHADER_API const string VIEW_INVERSE_MATRIX;
167 extern MX_GENSHADER_API const string VIEW_TRANSPOSE_MATRIX;
169 extern MX_GENSHADER_API const string PROJ_MATRIX;
170 extern MX_GENSHADER_API const string PROJ_INVERSE_MATRIX;
171 extern MX_GENSHADER_API const string PROJ_TRANSPOSE_MATRIX;
173 extern MX_GENSHADER_API const string WORLD_VIEW_MATRIX;
174 extern MX_GENSHADER_API const string VIEW_PROJECTION_MATRIX;
176 extern MX_GENSHADER_API const string VIEW_POSITION;
177 extern MX_GENSHADER_API const string VIEW_DIRECTION;
178 extern MX_GENSHADER_API const string FRAME;
179 extern MX_GENSHADER_API const string TIME;
180 extern MX_GENSHADER_API const string GEOMPROP;
181 extern MX_GENSHADER_API const string ALPHA_THRESHOLD;
182 extern MX_GENSHADER_API const string NUM_ACTIVE_LIGHT_SOURCES;
183 extern MX_GENSHADER_API const string ENV_MATRIX;
184 extern MX_GENSHADER_API const string ENV_RADIANCE;
185 extern MX_GENSHADER_API const string ENV_RADIANCE_MIPS;
186 extern MX_GENSHADER_API const string ENV_RADIANCE_SAMPLES;
187 extern MX_GENSHADER_API const string ENV_IRRADIANCE;
188 extern MX_GENSHADER_API const string ENV_LIGHT_INTENSITY;
189 extern MX_GENSHADER_API const string ENV_PREFILTER_MIP;
190 extern MX_GENSHADER_API const string REFRACTION_TWO_SIDED;
191 extern MX_GENSHADER_API const string ALBEDO_TABLE;
192 extern MX_GENSHADER_API const string ALBEDO_TABLE_SIZE;
193 extern MX_GENSHADER_API const string AMB_OCC_MAP;
194 extern MX_GENSHADER_API const string AMB_OCC_GAIN;
195 extern MX_GENSHADER_API const string SHADOW_MAP;
196 extern MX_GENSHADER_API const string SHADOW_MATRIX;
197 extern MX_GENSHADER_API const string VERTEX_DATA_INSTANCE;
198 extern MX_GENSHADER_API const string LIGHT_DATA_INSTANCE;
200 
201 /// Variable blocks names.
202 extern MX_GENSHADER_API const string VERTEX_INPUTS; // Geometric inputs for vertex stage.
203 extern MX_GENSHADER_API const string VERTEX_DATA; // Connector block for data transfer from vertex stage to pixel stage.
204 extern MX_GENSHADER_API const string PRIVATE_UNIFORMS; // Uniform inputs set privately by application.
205 extern MX_GENSHADER_API const string PUBLIC_UNIFORMS; // Uniform inputs visible in UI and set by user.
206 extern MX_GENSHADER_API const string LIGHT_DATA; // Uniform inputs for light sources.
207 extern MX_GENSHADER_API const string PIXEL_OUTPUTS; // Outputs from the main/pixel stage.
208 
209 /// Variable names for lighting parameters.
210 extern MX_GENSHADER_API const string CLOSURE_DATA_TYPE;
211 extern MX_GENSHADER_API const string CLOSURE_DATA_ARG;
212 extern MX_GENSHADER_API const string DIR_N;
213 extern MX_GENSHADER_API const string DIR_L;
214 extern MX_GENSHADER_API const string DIR_V;
215 extern MX_GENSHADER_API const string WORLD_POSITION;
216 extern MX_GENSHADER_API const string OCCLUSION;
217 
218 /// Attribute names.
219 extern MX_GENSHADER_API const string ATTR_TRANSPARENT;
220 
221 /// User data names.
222 extern MX_GENSHADER_API const string USER_DATA_LIGHT_SHADERS;
223 extern MX_GENSHADER_API const string USER_DATA_BINDING_CONTEXT;
224 
225 /// Type Descriptor for closure context data.
227 } // namespace HW
228 
229 namespace Stage
230 {
231 /// Identifier for vertex stage.
232 extern MX_GENSHADER_API const string VERTEX;
233 } // namespace Stage
234 
235 class HwLightShaders;
236 class HwShaderGenerator;
238 
239 /// Shared pointer to a HwLightShaders
240 using HwLightShadersPtr = shared_ptr<class HwLightShaders>;
241 /// Shared pointer to a HwShaderGenerator
242 using HwShaderGeneratorPtr = shared_ptr<class HwShaderGenerator>;
243 /// Shared pointer to a HwResourceBindingContext
244 using HwResourceBindingContextPtr = shared_ptr<class HwResourceBindingContext>;
245 
246 /// @class HwLightShaders
247 /// Hardware light shader user data
249 {
250  public:
251  /// Create and return a new instance.
253  {
254  return std::make_shared<HwLightShaders>();
255  }
256 
257  /// Bind a light shader to a light type id.
258  void bind(unsigned int type, ShaderNodePtr shader)
259  {
260  _shaders[type] = shader;
261  }
262 
263  /// Unbind a light shader previously bound to a light type id.
264  void unbind(unsigned int type)
265  {
266  _shaders.erase(type);
267  }
268 
269  /// Clear all light shaders previously bound.
270  void clear()
271  {
272  _shaders.clear();
273  }
274 
275  /// Return the light shader bound to the given light type,
276  /// or nullptr if not light shader is bound to this type.
277  const ShaderNode* get(unsigned int type) const
278  {
279  auto it = _shaders.find(type);
280  return it != _shaders.end() ? it->second.get() : nullptr;
281  }
282 
283  /// Return the map of bound light shaders.
284  const std::unordered_map<unsigned int, ShaderNodePtr>& get() const
285  {
286  return _shaders;
287  }
288 
289  protected:
290  std::unordered_map<unsigned int, ShaderNodePtr> _shaders;
291 };
292 
293 /// @class HwShaderGenerator
294 /// Base class for shader generators targeting HW rendering.
296 {
297  public:
298  /// Emit code for active light count definitions and uniforms
299  virtual void addStageLightingUniforms(GenContext& context, ShaderStage& stage) const;
300 
301  /// Return true if the node needs the ClosureData struct added
302  bool nodeNeedsClosureData(const ShaderNode& node) const override;
303 
304  /// Bind a light shader to a light type id, for usage in surface shaders created
305  /// by the generator. The lightTypeId should be a unique identifier for the light
306  /// type (node definition) and the same id should be used when setting light parameters on a
307  /// generated surface shader.
308  static void bindLightShader(const NodeDef& nodeDef, unsigned int lightTypeId, GenContext& context);
309 
310  /// Unbind a light shader previously bound to the given light type id.
311  static void unbindLightShader(unsigned int lightTypeId, GenContext& context);
312 
313  /// Unbind all light shaders previously bound.
314  static void unbindLightShaders(GenContext& context);
315 
316  /// Determine the prefix of vertex data variables.
317  virtual string getVertexDataPrefix(const VariableBlock& vertexData) const = 0;
318 
319  // Note : the order must match the order defined in libraries/pbrlib/genglsl/lib/mx_closure_type.glsl
320  // TODO : investigate build time mechanism for ensuring these stay in sync.
321 
322  /// Types of closure contexts for HW.
324  {
331  CLOSURE
332  };
333 
334  protected:
335  HwShaderGenerator(TypeSystemPtr typeSystem, SyntaxPtr syntax);
336 
337  /// Create and initialize a new HW shader for shader generation.
338  virtual ShaderPtr createShader(const string& name, ElementPtr element, GenContext& context) const;
339 };
340 
341 /// @class HwImplementation
342 /// Base class for HW node implementations.
344 {
345  public:
346  bool isEditable(const ShaderInput& input) const override;
347 
348  protected:
350 
351  // Integer identifiers for coordinate spaces.
352  // The order must match the order given for the space enum string in stdlib.
353  enum Space
354  {
355  MODEL_SPACE = 0,
356  OBJECT_SPACE = 1,
357  WORLD_SPACE = 2
358  };
359 
360  /// Internal string constants
361  static const string SPACE;
362  static const string INDEX;
363  static const string GEOMPROP;
364 };
365 
366 /// @class HwResourceBindingContext
367 /// Class representing a context for resource binding for hardware resources.
369 {
370  public:
372 
373  // Initialize the context before generation starts.
374  virtual void initialize() = 0;
375 
376  // Emit directives required for binding support
377  virtual void emitDirectives(GenContext& context, ShaderStage& stage) = 0;
378 
379  // Emit uniforms with binding information
380  virtual void emitResourceBindings(GenContext& context, const VariableBlock& uniforms, ShaderStage& stage) = 0;
381 
382  // Emit struct uniforms with binding information
383  virtual void emitStructuredResourceBindings(GenContext& context, const VariableBlock& uniforms,
384  ShaderStage& stage, const std::string& structInstanceName,
385  const std::string& arraySuffix = EMPTY_STRING) = 0;
386 };
387 
389 
390 #endif
MX_GENSHADER_API const string DIR_V
MX_GENSHADER_API const string CLOSURE_DATA_TYPE
Variable names for lighting parameters.
type
Definition: core.h:556
MX_GENSHADER_API const string USER_DATA_LIGHT_SHADERS
User data names.
MX_GENSHADER_API const string T_NORMAL_WORLD
MX_GENSHADER_API const TypeDesc ClosureDataType
Type Descriptor for closure context data.
ClosureContextType
Types of closure contexts for HW.
MX_GENSHADER_API const string VIEW_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_TIME
void clear()
Clear all light shaders previously bound.
MX_GENSHADER_API const string LIGHT_DATA_INSTANCE
MX_GENSHADER_API const string T_REFRACTION_TWO_SIDED
virtual bool nodeNeedsClosureData(const ShaderNode &) const
Return true if the node needs the additional ClosureData added.
MX_GENSHADER_API const string T_WORLD_TRANSPOSE_MATRIX
MX_GENSHADER_API const string ALBEDO_TABLE
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
MX_GENSHADER_API const string T_VIEW_MATRIX
MX_GENSHADER_API const string GEOMPROP
MX_GENSHADER_API const string VIEW_INVERSE_MATRIX
MX_GENSHADER_API const string PROJ_INVERSE_MATRIX
static const string SPACE
Internal string constants.
MX_GENSHADER_API const string PROJ_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_WORLD_MATRIX
MX_GENSHADER_API const string T_ENV_RADIANCE
MX_GENSHADER_API const string PUBLIC_UNIFORMS
MX_GENSHADER_API const string ENV_RADIANCE_SAMPLES
MX_GENSHADER_API const string VERTEX_INPUTS
Variable blocks names.
static const string INDEX
MX_GENSHADER_API const string T_ALBEDO_TABLE_SIZE
Uses the stage's time code range.
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
Definition: Syntax.h:28
MX_GENSHADER_API const string IN_BITANGENT
MX_GENSHADER_API const string T_ENV_IRRADIANCE
MX_GENSHADER_API const string ATTR_TRANSPARENT
Attribute names.
MX_GENSHADER_API const string T_ENV_PREFILTER_MIP
MX_GENSHADER_API const string TEXCOORD
MX_GENSHADER_API const string FRAME
#define MX_GENSHADER_API
Definition: Export.h:18
virtual bool isEditable(const ShaderInput &) const
MX_GENSHADER_API const string BITANGENT_WORLD
shared_ptr< class HwShaderGenerator > HwShaderGeneratorPtr
Shared pointer to a HwShaderGenerator.
MX_GENSHADER_API const string ENV_RADIANCE_MIPS
MX_GENSHADER_API const string T_ENV_RADIANCE_MIPS
shared_ptr< class TypeSystem > TypeSystemPtr
Definition: TypeDesc.h:219
MX_GENSHADER_API const string LIGHT_DATA_MAX_LIGHT_SOURCES
MX_GENSHADER_API const string WORLD_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_NUM_ACTIVE_LIGHT_SOURCES
MX_GENSHADER_API const string DIR_L
MX_GENSHADER_API const string NORMAL_WORLD
MX_GENSHADER_API const string ENV_LIGHT_INTENSITY
MX_GENSHADER_API const string T_WORLD_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_AMB_OCC_MAP
MX_GENSHADER_API const string WORLD_POSITION
MX_GENSHADER_API const string IN_TEXCOORD
MX_GENSHADER_API const string T_SHADOW_MAP
MX_GENSHADER_API const string T_BITANGENT_WORLD
MX_GENSHADER_API const string PROJ_TRANSPOSE_MATRIX
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
static const string GEOMPROP
MX_GENSHADER_API const string T_VIEW_TRANSPOSE_MATRIX
MX_GENSHADER_API const string VIEW_POSITION
MX_GENSHADER_API const string T_AMB_OCC_GAIN
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
void unbind(unsigned int type)
Unbind a light shader previously bound to a light type id.
MX_GENSHADER_API const string T_VIEW_INVERSE_MATRIX
MX_GENSHADER_API const string DIR_N
shared_ptr< class ShaderNode > ShaderNodePtr
Shared pointer to a ShaderNode.
Definition: ShaderNode.h:35
MX_GENSHADER_API const string WORLD_MATRIX
MX_GENSHADER_API const string SHADOW_MAP
MX_GENSHADER_API const string T_IN_COLOR
MX_GENSHADER_API const string VIEW_PROJECTION_MATRIX
MX_GENSHADER_API const string IN_POSITION
MX_GENSHADER_API const string TIME
MX_GENSHADER_API const string VERTEX
Identifier for vertex stage.
MX_GENSHADER_API const string VIEW_TRANSPOSE_MATRIX
MX_GENSHADER_API const string AMB_OCC_GAIN
MX_GENSHADER_API const string T_POSITION_OBJECT
MX_GENSHADER_API const string T_SHADOW_MATRIX
MX_GENSHADER_API const string T_WORLD_INVERSE_MATRIX
MX_GENSHADER_API const string VIEW_DIRECTION
MX_GENSHADER_API const string IN_GEOMPROP
MX_GENSHADER_API const string T_VIEW_PROJECTION_MATRIX
MX_GENSHADER_API const string POSITION_WORLD
MX_GENSHADER_API const string ENV_PREFILTER_MIP
std::unordered_map< unsigned int, ShaderNodePtr > _shaders
GLuint const GLchar * name
Definition: glcorearb.h:786
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
MX_GENSHADER_API const string IN_TANGENT
MX_GENSHADER_API const string T_TANGENT_OBJECT
MX_GENSHADER_API const string WORLD_INVERSE_MATRIX
MX_GENSHADER_API const string PRIVATE_UNIFORMS
MX_GENSHADER_API const string T_PROJ_TRANSPOSE_MATRIX
MX_GENSHADER_API const string ENV_MATRIX
MX_GENSHADER_API const string T_POSITION_WORLD
MX_GENSHADER_API const string T_VIEW_POSITION
MX_GENSHADER_API const string T_TEXCOORD
MX_GENSHADER_API const string T_TANGENT_WORLD
MX_GENSHADER_API const string VERTEX_DATA
MX_GENSHADER_API const string TANGENT_OBJECT
MX_GENSHADER_API const string WORLD_VIEW_MATRIX
MX_GENSHADER_API const string ALBEDO_TABLE_SIZE
MX_GENSHADER_API const string T_ALPHA_THRESHOLD
MX_GENSHADER_API const string IN_NORMAL
MX_GENSHADER_API const string T_IN_TANGENT
GLuint shader
Definition: glcorearb.h:785
MX_GENSHADER_API const string T_WORLD_VIEW_PROJECTION_MATRIX
void bind(unsigned int type, ShaderNodePtr shader)
Bind a light shader to a light type id.
MX_GENSHADER_API const string T_ENV_MATRIX
MX_GENSHADER_API const string TANGENT_WORLD
MX_GENSHADER_API const string T_WORLD_VIEW_MATRIX
MX_GENSHADER_API const string AMB_OCC_MAP
MX_GENSHADER_API const string T_IN_TEXCOORD
MX_GENSHADER_API const string T_ENV_RADIANCE_SAMPLES
MX_GENSHADER_API const string SHADOW_MATRIX
MX_GENSHADER_API const string T_PROJ_INVERSE_MATRIX
MX_GENSHADER_API const string IN_COLOR
MX_GENSHADER_API const string CLOSURE_DATA_ARG
MX_GENSHADER_API const string T_IN_POSITION
Token identifiers.
MX_GENSHADER_API const string T_PROJ_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_COLOR
MX_GENSHADER_API const string T_GEOMPROP
MX_GENSHADER_API const string USER_DATA_BINDING_CONTEXT
MX_GENSHADER_API const string ENV_IRRADIANCE
MX_GENSHADER_API const string REFRACTION_TWO_SIDED
MX_GENSHADER_API const string T_BITANGENT_OBJECT
MX_GENSHADER_API const string ENV_RADIANCE
MX_GENSHADER_API const string T_IN_GEOMPROP
MX_GENSHADER_API const string NUM_ACTIVE_LIGHT_SOURCES
MX_GENSHADER_API const string T_IN_BITANGENT
MX_RENDER_API ShaderPtr createShader(const string &shaderName, GenContext &context, ElementPtr elem)
Create a shader for a given element.
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
Definition: Library.h:33
MX_GENSHADER_API const string PIXEL_OUTPUTS
MX_GENSHADER_API const string OCCLUSION
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
Definition: Element.h:31
MX_GENSHADER_API const string T_ALBEDO_TABLE
MX_GENSHADER_API const string VERTEX_DATA_INSTANCE
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
MX_GENSHADER_API const string PROJ_MATRIX
MX_GENSHADER_API const string T_VIEW_DIRECTION
MX_GENSHADER_API const string T_VERTEX_DATA_INSTANCE
MX_GENSHADER_API const string T_ENV_LIGHT_INTENSITY
MX_GENSHADER_API const string T_PROJ_MATRIX
shared_ptr< class HwLightShaders > HwLightShadersPtr
Shared pointer to a HwLightShaders.
MX_GENSHADER_API const string LIGHT_DATA
MX_GENSHADER_API const string NORMAL_OBJECT
MX_GENSHADER_API const string VIEW_MATRIX
MX_GENSHADER_API const string ALPHA_THRESHOLD
MX_GENSHADER_API const string WORLD_VIEW_PROJECTION_MATRIX
MX_GENSHADER_API const string WORLD_INVERSE_TRANSPOSE_MATRIX
static HwLightShadersPtr create()
Create and return a new instance.
MX_GENSHADER_API const string T_VIEW_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string COLOR
MX_GENSHADER_API const string T_FRAME
MX_GENSHADER_API const string T_LIGHT_DATA_INSTANCE
MX_GENSHADER_API const string POSITION_OBJECT
MX_GENSHADER_API const string T_NORMAL_OBJECT
MX_GENSHADER_API const string BITANGENT_OBJECT
MX_GENSHADER_API const string T_IN_NORMAL