PhongMaterial
Represents a material for shiny surfaces with specular highlights.
This material implements the Blinn-Phong model for calculating reflectance. It is suitable for rendering glossy or metallic surfaces that require highlights and simulate light interaction.
cpp
auto material = vglx::PhongMaterial::Create(0x049EF4);
material->specular = {0.3f, 0.3, 0.3f}
material->shininess = 32.0f;
material->albedo_map = texture;
auto mesh = vglx::Mesh::Create(geometry, material);
scene->Add(mesh);
INFO
Derives from Material and inherits all public properties and methods.
Construction
Constructors
PhongMaterial()
cpp
vglx::PhongMaterial::PhongMaterial(const Color &color)
Parameter | Description |
---|---|
color | Color of the material. |
Constructs a PhongMaterial object.
Factories preferred
PhongMaterial::Create() auto
cpp
static auto vglx::PhongMaterial::Create(const Color &color=0xFFFFFF)
Parameter | Description |
---|---|
color | Color of the material. |
Creates a shared pointer to a PhongMaterial object.
Properties
Albedo (base color) map, optionally containing an alpha channel.
Alpha map that controls the opacity across the surface.
Normal map that perturbs surface normals for detailed shading.
shininess float
cpp
float shininess { 32.0f }
How shiny the specular highlight is; a higher value gives a sharper highlight.
Functions
GetType() MaterialType virtual
cpp
MaterialType vglx::PhongMaterial::GetType() const override
Returns material type.