dxSetShaderValue | Multi Theft Auto: Wiki Skip to content

dxSetShaderValue

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This sets a named parameter for a shader element

Important

It's enough to set the texture only once if it's a render target

Syntax

dxSetShaderValue ( )

Code Examples

client
myShader = dxCreateShader( "hello.fx" )
myTexture = dxCreateTexture( "man.png" )
dxSetShaderValue( myShader, "texture0", 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. This can be used to fill an array in HLSL.