DxSetShaderValue: Difference between revisions
Jump to navigation
Jump to search
(Added an important note (It's enough to set the texture only once because of the way dxSetShaderValue works)) |
mNo edit summary |
||
Line 3: | Line 3: | ||
This sets a named parameter for a [[shader]] element | This sets a named parameter for a [[shader]] element | ||
{{Important Note|It' | {{Important Note|It'll be enough to set texture only once if it's a render target}} | ||
==Syntax== | ==Syntax== |
Revision as of 13:10, 14 August 2018
This sets a named parameter for a shader element
Important Note: It'll be enough to set texture only once if it's a render target |
Syntax
bool dxSetShaderValue ( element theShader, string parameterName, mixed value )
OOP Syntax Help! I don't understand this!
- Method: shader:setValue(...)
Required Arguments
- theShader: 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 or a list of numbers(max 16 floats(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 float dxSetShaderValue( myShader, "positionOfCheese", 100, 200, 300 ) -- Set a list of numbers, with max 16 numbers. Btw, this is a float: 3.4
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