PBRMaterial
This material implements physically-based rendering with a Cook-Torrance specular term and Lambertian diffuse, parameterized by metallic and roughness factors. It is intended for realistic lit geometry from rough dielectrics such as wood or plastic to polished metals.
auto material = vglx::PBRMaterial::Create({
.color = 0xFFFFFF,
.metallic = 1.0f,
.roughness = 0.4f,
.albedo_map = texture
});
my_scene->Add(vglx::Mesh::Create(geometry, material));INFO
Derives from Material and inherits all public properties and methods.
Construction
Constructors
PBRMaterial()
Constructs a PBR material with default parameters.
PBRMaterial::PBRMaterial();PBRMaterial()
Constructs a PBR material from the given parameters.
PBRMaterial::PBRMaterial(const Parameters& params);| Parameter | Description |
|---|---|
| params | Initialization parameters. |
Factories preferred
PBRMaterial::Create() std::shared_ptr<PBRMaterial>
Creates a shared instance of PBRMaterial with default parameters.
static std::shared_ptr<PBRMaterial> PBRMaterial::Create();PBRMaterial::Create() std::shared_ptr<PBRMaterial>
Creates a shared instance of PBRMaterial.
static std::shared_ptr<PBRMaterial> PBRMaterial::Create(const Parameters& params);| Parameter | Description |
|---|---|
| params | Initialization parameters. |
Types
PBRMaterial::Parameters struct
Parameters for constructing a PBRMaterial object.
| Parameter | Description |
|---|---|
| color Color | Base surface color. |
| emissive_color Color | Emissive color independent of lighting. |
| ao_intensity float | AO contribution strength. |
| emissive_intensity float | Emissive multiplier. |
| metallic float | Metallic factor. |
| normal_intensity float | Normal map strength. |
| roughness float | Roughness factor. |
| alpha_map std::shared_ptr<Texture> | Per-pixel opacity map. |
| ao_map std::shared_ptr<Texture> | Ambient occlusion map (R channel). |
| albedo_map std::shared_ptr<Texture> | Base color map. |
| emissive_map std::shared_ptr<Texture> | Emissive color map. |
| metallic_map std::shared_ptr<Texture> | Metallic map (B channel). |
| normal_map std::shared_ptr<Texture> | Surface normal map. |
| roughness_map std::shared_ptr<Texture> | Roughness map (G channel). |
Properties
Albedo (base color) map multiplied with color per texel.
std::shared_ptr<Texture> albedo_map {};Alpha map defining per-pixel opacity.
std::shared_ptr<Texture> alpha_map {};ao_intensity float
Strength of the ambient occlusion contribution.
float ao_intensity {};Ambient occlusion map sampled from the R channel; modulates the ambient term.
std::shared_ptr<Texture> ao_map {};Emissive color added to the final shaded result, independent of lighting.
Color emissive_color {};emissive_intensity float
Scalar multiplier for emissive contribution.
float emissive_intensity {};Emissive map modulating the emissive color per texel.
std::shared_ptr<Texture> emissive_map {};metallic float
Metallic factor.
float metallic {};Metallic map sampled from the B channel; multiplied with metallic per texel.
std::shared_ptr<Texture> metallic_map {};normal_intensity float
Scalar multiplier for normal map perturbation.
float normal_intensity {};Normal map for per-pixel surface detail and lighting variation.
std::shared_ptr<Texture> normal_map {};roughness float
Roughness factor.
float roughness {};Roughness map sampled from the G channel; multiplied with roughness per texel.
std::shared_ptr<Texture> roughness_map {};Functions
Identifies this material as Material::Type::PBRMaterial.
Type PBRMaterial::GetType() const override;