MaterialShaderParameter()

Syntax

MaterialShaderParameter(#Material, ProgramType, ParameterName$, ParameterType, v1.f, v2.f, v3.f, v4.f)
Description
Set specific parameters to the shader.

Parameters

#Material The material to use.
ProgramType Program type. It can be one of the following values:
  #PB_Shader_Vertex  : use the vertex program.
  #PB_Shader_Fragment: use the fragment program.
ParameterName$ Name of the parameter with the GLSL program to set the new value.
ParameterType Parameter type. It can be one of the following values:
  #PB_Shader_Integer: the parameter use an integer type (v2, v3 and v4 parameters are ignored)
  #PB_Shader_Float  : the parameter use a float type (v2, v3 and v4 parameters are ignored)
  #PB_Shader_Vector3: the parameter use a Vector3 type (v4 parameter is ignored)
  #PB_Shader_Vector4: the parameter use a Vector4 type
v1 First parameter value. Mandatory for all parameter types.
v2 Second parameter value. Mandatory for #PB_Shader_Vector3 and #PB_Shader_Vector4 types.
v3 Third parameter value. Mandatory for #PB_Shader_Vector3 and #PB_Shader_Vector4 types.
v4 Fourth parameter value. Mandatory for #PB_Shader_Vector4 type.

Return value

None.

Remarks

GLSL shaders uses vec4 type to pass a color. Example:
  MaterialShaderParameter(0, #PB_Shader_Fragment, 4, Red(Color)/255, Green(Color)/255, Blue(Color)/255, Alpha(Color)/255)
  MaterialShaderParameter(#Material, #PB_Shader_Fragment, "bumpy", #PB_Shader_Float, 0.5,0,0,0)

Supported OS

All

<- MaterialShaderAutoParameter() - Material Index - MaterialShaderTexture() ->