Base color
Base color sets the diffuse color of a dielectric and the reflected color of a metal, combining a factor, a texture, and vertex colors.
Configuration​
import {Model} from '@luma.gl/engine/api';
import {createPBRMaterial, type PBRMaterial} from '@luma.gl/engine/materials';
const material: PBRMaterial = createPBRMaterial(device, {
uniforms: {
baseColorFactor: [0.8, 0.3, 0.1, 1],
metallicRoughnessValues: [0, 0.7]
}
});
// modelProps contains your shaders, geometry, and buffer layout.
const model = new Model(device, {
...modelProps,
material
});
Parameters​
| Parameter | Default | Description |
|---|---|---|
baseColorFactor | [1, 1, 1, 1] | Linear RGBA multiplier, including opacity in alpha. |
baseColorMapEnabled | false | Enables the base-color texture slot. |
Texture bindings​
| Binding | Model define | Description |
|---|---|---|
pbr_baseColorSampler | HAS_BASECOLORMAP: true | sRGB RGB color and linear alpha. |
See Using PBR materials for material setup.
Remarks​
- Core glTF supplies
pbrMetallicRoughness.baseColorFactorandbaseColorTexture. Vertex colors fromCOLOR_0multiply both.