material¶
- class material
Materials apply shaders to renderable objects (meshes, sprites, entities, etc), maintaining separate property values per instance. This allows the same shader to be used many times in different places without incurring additional overhead from copying or compiling shader code again
Materials can also be saved/loaded, although they will need to access to the original shader asset
The Standard Material
The standard material is built on the standard uber-shader, providing a convenient all purpose material
Standard Material Properties¶ Name
Type
Models
Description
shadingModelenumN/A
Current shading model:
LIT,UNLITblendenumAll
Current blending mode:
BLEND_OPAQUE,BLEND_TRANSPARENT,BLEND_ADD,BLEND_MASKED,BLEND_MULTIPLY,BLEND_SCREENtintBlendenumAll
Current tint mode:
TINT_NONE,TINT_OPAQUE,TINT_TRANSPARENT,TINT_ADD,TINT_MULTIPLY,TINT_SCREENtintColorvec4(linear color)All
Tint color overlay blended using
tintBlendmodecolorvec4(srgb color)All
Diffuse albedo color of the surface
maptexture(rgba)All
Diffuse albedo color texture map
emissivevec4(srgb hdr color)All
Emissive color of the surface (can be more than 1)
emissiveMaptexture(rgba)All
Emissive color texture map
scaleOffsetvec2All
Scale (
.xy) and offset (.zw) for texture uvsroughnessnumber[0..1]Lit
Perceptual roughness of the surface
roughnessMaptextureLit
Perceptual roughness texture map
metallicnumber[0..1]Lit
Metalness of the surface
metallicMaptextureLit
Metallic texture map
normalMaptexture(linear encoded rgb)Lit
Normal texture map in tangent space
occlusionMaptextureLit
Ambient occlusion texture map
reflectancenumberLit
Reflectance of the surface
enableClearCoatbooleanLit
Switch to enable/disable clearcoat
clearCoatvec2Lit
Clearcoat strength (
.x) and roughness (.y)enableAnisotropybooleanLit
Switch to enable/disable anisotrophic shading
anisotropyDirectionvec3Lit
Direction of anisotrophic shading in tangent space
anisotropyDirectionMaptexture(linear encoded rgb)Lit
Anisotrophic direction texture map
enableRefractionbooleanLit
Switch to enable/disable refraction
iornumberLit
Index of refraction
refractionTypeenumLit
Refraction type:
REFRACT_SOLID,REFRACT_THINrefractionModeenumLit
Refraction mode:
REFRACT_ENVIRONMENT,REFRACT_SCENEenableTransmissionbooleanLit
Switch to enable/disable transmission
absorptionbooleanLit
Switch to enable/disable transmission
hasCombinedMapsbooleanLit
Switch to enable/disable combined occlusion (
rchannel), metallic (gchannel) and roughness (bchannel) maps- static material(shader)¶
Create a new material using the supplied
shader
- static lit()¶
Create a default lit material using the standard shader
- static unlit()¶
Create a default unlit material using the standard shader