GCubeSDK
©2026 FenixFox®Studios

PhongMaterial

PhongMaterial ⟵ Material

A material for shiny surfaces with specular highlights.

PhongMaterial implements diffuse lighting using the Phong reflection model. Unlike the LambertMaterial, this can simulate shiny surfaces with specular highlights (such as varnished wood).

  • Ambient light support
  • Multiple light source support
  • Texture mapping with lighting
  • Vertex color modulation
  • Specular color modulation
InheritanceDiagram node_Material Material node_PhongMaterial PhongMaterial node_Material->node_PhongMaterial

Methods

PhongMaterial(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 Phong lighting calculations

virtual void updateGXState() override

Updates GX pipeline state for Phong material

Properties

ambient Color Ambient color (receives ambient light)
emissive Color Emissive color (self
specular Color Specular color
ambientIntensity f32 Ambient light intensity factor
emissiveIntensity f32 Emissive intensity factor
specularIntensity f32 Specular intensity
shininess f32 Specular shininess
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