Scripting API BBMOD_Material BBMOD_Material
A constructor defined in BBMOD_Material.gml
Base class for materials.
true to enable alpha blending. This can have negative effect on performance, therefore it should be used only when necessary. Default value is
AlphaTest Discard pixels with alpha less than this value. Use values in range 0..1.
Anisotropy The maximum level of anisotropy when
BBMOD_Material.MipFilter is set to
tf_anisotropic. Must be in range 1..16. Default value is 16.
BaseOpacity A texture with a base color in the RGB channels and opacity in the alpha channel.
BlendMode A blend mode. Default value is
Culling A culling mode. Default value is
false to disable linear texture filtering for this material. Default value is
MipBias Defines a bias for which mip level is used. Can be also negative values to select lower mip levels. E.g. if mip level 2 would be normally selected and bias was -1, then level 1 would be selected instead and if it was 1, then level 3 would be selected instead. Default value is 0.
MipFilter The mip filter mode used for the material. Use one of the
tf_ constants. Default value is
MipMax The maximum mip level used, where 0 is the highest resolution, 1 is the first mipmap, 2 is the second etc. Default value is 16.
MipMin The minimum mip level used, where 0 is the highest resolution, 1 is the first mipmap, 2 is the second etc. Default value is 0.
Mipmapping Use one of the
mip_ constants. Default value is
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
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.
true to enable texture repeat for this material. Default value is
ZFunc The function used for depth testing when
BBMOD_Material.ZTest is enabled. Default value is
true then models using this material should be tested against the depth buffer. Defaults value is
true then models using this material should write to the depth buffer. Default value is
false then the resource has not been loaded yet.
Path The path to the file from which was the resource loaded, or
undefined if the resource does not come from a file.
true then the resource is persistent and it is not destroyed when method
free is used. Default value is
apply Makes this material the current one.
clone Creates a clone of the material.
copy Copies properties of this material into another material.
from_json Loads material properties from a JSON object.
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
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.
to_json Saves material properties to a JSON object.
destroy Frees memory used by the struct.
free Releases a reference to the resource.
from_buffer Loads the resource from a buffer.
from_file Loads the resource from a file.
from_file_async Asynchronnously loads the resource from a file.
ref Retrieves a reference to the resource.
to_buffer Writes the resource to a buffer.
to_file Writes a resource to a file.
BBMOD_BaseMaterial See also
Do you find this page helpful?
Copyright © 2023, BlueBurn. Built on September 11, 2023 using