Difference between revisions of "Shader.new"
|  (Created page with "__NOTOC__ '''Available since:''' Gideros 2015.06.30<br/> === Description === Create new shader instance.  The ‘Shader.new()’ constructor takes five arguments: - The path a...") | |||
| Line 11: | Line 11: | ||
| - An array of attributes descriptors | - An array of attributes descriptors | ||
| <source lang="lua"> | <source lang="lua"> | ||
| − | + |  Shader.new(vertex shader,fragment shader,flags,uniform descriptor,attribute descriptor) | |
| </source> | </source> | ||
| − | '''vertex shader | + | '''vertex shader''': (string) The path and name for the vertex shader without its extension ''''''<br/> | 
| − | '''fragment shader | + | '''fragment shader''': (string) The path and name for the fragment shader without its extension ''''''<br/> | 
| − | '''flags | + | '''flags''': (number) A set of numerical flags or 0 if none ''''''<br/> | 
| − | '''uniform descriptor | + | '''uniform descriptor''': (table) An array of uniforms/constants descriptors ''''''<br/> | 
| − | '''attribute descriptor | + | '''attribute descriptor''': (table) An array of attributes descriptors ''''''<br/> | 
Revision as of 10:20, 23 August 2018
Available since: Gideros 2015.06.30
Description
Create new shader instance.
The ‘Shader.new()’ constructor takes five arguments: - The path and name for the vertex shader without its extension. Gideros will search the assets for a file with the supplied name, automatically adding the extension relevant for the target platform: .glsl for OpenGL, .cso or .hlsl for DirectX. - The path and name for the fragment shader without its extension. Same remark as above applies too. - A set of numerical flags or 0 if none. See description below. - An array of uniforms/constants descriptors - An array of attributes descriptors
 Shader.new(vertex shader,fragment shader,flags,uniform descriptor,attribute descriptor)
'vertex shader: (string) The path and name for the vertex shader without its extension '
'fragment shader: (string) The path and name for the fragment shader without its extension '
'flags: (number) A set of numerical flags or 0 if none '
'uniform descriptor: (table) An array of uniforms/constants descriptors '
'attribute descriptor: (table) An array of attributes descriptors '
