MeshNormalMaterial

Qualified name: algan.rendering.shaders.materials.MeshNormalMaterial

class MeshNormalMaterial(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: Material

Encodes the surface normal as RGB. Does not use a base color.

Methods

get_shader_param_values

Map of {shader_param_name: value} matching this material's shader signature.

shader

MeshNormalMaterial: RGB encodes the surface normal (n * 0.5 + 0.5).

Attributes

applies_color

Whether the material's color should drive the mob's base color.

applies_color = False

Whether the material’s color should drive the mob’s base color. Even then, the default color=None means “keep the mob’s existing color” – unlike Three.js, where an unset material color is white – so Sphere(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, flat_shading=0.0)

MeshNormalMaterial: RGB encodes the surface normal (n * 0.5 + 0.5).

Three.js uses view-space normals; only the camera location (not its orientation) is available here, so this uses world-space normals.

Parameters:
  • light_intensity (float)

  • ambient_light_intensity (float)

  • flat_shading (float)