playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
76 lines (75 loc) • 2.75 kB
JavaScript
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
import { LitShaderOptions } from "../shader-lib/programs/lit-shader-options.js";
class StandardMaterialOptions {
constructor() {
/**
* The set of defines used to generate the shader.
*
* @type {Map<string, string>}
*/
__publicField(this, "defines", /* @__PURE__ */ new Map());
/**
* If UV1 (second set of texture coordinates) is required in the shader. Will be declared as
* "vUv1" and passed to the fragment shader.
*/
__publicField(this, "forceUv1", false);
/**
* Defines if {@link StandardMaterial#specular} constant should affect specular color.
*/
__publicField(this, "specularTint", false);
/**
* Defines if {@link StandardMaterial#metalness} constant should affect metalness value.
*/
__publicField(this, "metalnessTint", false);
/**
* Defines if {@link StandardMaterial#gloss} constant should affect glossiness value.
*/
__publicField(this, "glossTint", false);
__publicField(this, "emissiveEncoding", "linear");
__publicField(this, "lightMapEncoding", "linear");
__publicField(this, "vertexColorGamma", false);
/**
* If normal map contains X in RGB, Y in Alpha, and Z must be reconstructed.
*/
__publicField(this, "packedNormal", false);
/**
* If normal detail map contains X in RGB, Y in Alpha, and Z must be reconstructed.
*/
__publicField(this, "normalDetailPackedNormal", false);
/**
* If normal clear coat map contains X in RGB, Y in Alpha, and Z must be reconstructed.
*/
__publicField(this, "clearCoatPackedNormal", false);
/**
* Invert the gloss channel.
*/
__publicField(this, "glossInvert", false);
/**
* Invert the sheen gloss channel.
*/
__publicField(this, "sheenGlossInvert", false);
/**
* Invert the clearcoat gloss channel.
*/
__publicField(this, "clearCoatGlossInvert", false);
/**
* True to include AO variables even if AO is not used, which allows SSAO to be used in the lit shader.
*/
__publicField(this, "useAO", false);
/**
* Storage for the options for lit the shader and material.
*
* @type {LitShaderOptions}
*/
__publicField(this, "litOptions", new LitShaderOptions());
}
// program-library assumes material options has a pass property
get pass() {
return this.litOptions.pass;
}
}
export {
StandardMaterialOptions
};