pygfx.materials.MeshToonMaterial
- class pygfx.materials.MeshToonMaterial(emissive='#000', gradient_map=None, emissive_intensity=1.0, emissive_map=None, normal_map=None, normal_scale=(1, 1), **kwargs)
Bases:
MeshBasicMaterial
A material implementing toon shading.
- Parameters:
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.
gradient_map (Texture) – Gradient map for toon shading. The gradient map sampler method is always ‘nearest’.
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 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.
- property gradient_map
Gradient map for toon shading. The gradient map sampler method is always ‘nearest’.