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

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

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
shininess f32 Specular shininess - 128.0f
specular Color Specular color
specularIntensity f32 Specular intensity - 1.0f
wireframe bool Whether to render as wireframe
wireframeLinewidth f32 Line width for wireframe (limited support on GameCube)