modules.material#
- class modules.material.Materials(*args: Any, **kwargs: Any)#
Bases:
Context- __init__(context)#
Material loader for models
- Parameters:
context (EmberEngine) – This is the main context of the application
- static add_ao_suffix(filename)#
- bind(index: int)#
Bind the textures to the commmand buffer
- Parameters:
index (int) – The index of the material in the buffer
- buildMaterial(albedo: Path = False, normal: Path = False, emissive: Path = False, r: Path = False, m: Path = False, o: Path = False, rmo: Path = False) int#
Build a material based on defined textures
- Parameters:
albedo – diffuse/albedo/base color map
normal (Path) – normal map
emissive (Path) – emissive map
r (Path) – roughness map
m (Path) – metallic map
o (Path) – occlusion map
rmo (Path) – already packed roughness/metallic/occlused map
- Returns:
The index in the material buffer
- Return type:
int
- getMaterialByIndex(index: int) Material#
Get material by index, return default material if out of scope
- Parameters:
index (int) – The index of the material in the buffer
- Returns:
The material data
- Return type:
Dict, no TypedDict yet
- get_texture_kind(prop) str#
- is_gltf_texture(prop) bool#
Assimp..
- loadOrFind(material: impasse.structs.Material, path: Path) int#
Create a material by parsing model material info and loading textures
- Parameters:
material (Material as ImpasseMaterial) – the material data from Impasse/assimp
path (Path) – the path where the textures should be located
- Returns:
The index of the material in the buffer
- Return type:
int
- load_texture(prop, model_path)#