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