PhongMaterial
This material implements a classic Blinn–Phong lighting model with diffuse and specular reflection. It is intended for standard lit geometry that requires view-dependent highlights, such as polished surfaces or simple metals.
It supports a base color, specular color, shininess exponent, and optional texture maps for albedo, alpha, normals, and specular intensity.
auto material = vglx::PhongMaterial::Create(0x049EF4);
material->specular = 0x333333;
material->shininess = 64.0f;
material->albedo_map = texture;
my_scene->Add(vglx::Mesh::Create(geometry, material));INFO
Derives from Material and inherits all public properties and methods.
Construction
Constructors
PhongMaterial()
Constructs a Phong material with a given base color.
PhongMaterial::PhongMaterial(const Color& color);| Parameter | Description |
|---|---|
| color |
Factories preferred
PhongMaterial::Create() std::shared_ptr<PhongMaterial>
Creates a shared instance of PhongMaterial.
static std::shared_ptr<PhongMaterial> PhongMaterial::Create(const Color& color=0xFFFFFF);| Parameter | Description |
|---|---|
| color |
Properties
Albedo (diffuse) map defining base color and optional alpha channel.
std::shared_ptr<Texture> albedo_map {nullptr};Alpha map defining per-pixel opacity.
std::shared_ptr<Texture> alpha_map {nullptr};Normal map for per-pixel surface detail and lighting variation.
std::shared_ptr<Texture> normal_map {nullptr};shininess float
Controls the glossiness of highlights; higher values yield sharper specular peaks.
float shininess {32.0f};Specular color controlling the tint of specular highlights.
Color specular {0x111111};Specular map scaling the intensity of specular highlights.
std::shared_ptr<Texture> specular_map {nullptr};Functions
Identifies this material as Material::Type::PhongMaterial.
Type PhongMaterial::GetType() const override;