MeshDepthMaterial¶
Qualified name: algan.rendering.shaders.materials.MeshDepthMaterial
- class MeshDepthMaterial(color=None, *, near=0.1, far=100.0, **kwargs)[source]¶
Bases:
MaterialRenders camera distance as grayscale (near=bright, far=dark).
Methods
Map of
{shader_param_name: value}matching this material's shader signature.MeshDepthMaterial: grayscale by camera distance, near=bright, far=dark.
Attributes
Whether the material's
colorshould drive the mob's base color.- applies_color = False¶
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.
- 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, near=0.1, far=100.0)¶
MeshDepthMaterial: grayscale by camera distance, near=bright, far=dark.
Approximates Three.js depth packing with a simple linear luminance ramp.
- Parameters:
light_intensity (float)
ambient_light_intensity (float)
near (float)
far (float)