FixedMaterial

Inherits: Material < Resource < Reference < Object

Category: Core

Brief Description

Simple Material with a fixed parameter set.

Member Functions

bool get_fixed_flag ( int flag ) const
int get_light_shader ( ) const
void get_parameter ( int param ) const
float get_point_size ( ) const
int get_texcoord_mode ( int param ) const
Texture get_texture ( int param ) const
Transform get_uv_transform ( ) const
void set_fixed_flag ( int flag, bool value )
void set_light_shader ( int shader )
void set_parameter ( int param, Variant value )
void set_point_size ( float size )
void set_texcoord_mode ( int param, int mode )
void set_texture ( int param, Texture texture )
void set_uv_transform ( Transform transform )

Numeric Constants

  • PARAM_DIFFUSE = 0 — Diffuse Lighting (light scattered from surface).
  • PARAM_DETAIL = 1 — Detail Layer for diffuse lighting.
  • PARAM_SPECULAR = 2 — Specular Lighting (light reflected from the surface).
  • PARAM_EMISSION = 3 — Emission Lighting (light emitted from the surface).
  • PARAM_SPECULAR_EXP = 4 — Specular Exponent (size of the specular dot).
  • PARAM_GLOW = 5 — Glow (Visible emitted scattered light).
  • PARAM_NORMAL = 6 — Normal Map (irregularity map).
  • PARAM_SHADE_PARAM = 7
  • PARAM_MAX = 8 — Maximum amount of parameters.
  • TEXCOORD_UV = 0 — Read texture coordinates from the UV array.
  • TEXCOORD_UV_TRANSFORM = 1 — Read texture coordinates from the UV array and transform them by uv_xform.
  • TEXCOORD_UV2 = 2 — Read texture coordinates from the UV2 array.
  • TEXCOORD_SPHERE = 3
  • FLAG_USE_ALPHA = 0
  • FLAG_USE_COLOR_ARRAY = 1
  • FLAG_USE_POINT_SIZE = 2
  • FLAG_DISCARD_ALPHA = 3
  • LIGHT_SHADER_LAMBERT = 0
  • LIGHT_SHADER_WRAP = 1
  • LIGHT_SHADER_VELVET = 2
  • LIGHT_SHADER_TOON = 3

Description

FixedMaterial is a simple type of material Resource, which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to ShaderMaterial for most simple use cases.

Member Function Description

  • bool get_fixed_flag ( int flag ) const
  • int get_light_shader ( ) const
  • void get_parameter ( int param ) const

Return a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it’s best to check the enum.

  • float get_point_size ( ) const
  • int get_texcoord_mode ( int param ) const

Return the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.

Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see set_texcoord_mode).

Returns the special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.

  • void set_fixed_flag ( int flag, bool value )
  • void set_light_shader ( int shader )

Set a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it’s best to check the enum.

  • void set_point_size ( float size )
  • void set_texcoord_mode ( int param, int mode )

Set the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.

Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see set_texcoord_mode).

  • void set_uv_transform ( Transform transform )

Sets a special transform used to post-transform UV coordinates of the uv_xform texcoord mode: TEXCOORD_UV_TRANSFORM.