Moai SDK
1.5 revision 1 (MoaiEdition)
|
Function List | |
clearUniform | |
declareUniform | |
declareUniformFloat | |
declareUniformInt | |
declareUniformSampler | |
load | |
reserveUniforms | |
setVertexAttribute |
Clears a uniform mapping.
function clearUniform ( MOAIShader self, number idx )
self | ( MOAIShader ) |
idx | ( number ) |
Declares a uniform mapping.
function declareUniform ( MOAIShader self, number idx, string name [, number type ] )
self | ( MOAIShader ) |
idx | ( number ) |
name | ( string ) |
type | ( number ) Optional. One of MOAIShader.UNIFORM_COLOR, MOAIShader.UNIFORM_FLOAT, MOAIShader.UNIFORM_INT, MOAIShader.UNIFORM_TRANSFORM, MOAIShader.UNIFORM_PEN_COLOR, MOAIShader.UNIFORM_VIEW_PROJ, MOAIShader.UNIFORM_WORLD, MOAIShader.UNIFORM_WORLD_VIEW, MOAIShader.UNIFORM_WORLD_VIEW_PROJ |
Declares an float uniform.
function declareUniformFloat ( MOAIShader self, number idx, string name [, number value ] )
self | ( MOAIShader ) |
idx | ( number ) |
name | ( string ) |
value | ( number ) Optional. Default value is 0. |
Declares an integer uniform.
function declareUniformInt ( MOAIShader self, number idx, string name [, number value ] )
self | ( MOAIShader ) |
idx | ( number ) |
name | ( string ) |
value | ( number ) Optional. Default value is 0. |
Declares an uniform to be used as a texture unit index. This uniform is internally an int, but when loaded into the shader the number one subtracted from its value. This allows the user to maintain consistency with Lua's convention of indexing from one.
function declareUniformSampler ( MOAIShader self, number idx, string name [, number textureUnit ] )
self | ( MOAIShader ) |
idx | ( number ) |
name | ( string ) |
textureUnit | ( number ) Optional. Default value is 1. |
Load a shader program.
function load ( MOAIShader self, string vertexShaderSource, string fragmentShaderSource )
self | ( MOAIShader ) |
vertexShaderSource | ( string ) |
fragmentShaderSource | ( string ) |
Reserve shader uniforms.
function reserveUniforms ( MOAIShader self [, number nUniforms ] )
self | ( MOAIShader ) |
nUniforms | ( number ) Optional. Default value is 0. |
Names a shader vertex attribute.
function setVertexAttribute ( MOAIShader self, number index, string name )
self | ( MOAIShader ) |
index | ( number ) Default value is 1. |
name | ( string ) Name of attribute. |