DxSetShaderValue: Difference between revisions
Jump to navigation
Jump to search
m (moved SetShaderValue to DxSetShaderValue: Function renamed) |
No edit summary |
||
Line 8: | Line 8: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool dxSetShaderValue ( element shader, string parameterName, mixed value ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 21: | Line 21: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
myShader = | myShader = dxCreateShader( "hello.fx" ) | ||
myTexture = | myTexture = dxCreateTexture( "man.png" ) | ||
dxSetShaderValue( myShader, "texure0", myTexture ) -- Set a texture | |||
dxSetShaderValue( myShader, "bShowThing", true ) -- Set a bool | |||
dxSetShaderValue( myShader, "speed", 2.4 ) -- Set a number | |||
dxSetShaderValue( myShader, "positionOfCheese", 100, 200, 300 ) -- Set a list of numbers | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} |
Revision as of 11:54, 13 June 2011
Only available in 1.1 This sets a named parameter for a shader element
Syntax
bool dxSetShaderValue ( element shader, string parameterName, mixed value )
Required Arguments
- shader: The shader element whose parameter is to be changed
- parameterName: The name of parameter
- value: The value to set, which can be a texture, a bool, a number, a table of numbers or a list of numbers
Returns
Returns true if the shader element's parameter was successfully changed, false otherwise.
Example
myShader = dxCreateShader( "hello.fx" ) myTexture = dxCreateTexture( "man.png" ) dxSetShaderValue( myShader, "texure0", myTexture ) -- Set a texture dxSetShaderValue( myShader, "bShowThing", true ) -- Set a bool dxSetShaderValue( myShader, "speed", 2.4 ) -- Set a number dxSetShaderValue( myShader, "positionOfCheese", 100, 200, 300 ) -- Set a list of numbers
See Also
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTarget
- dxCreateScreenSource
- dxCreateShader
- dxCreateTexture
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsSize
- dxGetPixelsFormat
- dxGetStatus
- dxGetTextSize
- dxGetTextWidth
- dxGetTexturePixels
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource