Material assets are created in the Editor and cannot be imported from a source file.
There are 2 different material systems in Octave.
- MaterialLite: Can be used on ALL platforms. The downside is that they only support a limited number of features.
- MaterialBase / MaterialInstance: These are only supported on Vulkan platforms. MaterialBase allows you to provide a custom Vertex / Fragment shader in a GLSL file. MaterialInstance allows you to make a new instance of the base material with different parameter values.
Inheritance:
Check if this material is a MaterialBase.
Sig: base = Material:IsBase()
- Ret:
boolean base
Is base material
Check if this material is a MaterialInstance.
Sig: instance = Material:IsInstance()
- Ret:
boolean instance
Is instance material
Check if this material is a MaterialLite.
Sig: lite = Material:IsLite()
- Ret:
boolean lite
Is lite material
Set a scalar parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: Material:SetScalarParameter(name, value)
- Arg:
string name
Parameter name - Arg:
number value
Parameter value
Set a vector parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: Material:SetVectorParameter(name, value)
- Arg:
string name
Parameter name - Arg:
Vector value
Parameter value
Set a texture parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: Material:SetTextureParameter(name, value)
- Arg:
string name
Parameter name - Arg:
Texture value
Parameter value
Get a scalar parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: value = Material:GetScalarParameter(name)
- Arg:
string name
Parameter name - Ret:
number value
Parameter value
Get a vector parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: value = Material:GetVectorParameter(name)
- Arg:
string name
Parameter name - Ret:
Vector value
Parameter value
Get a texture parameter on the material. Only used by MaterialBase and MaterialInstance.
Sig: value = Material:GetTextureParameter(name)
- Arg:
string name
Parameter name - Ret:
Texture value
Parameter value
Get the material's blend mode.
See BlendMode
Sig: blendMode = Material:GetBlendMode()
- Ret:
BlendMode(integer) blendMode
Material blending mode
Get the material's alpha mask cutoff. Shaded fragments will be discarded if their alpha value is below this threshold.
Sig: cutoff = Material:GetMaskCutoff()
- Ret:
number cutoff
Alpha discard threshold (0 to 1)
Get the material's sort priority. This is used mainly by translucent rendering. Objects will be sorted by distance from the camera if their priorities are the same.
Sig: priority = Material:GetSortPriority()
- Ret:
integer priority
Sort priority
Check if depth testing is disabled for this material. TODO: This should probably be changed to "IsDepthTestingEnabled()".
Sig: disabled = Material:IsDepthTestDisabled()
- Ret:
boolean disabled
True if depth testing is DISABLED
Check if fog should be applied to the resulting shaded fragment.
Sig: applyFog = Material:ShouldApplyFog()
- Ret:
boolean applyFog
Should apply fog
Get the cull mode.
See CullMode
Sig: cullMode = Material:GetCullMode()
- Ret:
CullMode(integer) cullMode
Triangle cull mode