SpecularMaterial

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

class SpecularMaterial(color=None, *, emissive=Color([0., 0., 0., 0., 1.]), emissive_intensity=1.0, specular=Color([0.0667, 0.0667, 0.0667, 0.0000, 1.0000]), shininess=30.0, env_map_intensity=1.0, **kwargs)[source]

Bases: Material

Blinn-Phong shading: diffuse + specular highlight + emissive.

Methods

get_shader_param_values

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

shader

MeshPhongMaterial: Blinn-Phong diffuse + specular highlight + emissive.

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, specular=(0.0666, 0.0666, 0.0666), shininess=30.0, flat_shading=0.0, env_map_intensity=1.0)

MeshPhongMaterial: Blinn-Phong diffuse + specular highlight + emissive.

Twin of shading_taichi._stage_phong; read its docstring for why the specular lobe carries three.js’s 0.25 * (shininess * 0.5 + 1) normalization and its Fresnel term but not its 1/pi (the diffuse lobe drops the same factor, so the ratio between them is three.js’s exactly).

Parameters:
  • light_intensity (float)

  • ambient_light_intensity (float)

  • emissive_intensity (float)

  • shininess (float)

  • flat_shading (float)

  • env_map_intensity (float)