EntityCustomParameter()

Syntax

EntityCustomParameter(#Entity, SubEntity, ParameterIndex, Value1.f, Value2.f, Value3.f, Value4.f)
Description
Set a custom parameter value to the #Entity material shader script. To have any effect, the material associated to the entity should have a shader script (either GLSL or HLSL).

Parameters

#Entity The entity to use.
SubEntity The sub-entity to use. First sub-entity index starts at 0 (representing the main entity).
ParameterIndex The parameter index in the shader script.
Value1 The first parameter value.
Value2 The second parameter value (if the parameter only accept one value, this value will be ignored).
Value3 The third parameter value (if the parameter only accept two values, this value will be ignored).
Value4 The fourth parameter value (if the parameter only accept three values, this value will be ignored).

Return value

None.

Remarks

To set parameters in a material, you need to define them in the material script as param_named_auto 'VariableName' custom 'ParameterIndex', for example:
  param_named_auto foo custom 1
  param_named_auto bar custom 2
The definition and size of the parameter is defined in the shaders script, for example:
  uniform float foo;
  uniform vec3 bar;
For more information see the following example:

Example

RustyBall.pb

Supported OS

All

<- EntityCollide() - Entity Index - EntityDirection() ->