Material¶
Qualified name: algan.rendering.shaders.materials.Material
- class Material(color=None, *, opacity=1.0, transparent=False, visible=True, side=Side.FRONT, flat_shading=False, vertex_colors=False, wireframe=False, tone_mapped=True, **texture_kwargs)[source]¶
Bases:
objectBase class holding the Three.js shared material properties + defaults.
Subclasses set
shader, list their animatable shader parameters and implementget_shader_param_values().Methods
Warn (once per call) about properties Algan's renderer cannot honour.
Map of
{shader_param_name: value}matching this material's shader signature.MeshBasicMaterial: unlit, returns the flat base color unchanged.
Attributes
Whether the material's
colorshould drive the mob's base color.- applies_color = True¶
Whether the material’s
colorshould drive the mob’s base color. Even then, the defaultcolor=Nonemeans “keep the mob’s existing color” – unlike Three.js, where an unset material color is white – soSphere(color=RED).set_material(MeshPhysicalMaterial())stays red.
- emit_warnings(forwarded=None)[source]¶
Warn (once per call) about properties Algan’s renderer cannot honour.
- Parameters:
forwarded – What
set_materialmanaged to hand to the geometry, as{slot_name: is_animatable}(the union over the Mobs it was applied to). A slot that reached a geometry is sampled, so it is reported as static rather than ignored – or not reported at all when the geometry it landed on made it animatable.Nonemeans nothing was forwarded, which is what a bareMaterial(...).emit_warnings()describes.
- get_shader_param_values()[source]¶
Map of
{shader_param_name: value}matching this material’s shader signature. Base materials expose no extra parameters.
- static shader(memory, vertex_location, vertex_normal, albedo_color, camera_location, light_origin, light_color, light_intensity, ambient_light_intensity)¶
Lighting shader backing this material (a plain function).
- Parameters:
light_intensity (float)
ambient_light_intensity (float)