BasicMaterial
BasicMaterial ⟵ Material
A material for rendering geometry with simple flat colors or
textures.
BasicMaterial is the simplest material type that doesn't use lighting
calculations. It renders geometry with their base color, texture, or
vertex colors without any shading effects. This is perfect for UI
elements, unlit geometry, or simple colored geometry.
- No lighting calculations (always flat color)
- Supports textures and vertex colors
- Efficient rendering for simple geometry
- Wireframe mode support
- GameCube TEV optimized for single-stage rendering
- Good for: 2D UI elements, Skyboxes, Particle etc.
Methods
BasicMaterial(Color color, Texture* map, bool transparent, f32 opacity)
Universal constructor with most common parameters
| color | RGBA color value (Color() or hex) | 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 basic material
virtual void copy(const Material& source) override
Copies properties from another material
| source | Source material to copy from |
Properties
| fog | bool | Whether this material is affected by fog |
| wireframe | bool | Whether to render as wireframe |
| wireframeLinewidth | f32 | Line width for wireframe (limited support on GameCube) |