Material
Object Hierarchy:
Description:
[ CCode ( cname = "CoglHandle" , ref_function = "cogl_material_ref" , unref_function = "cogl_material_unref" ) ]
[ Compact ]
public class Material : Handle
[ Compact ]
public class Material : Handle
Namespace: Cogl
Package: cogl-1.0
Content:
Static methods:
- public static Type alpha_func_get_type ()
- public static Type filter_get_type ()
- public static void foreach_layer (Material material, MaterialLayerCallback callback)
- public static void get_depth_range (Material material, float near_val, float far_val)
- public static bool get_depth_test_enabled (Material material)
- public static DepthTestFunction get_depth_test_function (Material material)
- public static bool get_depth_writing_enabled (Material material)
- public static bool get_layer_point_sprite_coords_enabled (Material material, int layer_index)
Gets whether point sprite coordinate generation is enabled for this texture layer.
- public static unowned Bitmap get_user_program (Material material)
Queries what user program has been associated with the given this using set_user_program .
- public static bool set_depth_range (Material material, float near_val, float far_val) throws Error
- public static void set_depth_test_enabled (Material material, bool enable)
- public static void set_depth_test_function (Material material, DepthTestFunction function)
- public static void set_depth_writing_enabled (Material material, bool enable)
- public static bool set_layer_point_sprite_coords_enabled (Material material, int layer_index, bool enable) throws Error
When rendering points, if
enable
istrue
then the texture coordinates for this layer will be replaced with coordinates that vary from 0.0 to 1.0 across the primitive. - public static void set_layer_wrap_mode (Material material, int layer_index, MaterialWrapMode mode)
Sets the wrap mode for all three coordinates of texture lookups on this layer.
- public static void set_layer_wrap_mode_p (Material material, int layer_index, MaterialWrapMode mode)
Sets the wrap mode for the 'p' coordinate of texture lookups on this layer.
- public static void set_layer_wrap_mode_s (Material material, int layer_index, MaterialWrapMode mode)
Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
- public static void set_layer_wrap_mode_t (Material material, int layer_index, MaterialWrapMode mode)
Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
- public static void set_user_program (Material material, Bitmap program)
Associates a linked CoglProgram with the given material so that the program can take full control of vertex and/or fragment processing.
- public static Type wrap_mode_get_type ()
Creation methods:
- public Material ()
Methods:
- public Material copy ()
Creates a new material with the configuration copied from the source material.
- public void get_ambient (out Color ambient)
Retrieves the current ambient color for this
- public void get_color (out Color color)
Retrieves the current material color.
- public void get_diffuse (out Color diffuse)
Retrieves the current diffuse color for this
- public void get_emission (out Color emission)
Retrieves the materials current emission color.
- public unowned List<MaterialLayer> get_layers ()
This function lets you access a material's internal list of layers for iteration.
- public int get_n_layers ()
Retrieves the number of layers defined for the given this
- public float get_point_size ()
Get the size of points drawn when POINTS is used with the vertex buffer API.
- public float get_shininess ()
Retrieves the materials current emission color.
- public void get_specular (out Color specular)
Retrieves the materials current specular color.
- public void remove_layer (int layer_index)
This function removes a layer from your material
- public void set_alpha_test_function (MaterialAlphaFunc alpha_func, float alpha_reference)
Before a primitive is blended with the framebuffer, it goes through an alpha test stage which lets you discard fragments based on the current alpha value.
- public void set_ambient (Color ambient)
Sets the material's ambient color, in the standard OpenGL lighting model.
- public void set_ambient_and_diffuse (Color color)
Conveniently sets the diffuse and ambient color of this at the same time.
- public bool set_blend (string blend_string) throws BlendStringError
If not already familiar; please refer here for an overview of what blend strings are, and their syntax.
- public void set_blend_constant (Color constant_color)
When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function.
- public void set_color (Color color)
Sets the basic color of the material, used when no lighting is enabled.
- public void set_color4f (float red, float green, float blue, float alpha)
Sets the basic color of the material, used when no lighting is enabled.
- public void set_color4ub (uchar red, uchar green, uchar blue, uchar alpha)
Sets the basic color of the material, used when no lighting is enabled.
- public void set_diffuse (Color diffuse)
Sets the material's diffuse color, in the standard OpenGL lighting model.
- public void set_emission (Color emission)
Sets the material's emissive color, in the standard OpenGL lighting model.
- public void set_layer (int layer_index, Texture texture)
In addition to the standard OpenGL lighting model a Cogl material may have one or more layers comprised of textures that can be blended together in order, with a number of different texture combine modes.
- public bool set_layer_combine (int layer_index, string blend_string) throws BlendStringError
If not already familiar; you can refer here for an overview of what blend strings are and there syntax.
- public void set_layer_combine_constant (int layer_index, Color constant)
When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value.
- public void set_layer_filters (int layer_index, MaterialFilter min_filter, MaterialFilter mag_filter)
Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%.
- public void set_layer_matrix (int layer_index, Matrix matrix)
This function lets you set a matrix that can be used to e.g. translate and rotate a single layer of a material used to fill your geometry.
- public void set_point_size (float point_size)
Changes the size of points drawn when POINTS is used with the vertex buffer API.
- public void set_shininess (float shininess)
Sets the shininess of the material, in the standard OpenGL lighting model, which determines the size of the specular highlights.
- public void set_specular (Color specular)
Sets the material's specular color, in the standard OpenGL lighting model.
Inherited Members:
All known members inherited from class Cogl.Handle