pygfx.materials.MeshPhongMaterial

class pygfx.materials.MeshPhongMaterial(shininess=30, emissive='#000', specular='#494949', **kwargs)

Bases: MeshBasicMaterial

Phong mesh material.

A material affected by light, diffuse and with specular highlights. This material uses the Blinn-Phong reflectance model. If the specular color is turned off, Lambertian shading is obtained.

Parameters:
  • shininess (int) – How shiny the specular highlight is; a higher value gives a sharper highlight.

  • emissive (Color) – The emissive (light) color of the mesh. This color is added to the final color and is unaffected by lighting. The alpha channel of this color is ignored.

  • specular (Color) – The specular (highlight) color of the mesh.

  • kwargs (Any) – Additional kwargs will be passed to the base class.

property emissive

The emissive (light) color of the mesh. This color is added to the final color and is unaffected by lighting. The alpha channel of this color is ignored.

property specular

The specular (highlight) color of the mesh.

property shininess

How shiny the specular highlight is; a higher value gives a sharper highlight. Default is 30.

property emissive_map

The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. Note that both emissive color and emissive map are considered in srgb colorspace. Default None.

property emissive_intensity

Intensity of the emissive light. Modulates the emissive color and emissive map. Default is 1.

Note that the intensity is applied in the physical colorspace. You can think of it as scaling the number of photons. Therefore using an intensity of 0.5 is not the same as halving the emissive color, which is in srgb space.

property normal_scale

How much the normal map affects the material. This 2-tuple is multiplied with the normal_map’s xy components (z is unaffected). Typical ranges are 0-1. Default is (1,1).

property normal_map

The texture to create a normal map. Affects the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.