@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
53 lines (52 loc) • 1.75 kB
TypeScript
/**
* A BasicMaterial is for rendering unlit geometry, either using a constant color or a color map
* modulated with a color.
*
* ```javascript
* // Create a new Basic material
* const material = new pc.BasicMaterial();
*
* // Set the material to have a texture map that is multiplied by a red color
* material.color.set(1, 0, 0);
* material.colorMap = diffuseMap;
*
* // Notify the material that it has been modified
* material.update();
* ```
*
* @category Graphics
*/
export class BasicMaterial extends Material {
/**
* The flat color of the material (RGBA, where each component is 0 to 1).
*
* @type {Color}
*/
color: Color;
/** @ignore */
colorUniform: Float32Array<ArrayBuffer>;
/**
* The color map of the material (default is null). If specified, the color map is
* modulated by the color property.
*
* @type {import('../../platform/graphics/texture.js').Texture|null}
*/
colorMap: import("../../platform/graphics/texture.js").Texture | null;
/** @ignore */
vertexColors: boolean;
/**
* Copy a `BasicMaterial`.
*
* @param {BasicMaterial} source - The material to copy from.
* @returns {BasicMaterial} The destination material.
*/
copy(source: BasicMaterial): BasicMaterial;
/**
* @param {import('../../platform/graphics/graphics-device.js').GraphicsDevice} device - The graphics device.
* @param {import('../scene.js').Scene} scene - The scene.
* @ignore
*/
updateUniforms(device: import("../../platform/graphics/graphics-device.js").GraphicsDevice, scene: import("../scene.js").Scene): void;
}
import { Material } from './material.js';
import { Color } from '../../core/math/color.js';