vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::MaterialAsset Struct Reference

A complete PBR material. More...

#include <material_asset.h>

Inheritance diagram for Vkm::Engine::MaterialAsset:
Vkm::Engine::Resource

Public Attributes

float alphaCutoff = 0.5f
 AlphaMask: discard below this albedo alpha (glTF default 0.5)
glm::vec4 albedo = {1,1,1,1}
 Base color (RGB) + opacity (A; Transparent type blends on it)
float metallic = 0.0f
float roughness = 0.5f
 Surface roughness (0: smooth, 1: rough); GGX alpha = roughness^2.
float ior = 1.5f
float ao = 1.0f
 Ambient occlusion factor on indirect light (0: occluded, 1: open)
float normalScale = 1.0f
 Normal map intensity (0: flat, 1: as authored, >1: exaggerated)
glm::vec3 emission = {0,0,0}
 Emissive color (RGB), linear.
float emissiveStrength = 1.0f
 HDR multiplier on emission.
float clearcoat = 0.0f
 Clearcoat layer strength (0: none, 1: full); attenuates the base layer.
float clearcoatRoughness = 0.0f
 Clearcoat lobe roughness (0: smooth, 1: rough)
float anisotropy = 0.0f
 Anisotropy strength (0: isotropic, 1: fully anisotropic)
glm::vec3 anisotropyDirection = {1,0,0}
 Anisotropy direction (tangent space)
glm::vec3 sheenColor = {0,0,0}
 Sheen tint, Charlie lobe (0 = disabled); cloth / velvet.
float sheenRoughness = 0.3f
 Sheen lobe roughness.
float subsurface = 0.0f
 Subsurface scattering strength; skin / wax / leaves.
glm::vec3 subsurfaceColor = {1,1,1}
 Subsurface color tint.
float transmission = 0.0f
 Fraction of light refracted instead of diffused (0: opaque, 1: glass)
float thicknessFactor = 0.0f
 Volume thickness in metres (0: thin-walled, no absorption)
float attenuationDistance = 1.0f
 Path length at which radiance reaches attenuationColor (m)
glm::vec3 attenuationColor = {1,1,1}
 Transmittance after one attenuationDistance (white = no tint)
float heightScale = 0.0f
 Parallax-occlusion depth scale (0: off; 0.02-0.1 typical)

Additional Inherited Members

Public Member Functions inherited from Vkm::Engine::Resource
 Resource (const Resource &other)
 Duplicate other's contents and name, but not its identity.
const std::string & name () const noexcept
 Serializable identity; non-empty and unique within its type once added.
uint64_t uid () const noexcept
 Process-unique id stamped by add(); names the asset, not the slot it sits in.
uint64_t version () const noexcept
 Change counter the backend keys GPU re-uploads on; moved by commit().
bool isHidden () const noexcept
 Added by ResourceManager::addPrivate: not user-facing, not saved.
nlohmann::json & sourceJson ()
 Mutable source JSON, allocating a null document if there is none.
const nlohmann::json & sourceJson () const
 Const source JSON; asserts hasSource(), so guard the call with it.

Detailed Description

A complete PBR material.

The Disney/glTF principled model; each scalar multiplies its map when one is bound. Fields here and shader support move in lockstep.

Member Data Documentation

◆ metallic

float Vkm::Engine::MaterialAsset::metallic = 0.0f

Metalness (0: dielectric, 1: metallic)

◆ ior

float Vkm::Engine::MaterialAsset::ior = 1.5f

Index of refraction; dielectric F0 = ((ior-1)/(ior+1))^2


The documentation for this struct was generated from the following file: