EngineApplyShaderToWorldTexture

From Multi Theft Auto: Wiki
Revision as of 18:40, 22 June 2011 by Ccw (talk | contribs) (Created page with "{{Client function}} __NOTOC__ {{New feature|3.0110|1.1| Only available in 1.1 }} This function applies a shader to one texture of a model. The shader inherits the render stat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Only available in 1.1 This function applies a shader to one texture of a model. The shader inherits the render states of the original when it is drawn, so texture stage 0 will already be set to the original texture.

Syntax

bool engineApplyShaderToModel ( element shader, int modelID, string textureName )

Required Arguments

  • shader: The shader which is to be applied
  • modelID: The model id to find the texture
  • textureName : The name of the texture in the model to apply the shader to

Returns

Returns true if the shader was successfully applied to the model, false otherwise.

Example

This example will apply a shader to the "des_logwall" texture of model 11490 (also known as "des_house"). This is the house where players are spawned in the 'play' resource.

myShader = dxCreateShader( "hello.fx" )
engineApplyShaderToModel ( myShader, 11490, "des_logwall" )

See Also