Shader Object Functions

From Danmakufu Wiki
Jump to: navigation, search

ObjShader_Create

Returns: object ID (real)

Creates a shader object.

ObjShader_SetShaderF

Arguments:
 1) object ID (real)
 2) shader file path (char)
Returns: bool

Sets the path to the HLSL source for the shader.

ObjShader_SetShaderO

Arguments:
 1) ID of object to apply shader to (real)
 2) ID of shader (real)
Returns: bool

Starts applying the shader to a render object. Does not work with text objects, but you can render one to a render target.

ObjShader_ResetShader

Arguments:
 1) object ID (real)

Stops applying any shader to a render object.

ObjShader_SetTechnique

Arguments:
 1) object ID (real)
 2) technique (char)

Sets the technique you want to run.

ObjShader_SetVector

Arguments:
 1) object ID (real)
 2) parameter ID (char)
 3) x (real)
 4) y (real)
 5) z (real)
 6) w (real)

Passes float4(x, y, z, w) to the shader.

ObjShader_SetFloat

Arguments:
 1) object ID (real)
 2) parameter ID (char)
 3) float value (real)

Passes a float value to the shader.

ObjShader_SetFloatArray

Arguments:
 1) object ID (real)
 2) parameter ID (char)
 3) values (real, array)

Passes a float array to the shader.

ObjShader_SetTexture

Arguments:
 1) object ID (real)
 2) parameter ID (char)
 3) path to file (char)

Sets a texture parameter using the path to the appropriate image. You can call multiple textures.