LambertMaterial
LambertMaterial ⟵ Material
A material for rendering objects with Lambertian diffuse
lighting.
LambertMaterial implements diffuse lighting using Lambert's cosine law.
This creates realistic shading where surfaces are brighter when facing
light sources directly and darker when the light hits at an angle.
- Ambient light support
- Multiple light source support
- Texture mapping with lighting
- Vertex color modulation
Methods
LambertMaterial(const Color& color, Texture* map, bool transparent, f32 opacity)
Universal constructor with most common parameters
| color | Color value (e.g., Color(0xff0000)) | 0xFFFFFFFF (white) |
| map | Texture pointer | nullptr |
| transparent | Enable transparency | false |
| opacity | Opacity value (0.0-1.0) | 1.0f |
virtual void apply() override
Applies this material's settings to the GX pipeline
virtual Material* clone() const override
Creates a copy of this lambert material
virtual void copy(const Material& source) override
Copies properties from another material
| source | Source material to copy from |
Properties
| ambient | Color | Ambient color (receives ambient light) |
| ambientIntensity | f32 | Ambient light intensity factor |
| castShadows | bool | Whether objects with this material cast shadows |
| emissive | Color | Emissive color (self-illumination) |
| emissiveIntensity | f32 | Emissive intensity factor |
| flatShading | bool | Use flat shading instead of smooth shading |
| fog | bool | Whether this material is affected by fog |
| receiveShadows | bool | Whether this material receives shadows |
| wireframe | bool | Whether to render as wireframe |
| wireframeLinewidth | f32 | Line width for wireframe (limited support on GameCube) |