MeshToonMaterial

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

class MeshToonMaterial(color=None, *, emissive=Color([0., 0., 0., 0., 1.]), emissive_intensity=1.0, bands=3.0, **kwargs)[source]

Bases: Material

Cel-shaded (banded diffuse) material plus emissive.

Three.js drives the bands with gradientMap; since textures are not sampled, the band count is controlled by the Algan-specific bands argument (default 3).

Methods

get_shader_param_values

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

shader

MeshToonMaterial: diffuse lighting quantized into flat bands (cel shading).

Attributes

applies_color

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

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, emissive=(0.0, 0.0, 0.0), emissive_intensity=1.0, num_bands=3.0, flat_shading=0.0)

MeshToonMaterial: diffuse lighting quantized into flat bands (cel shading).

The Three.js gradientMap is approximated by an even num_bands-step ramp.

Parameters:
  • light_intensity (float)

  • ambient_light_intensity (float)

  • emissive_intensity (float)

  • num_bands (float)

  • flat_shading (float)