polyxios.SceneMaterial#
- class polyxios.SceneMaterial(name: str = '', base_color: tuple[float, float, float, float]=(1.0, 1.0, 1.0, 1.0), metallic: float = 1.0, roughness: float = 1.0, emissive: tuple[float, float, float]=(0.0, 0.0, 0.0), alpha_mode: str = 'OPAQUE', alpha_cutoff: float = 0.5, double_sided: bool = False, base_color_texture: int | None = None, normal_texture: int | None = None, metallic_roughness_texture: int | None = None, occlusion_texture: int | None = None, emissive_texture: int | None = None, extras: dict[str, ~typing.Any]=<factory>)[source]#
PBR metallic-roughness material.
- Parameters:
- name
Material name from the source file.
- base_color
RGBA base-color factor in linear space, each component in [0, 1].
- metallic
Metallic factor in [0, 1].
- roughness
Roughness factor in [0, 1].
- emissive
RGB emissive factor in linear space.
- alpha_mode
One of
"OPAQUE","MASK", or"BLEND".- alpha_cutoff
Alpha cutoff threshold used when alpha_mode is
"MASK".- double_sided
Whether the material is rendered on both sides.
- base_color_texture
Index into
SceneData.textures, orNone.- normal_texture
Index into
SceneData.textures, orNone.- metallic_roughness_texture
Index into
SceneData.textures, orNone.- occlusion_texture
Index into
SceneData.textures, orNone.- emissive_texture
Index into
SceneData.textures, orNone.- extras
Format-specific extra data preserved for round-tripping.
- __init__(name: str = '', base_color: tuple[float, float, float, float]=(1.0, 1.0, 1.0, 1.0), metallic: float = 1.0, roughness: float = 1.0, emissive: tuple[float, float, float]=(0.0, 0.0, 0.0), alpha_mode: str = 'OPAQUE', alpha_cutoff: float = 0.5, double_sided: bool = False, base_color_texture: int | None = None, normal_texture: int | None = None, metallic_roughness_texture: int | None = None, occlusion_texture: int | None = None, emissive_texture: int | None = None, extras: dict[str, ~typing.Any]=<factory>) None#
Methods
__init__(name, base_color, float, float, ...)Attributes
namebase_colormetallicroughnessemissivealpha_modealpha_cutoffdouble_sidedbase_color_texturenormal_texturemetallic_roughness_textureocclusion_textureemissive_textureextras