class_fixedmaterial - vkbsb/godot GitHub Wiki
FixedMaterial
####Inherits: Material ####Category: Core
Brief Description
Simple Material with a fixed parameter set.
Member Functions
- void set_parameter ( int param, var value )
- void get_parameter ( int param ) const
- void set_texture ( int param, Texture texture )
- Texture get_texture ( int param ) const
- void set_texcoord_mode ( int param, int mode )
- int get_texcoord_mode ( int param ) const
- void set_fixed_flag ( int flag, bool value )
- bool get_fixed_flag ( int flag ) const
- void set_uv_transform ( Transform transform )
- Transform get_uv_transform ( ) const
- void set_light_shader ( int shader )
- int get_light_shader ( ) const
- void set_point_size ( float size )
- float get_point_size ( ) const
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_SPHERE = 3
- 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.
- FLAG_USE_ALPHA = 0
- FLAG_USE_COLOR_ARRAY = 1
- FLAG_USE_POINT_SIZE = 2
- FLAG_DISCARD_ALPHA = 3
Description
FixedMaterial is a simple type of material Resource, which contains a fixed amount of paramters. 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
set_parameter
- void set_parameter ( int param, var value )
Set a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it"apos;s best to check the enum.
get_parameter
- 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"apos;s best to check the enum.
set_texture
Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see set_texcoord_mode).
get_texture
Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see set_texcoord_mode).
set_texcoord_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.
get_texcoord_mode
Return the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object.
set_uv_transform
- void set_uv_transform ( Transform transform )
Sets a special transform used to post-transform UV coordinates of the uv_xfrom tecoord mode: TEXCOORD_UV_TRANSFORM
get_uv_transform
- Transform get_uv_transform ( ) const
Returns the special transform used to post-transform UV coordinates of the uv_xfrom tecoord mode: TEXCOORD_UV_TRANSFORM