Extends BBMOD_Resource
constructor
new BBMOD_Material([_shader])
Base class for materials.
Name | Type | Description |
---|---|---|
_shader | Struct.BBMOD_Shader/Undefined |
A shader that the material uses in the BBMOD_ERenderPass.Forward pass. Leave undefined if you would like to use BBMOD_Material.set_shader to specify shaders used in specific render passes. |
Name | Description |
---|---|
AlphaBlend | Use true to enable alpha blending. This can have negative effect on performance, therefore it should be used only when necessary. Default value is false . |
AlphaTest | Discard pixels with alpha less than this value. Use values in range 0..1. |
BaseOpacity | A texture with a base color in the RGB channels and opacity in the alpha channel. |
BlendMode | A blend mode. Default value is bm_normal . |
Culling | A culling mode. Default value is cull_counterclockwise . |
Filtering | Use false to disable linear texture filtering for this material. Default value is true . |
Mipmapping | Use false to disable mimapping for this material. Default value is true . |
OnApply | A function that is executed when the shader is applied. Must take the material as the first argument. Use undefined if you do not want to execute any function. Defaults to undefined . |
RenderPass | Render passes in which is the material rendered. Defaults to 0 (no passes). |
RenderQueue | The render queue used by this material. Defaults to the default BBMOD render queue. |
Repeat | Use true to enable texture repeat for this material. Default value is false . |
ZFunc | The function used for depth testing when BBMOD_Material.ZTest is enabled. Default value is cmpfunc_lessequal . |
ZTest | If true then models using this material should be tested against the depth buffer. Defaults value is true . |
ZWrite | If true then models using this material should write to the depth buffer. Default value is true . |
Name | Description |
---|---|
apply | Makes this material the current one. |
clone | Creates a clone of the material. |
copy | Copies properties of this material into another material. |
get_shader | Retrieves a shader used in a specific render pass. |
has_shader | Checks whether the material has a shader for the render pass. |
remove_shader | Removes a shader used in a specific render pass. |
reset | Resets the current material to undefined . |
set_base_opacity | Changes the base color and opacity to a uniform value for the entire material. |
set_shader | Defines a shader used in a specific render pass. |
Copyright © 2022, BlueBurn. Built on June 19, 2022 using GMDoc.