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 colum 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  $envRadianceMips u_envRadianceMips int Number of mipmaps used on the specular environment texture.
75  $envRadianceSamples u_envRadianceSamples int Samples to use if Filtered Importance Sampling is used for specular environment lighting.
76 
77 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
78 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
79 */
80 
81 /// HW specific identifiers.
82 namespace HW
83 {
84 /// Token identifiers
85 extern MX_GENSHADER_API const string T_IN_POSITION;
86 extern MX_GENSHADER_API const string T_IN_NORMAL;
87 extern MX_GENSHADER_API const string T_IN_TANGENT;
88 extern MX_GENSHADER_API const string T_IN_BITANGENT;
89 extern MX_GENSHADER_API const string T_IN_TEXCOORD;
90 extern MX_GENSHADER_API const string T_IN_GEOMPROP;
91 extern MX_GENSHADER_API const string T_IN_COLOR;
92 extern MX_GENSHADER_API const string T_POSITION_WORLD;
93 extern MX_GENSHADER_API const string T_NORMAL_WORLD;
94 extern MX_GENSHADER_API const string T_TANGENT_WORLD;
95 extern MX_GENSHADER_API const string T_BITANGENT_WORLD;
96 extern MX_GENSHADER_API const string T_POSITION_OBJECT;
97 extern MX_GENSHADER_API const string T_NORMAL_OBJECT;
98 extern MX_GENSHADER_API const string T_TANGENT_OBJECT;
99 extern MX_GENSHADER_API const string T_BITANGENT_OBJECT;
100 extern MX_GENSHADER_API const string T_TEXCOORD;
101 extern MX_GENSHADER_API const string T_COLOR;
102 extern MX_GENSHADER_API const string T_WORLD_MATRIX;
103 extern MX_GENSHADER_API const string T_WORLD_INVERSE_MATRIX;
104 extern MX_GENSHADER_API const string T_WORLD_TRANSPOSE_MATRIX;
106 extern MX_GENSHADER_API const string T_VIEW_MATRIX;
107 extern MX_GENSHADER_API const string T_VIEW_INVERSE_MATRIX;
108 extern MX_GENSHADER_API const string T_VIEW_TRANSPOSE_MATRIX;
110 extern MX_GENSHADER_API const string T_PROJ_MATRIX;
111 extern MX_GENSHADER_API const string T_PROJ_INVERSE_MATRIX;
112 extern MX_GENSHADER_API const string T_PROJ_TRANSPOSE_MATRIX;
114 extern MX_GENSHADER_API const string T_WORLD_VIEW_MATRIX;
115 extern MX_GENSHADER_API const string T_VIEW_PROJECTION_MATRIX;
117 extern MX_GENSHADER_API const string T_VIEW_POSITION;
118 extern MX_GENSHADER_API const string T_VIEW_DIRECTION;
119 extern MX_GENSHADER_API const string T_FRAME;
120 extern MX_GENSHADER_API const string T_TIME;
121 extern MX_GENSHADER_API const string T_GEOMPROP;
122 extern MX_GENSHADER_API const string T_ALPHA_THRESHOLD;
123 extern MX_GENSHADER_API const string T_NUM_ACTIVE_LIGHT_SOURCES;
124 extern MX_GENSHADER_API const string T_ENV_MATRIX;
125 extern MX_GENSHADER_API const string T_ENV_RADIANCE;
126 extern MX_GENSHADER_API const string T_ENV_RADIANCE_MIPS;
127 extern MX_GENSHADER_API const string T_ENV_RADIANCE_SAMPLES;
128 extern MX_GENSHADER_API const string T_ENV_IRRADIANCE;
129 extern MX_GENSHADER_API const string T_REFRACTION_TWO_SIDED;
130 extern MX_GENSHADER_API const string T_ALBEDO_TABLE;
131 extern MX_GENSHADER_API const string T_ALBEDO_TABLE_SIZE;
132 extern MX_GENSHADER_API const string T_AMB_OCC_MAP;
133 extern MX_GENSHADER_API const string T_AMB_OCC_GAIN;
134 extern MX_GENSHADER_API const string T_SHADOW_MAP;
135 extern MX_GENSHADER_API const string T_SHADOW_MATRIX;
136 extern MX_GENSHADER_API const string T_VERTEX_DATA_INSTANCE;
137 extern MX_GENSHADER_API const string T_LIGHT_DATA_INSTANCE;
138 
139 /// Default names for identifiers.
140 /// Replacing above tokens in final code.
141 extern MX_GENSHADER_API const string IN_POSITION;
142 extern MX_GENSHADER_API const string IN_NORMAL;
143 extern MX_GENSHADER_API const string IN_TANGENT;
144 extern MX_GENSHADER_API const string IN_BITANGENT;
145 extern MX_GENSHADER_API const string IN_TEXCOORD;
146 extern MX_GENSHADER_API const string IN_GEOMPROP;
147 extern MX_GENSHADER_API const string IN_COLOR;
148 extern MX_GENSHADER_API const string POSITION_WORLD;
149 extern MX_GENSHADER_API const string NORMAL_WORLD;
150 extern MX_GENSHADER_API const string TANGENT_WORLD;
151 extern MX_GENSHADER_API const string BITANGENT_WORLD;
152 extern MX_GENSHADER_API const string POSITION_OBJECT;
153 extern MX_GENSHADER_API const string NORMAL_OBJECT;
154 extern MX_GENSHADER_API const string TANGENT_OBJECT;
155 extern MX_GENSHADER_API const string BITANGENT_OBJECT;
156 extern MX_GENSHADER_API const string TEXCOORD;
157 extern MX_GENSHADER_API const string COLOR;
158 extern MX_GENSHADER_API const string WORLD_MATRIX;
159 extern MX_GENSHADER_API const string WORLD_INVERSE_MATRIX;
160 extern MX_GENSHADER_API const string WORLD_TRANSPOSE_MATRIX;
162 extern MX_GENSHADER_API const string VIEW_MATRIX;
163 extern MX_GENSHADER_API const string VIEW_INVERSE_MATRIX;
164 extern MX_GENSHADER_API const string VIEW_TRANSPOSE_MATRIX;
166 extern MX_GENSHADER_API const string PROJ_MATRIX;
167 extern MX_GENSHADER_API const string PROJ_INVERSE_MATRIX;
168 extern MX_GENSHADER_API const string PROJ_TRANSPOSE_MATRIX;
170 extern MX_GENSHADER_API const string WORLD_VIEW_MATRIX;
171 extern MX_GENSHADER_API const string VIEW_PROJECTION_MATRIX;
173 extern MX_GENSHADER_API const string VIEW_POSITION;
174 extern MX_GENSHADER_API const string VIEW_DIRECTION;
175 extern MX_GENSHADER_API const string FRAME;
176 extern MX_GENSHADER_API const string TIME;
177 extern MX_GENSHADER_API const string GEOMPROP;
178 extern MX_GENSHADER_API const string ALPHA_THRESHOLD;
179 extern MX_GENSHADER_API const string NUM_ACTIVE_LIGHT_SOURCES;
180 extern MX_GENSHADER_API const string ENV_MATRIX;
181 extern MX_GENSHADER_API const string ENV_RADIANCE;
182 extern MX_GENSHADER_API const string ENV_RADIANCE_MIPS;
183 extern MX_GENSHADER_API const string ENV_RADIANCE_SAMPLES;
184 extern MX_GENSHADER_API const string ENV_IRRADIANCE;
185 extern MX_GENSHADER_API const string REFRACTION_TWO_SIDED;
186 extern MX_GENSHADER_API const string ALBEDO_TABLE;
187 extern MX_GENSHADER_API const string ALBEDO_TABLE_SIZE;
188 extern MX_GENSHADER_API const string AMB_OCC_MAP;
189 extern MX_GENSHADER_API const string AMB_OCC_GAIN;
190 extern MX_GENSHADER_API const string SHADOW_MAP;
191 extern MX_GENSHADER_API const string SHADOW_MATRIX;
192 extern MX_GENSHADER_API const string VERTEX_DATA_INSTANCE;
193 extern MX_GENSHADER_API const string LIGHT_DATA_INSTANCE;
195 
196 /// Variable blocks names.
197 extern MX_GENSHADER_API const string VERTEX_INPUTS; // Geometric inputs for vertex stage.
198 extern MX_GENSHADER_API const string VERTEX_DATA; // Connector block for data transfer from vertex stage to pixel stage.
199 extern MX_GENSHADER_API const string PRIVATE_UNIFORMS; // Uniform inputs set privately by application.
200 extern MX_GENSHADER_API const string PUBLIC_UNIFORMS; // Uniform inputs visible in UI and set by user.
201 extern MX_GENSHADER_API const string LIGHT_DATA; // Uniform inputs for light sources.
202 extern MX_GENSHADER_API const string PIXEL_OUTPUTS; // Outputs from the main/pixel stage.
203 
204 /// Variable names for lighting parameters.
205 extern MX_GENSHADER_API const string DIR_N;
206 extern MX_GENSHADER_API const string DIR_L;
207 extern MX_GENSHADER_API const string DIR_V;
208 extern MX_GENSHADER_API const string WORLD_POSITION;
209 extern MX_GENSHADER_API const string OCCLUSION;
210 
211 /// Attribute names.
212 extern MX_GENSHADER_API const string ATTR_TRANSPARENT;
213 
214 /// User data names.
215 extern MX_GENSHADER_API const string USER_DATA_LIGHT_SHADERS;
216 extern MX_GENSHADER_API const string USER_DATA_BINDING_CONTEXT;
217 } // namespace HW
218 
219 namespace Stage
220 {
221 /// Identifier for vertex stage.
222 extern MX_GENSHADER_API const string VERTEX;
223 } // namespace Stage
224 
225 class HwLightShaders;
226 class HwShaderGenerator;
228 
229 /// Shared pointer to a HwLightShaders
230 using HwLightShadersPtr = shared_ptr<class HwLightShaders>;
231 /// Shared pointer to a HwShaderGenerator
232 using HwShaderGeneratorPtr = shared_ptr<class HwShaderGenerator>;
233 /// Shared pointer to a HwResourceBindingContext
234 using HwResourceBindingContextPtr = shared_ptr<class HwResourceBindingContext>;
235 
236 /// @class HwLightShaders
237 /// Hardware light shader user data
239 {
240  public:
241  /// Create and return a new instance.
243  {
244  return std::make_shared<HwLightShaders>();
245  }
246 
247  /// Bind a light shader to a light type id.
248  void bind(unsigned int type, ShaderNodePtr shader)
249  {
250  _shaders[type] = shader;
251  }
252 
253  /// Unbind a light shader previously bound to a light type id.
254  void unbind(unsigned int type)
255  {
256  _shaders.erase(type);
257  }
258 
259  /// Clear all light shaders previously bound.
260  void clear()
261  {
262  _shaders.clear();
263  }
264 
265  /// Return the light shader bound to the given light type,
266  /// or nullptr if not light shader is bound to this type.
267  const ShaderNode* get(unsigned int type) const
268  {
269  auto it = _shaders.find(type);
270  return it != _shaders.end() ? it->second.get() : nullptr;
271  }
272 
273  /// Return the map of bound light shaders.
274  const std::unordered_map<unsigned int, ShaderNodePtr>& get() const
275  {
276  return _shaders;
277  }
278 
279  protected:
280  std::unordered_map<unsigned int, ShaderNodePtr> _shaders;
281 };
282 
283 /// @class HwShaderGenerator
284 /// Base class for shader generators targeting HW rendering.
286 {
287  public:
288  /// Add the function call for a single node.
289  void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
290 
291  /// Emit code for active light count definitions and uniforms
292  virtual void addStageLightingUniforms(GenContext& context, ShaderStage& stage) const;
293 
294  /// Return the closure contexts defined for the given node.
295  void getClosureContexts(const ShaderNode& node, vector<ClosureContext*>& cct) const override;
296 
297  /// Bind a light shader to a light type id, for usage in surface shaders created
298  /// by the generator. The lightTypeId should be a unique identifier for the light
299  /// type (node definition) and the same id should be used when setting light parameters on a
300  /// generated surface shader.
301  static void bindLightShader(const NodeDef& nodeDef, unsigned int lightTypeId, GenContext& context);
302 
303  /// Unbind a light shader previously bound to the given light type id.
304  static void unbindLightShader(unsigned int lightTypeId, GenContext& context);
305 
306  /// Unbind all light shaders previously bound.
307  static void unbindLightShaders(GenContext& context);
308 
309  /// Types of closure contexts for HW.
311  {
316  EMISSION
317  };
318 
319  /// String constants for closure context suffixes.
322  static const string CLOSURE_CONTEXT_SUFFIX_INDIRECT;
323 
324  protected:
326 
327  /// Create and initialize a new HW shader for shader generation.
328  virtual ShaderPtr createShader(const string& name, ElementPtr element, GenContext& context) const;
329 
330  /// Closure contexts for defining closure functions.
336 };
337 
338 /// @class HwResourceBindingContext
339 /// Class representing a context for resource binding for hardware resources.
341 {
342  public:
344 
345  // Initialize the context before generation starts.
346  virtual void initialize() = 0;
347 
348  // Emit directives required for binding support
349  virtual void emitDirectives(GenContext& context, ShaderStage& stage) = 0;
350 
351  // Emit uniforms with binding information
352  virtual void emitResourceBindings(GenContext& context, const VariableBlock& uniforms, ShaderStage& stage) = 0;
353 
354  // Emit struct uniforms with binding information
355  virtual void emitStructuredResourceBindings(GenContext& context, const VariableBlock& uniforms,
356  ShaderStage& stage, const std::string& structInstanceName,
357  const std::string& arraySuffix = EMPTY_STRING) = 0;
358 };
359 
361 
362 #endif
MX_GENSHADER_API const string DIR_V
MX_GENSHADER_API const string USER_DATA_LIGHT_SHADERS
User data names.
MX_GENSHADER_API const string T_NORMAL_WORLD
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
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
MX_GENSHADER_API const string PROJ_INVERSE_TRANSPOSE_MATRIX
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
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.
MX_GENSHADER_API const string T_ALBEDO_TABLE_SIZE
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
shared_ptr< Syntax > SyntaxPtr
Shared pointer to a Syntax.
Definition: Syntax.h:26
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 TEXCOORD
MX_GENSHADER_API const string FRAME
#define MX_GENSHADER_API
Definition: Export.h:18
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
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 T_WORLD_INVERSE_TRANSPOSE_MATRIX
MX_GENSHADER_API const string T_AMB_OCC_MAP
static const string CLOSURE_CONTEXT_SUFFIX_INDIRECT
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
static const string CLOSURE_CONTEXT_SUFFIX_TRANSMISSION
MX_GENSHADER_API const string PROJ_TRANSPOSE_MATRIX
shared_ptr< class HwResourceBindingContext > HwResourceBindingContextPtr
Shared pointer to a HwResourceBindingContext.
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
ClosureContext _defEmission
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
Variable names for lighting parameters.
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.
virtual void getClosureContexts(const ShaderNode &node, vector< ClosureContext * > &cct) const
Return the closure contexts defined for the given node.
MX_GENSHADER_API const string VIEW_TRANSPOSE_MATRIX
MX_GENSHADER_API const string AMB_OCC_GAIN
MX_GENSHADER_API const string T_POSITION_OBJECT
static const string CLOSURE_CONTEXT_SUFFIX_REFLECTION
String constants for closure context suffixes.
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
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
ClosureContext _defIndirect
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
ClosureContext _defTransmission
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
virtual void emitFunctionCall(const ShaderNode &node, GenContext &context, ShaderStage &stage) const
Add the function call for a single node.
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
ClosureContext _defDefault
Closure contexts for defining closure functions.
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:34
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_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
type
Definition: core.h:1059
MX_GENSHADER_API const string WORLD_INVERSE_TRANSPOSE_MATRIX
ClosureContext _defReflection
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