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 |
virtual void setupTEVStages() override
Configures TEV stages for Lambert lighting calculations
virtual void updateGXState() override
Updates GX pipeline state for Lambert material
Properties
| ambient | Color | Ambient color (receives ambient light) |
| emissive | Color | Emissive color (self |
| ambientIntensity | f32 | Ambient light intensity factor |
| emissiveIntensity | f32 | Emissive intensity factor |
| receiveShadows | bool | Whether this material receives shadows |
| castShadows | bool | Whether objects with this material cast shadows |
| flatShading | bool | Use flat shading instead of smooth shading |
| wireframe | bool | Whether to render as wireframe |
| wireframeLinewidth | f32 | Line width for wireframe (limited support on GameCube) |
| fog | bool | Whether this material is affected by fog |