Skip to content

@orillusion/core


Class: LitMaterial ​

Defined in: src/materials/LitMaterial.ts:25

Physically based lit material supporting albedo, normal, ARM, emissive and other PBR texture/parameter inputs. Serves as the standard surface material.

Extends ​

Extended by ​

Constructors ​

Constructor ​

new LitMaterial(ctx?): LitMaterial

Defined in: src/materials/LitMaterial.ts:30

Parameters ​

ctx? ​

Context3D

Returns ​

LitMaterial

Overrides ​

Material.constructor

Properties ​

instanceID ​

instanceID: string

Defined in: src/materials/Material.ts:26

Material Unique Identifier

Inherited from ​

Material.instanceID


name ​

name: string

Defined in: src/materials/Material.ts:32

name of this material

Inherited from ​

Material.name


enable ​

enable: boolean = true

Defined in: src/materials/Material.ts:35

Whether this material is enabled for rendering.

Inherited from ​

Material.enable

Accessors ​

baseMap ​

Get Signature ​

get baseMap(): Texture

Defined in: src/materials/LitMaterial.ts:97

Get the albedo/base color texture.

Returns ​

Texture

Set Signature ​

set baseMap(texture): void

Defined in: src/materials/LitMaterial.ts:92

Set the albedo/base color texture.

Parameters ​
texture ​

Texture

Returns ​

void


maskMap ​

Get Signature ​

get maskMap(): Texture

Defined in: src/materials/LitMaterial.ts:107

Get the mask texture.

Returns ​

Texture

Set Signature ​

set maskMap(texture): void

Defined in: src/materials/LitMaterial.ts:102

Set the mask texture.

Parameters ​
texture ​

Texture

Returns ​

void


normalMap ​

Get Signature ​

get normalMap(): Texture

Defined in: src/materials/LitMaterial.ts:118

Get the normal map texture.

Returns ​

Texture

Set Signature ​

set normalMap(texture): void

Defined in: src/materials/LitMaterial.ts:113

Set the normal map texture.

Parameters ​
texture ​

Texture

Returns ​

void


emissiveMap ​

Get Signature ​

get emissiveMap(): Texture

Defined in: src/materials/LitMaterial.ts:128

Get the emissive texture.

Returns ​

Texture

Set Signature ​

set emissiveMap(texture): void

Defined in: src/materials/LitMaterial.ts:123

Set the emissive texture.

Parameters ​
texture ​

Texture

Returns ​

void


aoMap ​

Get Signature ​

get aoMap(): Texture

Defined in: src/materials/LitMaterial.ts:138

Get the ambient occlusion texture.

Returns ​

Texture

Set Signature ​

set aoMap(texture): void

Defined in: src/materials/LitMaterial.ts:133

Set the ambient occlusion texture.

Parameters ​
texture ​

Texture

Returns ​

void


sheenColor ​

Get Signature ​

get sheenColor(): Color

Defined in: src/materials/LitMaterial.ts:155

Get the sheen tint (alpha carries the sheen roughness).

Returns ​

Color

Set Signature ​

set sheenColor(value): void

Defined in: src/materials/LitMaterial.ts:147

Sheen tint (KHR_materials_sheen), linear RGB. Setting any non-black color enables the sheen lobe; black disables it again. The color's alpha channel is ignored — use sheenRoughness.

Parameters ​
value ​

Color

Returns ​

void


sheenRoughness ​

Get Signature ​

get sheenRoughness(): number

Defined in: src/materials/LitMaterial.ts:166

Get the sheen roughness.

Returns ​

number

Set Signature ​

set sheenRoughness(value): void

Defined in: src/materials/LitMaterial.ts:160

Sheen roughness, 0 (tight rim) … 1 (broad velvet glow).

Parameters ​
value ​

number

Returns ​

void


anisotropy ​

Get Signature ​

get anisotropy(): number

Defined in: src/materials/LitMaterial.ts:190

Get the anisotropy strength.

Returns ​

number

Set Signature ​

set anisotropy(value): void

Defined in: src/materials/LitMaterial.ts:182

Specular anisotropy strength (KHR_materials_anisotropy), 0…1: how far highlights stretch across the grain direction. Above 0 enables the effect; 0 disables it. The mesh needs UVs — the grain follows +U, turned by anisotropyRotation.

Parameters ​
value ​

number

Returns ​

void


anisotropyRotation ​

Get Signature ​

get anisotropyRotation(): number

Defined in: src/materials/LitMaterial.ts:202

Get the grain rotation in radians.

Returns ​

number

Set Signature ​

set anisotropyRotation(value): void

Defined in: src/materials/LitMaterial.ts:195

Rotation of the grain direction around the normal, in radians, counter-clockwise from +U.

Parameters ​
value ​

number

Returns ​

void


iridescence ​

Get Signature ​

get iridescence(): number

Defined in: src/materials/LitMaterial.ts:223

Get the iridescence strength.

Returns ​

number

Set Signature ​

set iridescence(value): void

Defined in: src/materials/LitMaterial.ts:215

Thin-film iridescence strength (KHR_materials_iridescence), 0…1. Any value above 0 enables the effect; 0 disables it.

Parameters ​
value ​

number

Returns ​

void


iridescenceIOR ​

Get Signature ​

get iridescenceIOR(): number

Defined in: src/materials/LitMaterial.ts:235

Get the thin-film index of refraction.

Returns ​

number

Set Signature ​

set iridescenceIOR(value): void

Defined in: src/materials/LitMaterial.ts:228

Index of refraction of the thin film (default 1.3).

Parameters ​
value ​

number

Returns ​

void


iridescenceThickness ​

Get Signature ​

get iridescenceThickness(): number

Defined in: src/materials/LitMaterial.ts:247

Get the thin-film thickness in nanometres.

Returns ​

number

Set Signature ​

set iridescenceThickness(value): void

Defined in: src/materials/LitMaterial.ts:240

Thin-film thickness in nanometres (typically 100…1000; default 400).

Parameters ​
value ​

number

Returns ​

void


iridescenceThicknessMinimum ​

Get Signature ​

get iridescenceThicknessMinimum(): number

Defined in: src/materials/LitMaterial.ts:259

Get the minimum thin-film thickness in nanometres.

Returns ​

number

Set Signature ​

set iridescenceThicknessMinimum(value): void

Defined in: src/materials/LitMaterial.ts:252

Minimum thin-film thickness in nanometres, used with iridescenceThicknessMap (default 100).

Parameters ​
value ​

number

Returns ​

void


sheenColorMap ​

Get Signature ​

get sheenColorMap(): Texture

Defined in: src/materials/LitMaterial.ts:285

Returns ​

Texture

Set Signature ​

set sheenColorMap(texture): void

Defined in: src/materials/LitMaterial.ts:284

KHR_materials_sheen sheenColorTexture (sRGB): rgb multiplies sheenColor. Only sampled while the sheen lobe is on.

Parameters ​
texture ​

Texture

Returns ​

void


sheenRoughnessMap ​

Get Signature ​

get sheenRoughnessMap(): Texture

Defined in: src/materials/LitMaterial.ts:289

Returns ​

Texture

Set Signature ​

set sheenRoughnessMap(texture): void

Defined in: src/materials/LitMaterial.ts:288

KHR_materials_sheen sheenRoughnessTexture: alpha multiplies sheenRoughness.

Parameters ​
texture ​

Texture

Returns ​

void


iridescenceMap ​

Get Signature ​

get iridescenceMap(): Texture

Defined in: src/materials/LitMaterial.ts:293

Returns ​

Texture

Set Signature ​

set iridescenceMap(texture): void

Defined in: src/materials/LitMaterial.ts:292

KHR_materials_iridescence iridescenceTexture: red multiplies iridescence. Only sampled while iridescence is on.

Parameters ​
texture ​

Texture

Returns ​

void


iridescenceThicknessMap ​

Get Signature ​

get iridescenceThicknessMap(): Texture

Defined in: src/materials/LitMaterial.ts:297

Returns ​

Texture

Set Signature ​

set iridescenceThicknessMap(texture): void

Defined in: src/materials/LitMaterial.ts:296

KHR_materials_iridescence iridescenceThicknessTexture: green lerps the film thickness from iridescenceThicknessMinimum to iridescenceThickness.

Parameters ​
texture ​

Texture

Returns ​

void


specularMap ​

Get Signature ​

get specularMap(): Texture

Defined in: src/materials/LitMaterial.ts:301

Returns ​

Texture

Set Signature ​

set specularMap(texture): void

Defined in: src/materials/LitMaterial.ts:300

KHR_materials_specular specularTexture: alpha multiplies the specular strength (specularColor.a).

Parameters ​
texture ​

Texture

Returns ​

void


specularColorMap ​

Get Signature ​

get specularColorMap(): Texture

Defined in: src/materials/LitMaterial.ts:305

Returns ​

Texture

Set Signature ​

set specularColorMap(texture): void

Defined in: src/materials/LitMaterial.ts:304

KHR_materials_specular specularColorTexture (sRGB): rgb multiplies the F0 tint (specularColor.rgb).

Parameters ​
texture ​

Texture

Returns ​

void


anisotropyMap ​

Get Signature ​

get anisotropyMap(): Texture

Defined in: src/materials/LitMaterial.ts:309

Returns ​

Texture

Set Signature ​

set anisotropyMap(texture): void

Defined in: src/materials/LitMaterial.ts:308

KHR_materials_anisotropy anisotropyTexture: rg = tangent-space direction (0.5 = none), b multiplies anisotropy. Only sampled while anisotropy is on.

Parameters ​
texture ​

Texture

Returns ​

void


clearCoatRoughnessMap ​

Get Signature ​

get clearCoatRoughnessMap(): Texture

Defined in: src/materials/LitMaterial.ts:319

Get the clearcoat roughness texture.

Returns ​

Texture

Set Signature ​

set clearCoatRoughnessMap(texture): void

Defined in: src/materials/LitMaterial.ts:312

Set the clearcoat roughness texture and enable the clearcoat shader path.

Parameters ​
texture ​

Texture

Returns ​

void


clearcoatColor ​

Get Signature ​

get clearcoatColor(): Color

Defined in: src/materials/LitMaterial.ts:330

Get the clearcoat tint color.

Returns ​

Color

Set Signature ​

set clearcoatColor(value): void

Defined in: src/materials/LitMaterial.ts:324

Set the clearcoat tint color and enable the clearcoat shader path.

Parameters ​
value ​

Color

Returns ​

void


clearcoatWeight ​

Get Signature ​

get clearcoatWeight(): number

Defined in: src/materials/LitMaterial.ts:341

Get the clearcoat weight.

Returns ​

number

Set Signature ​

set clearcoatWeight(value): void

Defined in: src/materials/LitMaterial.ts:335

Set the clearcoat weight and enable the clearcoat shader path.

Parameters ​
value ​

number

Returns ​

void


clearcoatFactor ​

Get Signature ​

get clearcoatFactor(): number

Defined in: src/materials/LitMaterial.ts:352

Get the clearcoat factor.

Returns ​

number

Set Signature ​

set clearcoatFactor(value): void

Defined in: src/materials/LitMaterial.ts:346

Set the clearcoat factor and enable the clearcoat shader path.

Parameters ​
value ​

number

Returns ​

void


clearcoatRoughnessFactor ​

Get Signature ​

get clearcoatRoughnessFactor(): number

Defined in: src/materials/LitMaterial.ts:364

Get the clearcoat roughness factor.

Returns ​

number

Set Signature ​

set clearcoatRoughnessFactor(value): void

Defined in: src/materials/LitMaterial.ts:358

Set the clearcoat roughness factor and enable the clearcoat shader path.

Parameters ​
value ​

number

Returns ​

void


ior ​

Get Signature ​

get ior(): number

Defined in: src/materials/LitMaterial.ts:374

Get the index of refraction.

Returns ​

number

Set Signature ​

set ior(value): void

Defined in: src/materials/LitMaterial.ts:369

Set the index of refraction.

Parameters ​
value ​

number

Returns ​

void


alphaCutoff ​

Get Signature ​

get alphaCutoff(): number

Defined in: src/materials/LitMaterial.ts:386

Get the alpha cutoff threshold.

Returns ​

number

Set Signature ​

set alphaCutoff(value): void

Defined in: src/materials/LitMaterial.ts:380

Set the alpha cutoff threshold and enable the alpha-cut shader path.

Parameters ​
value ​

number

Returns ​

void


transmissionMap ​

Get Signature ​

get transmissionMap(): Texture

Defined in: src/materials/LitMaterial.ts:410

Get the transmission texture.

Returns ​

Texture

Set Signature ​

set transmissionMap(texture): void

Defined in: src/materials/LitMaterial.ts:403

glTF KHR_materials_transmission transmissionTexture — R channel is multiplied with transmissionFactor per fragment, so the same material can have opaque + glassy regions (e.g. a frosted window with painted bezels). Setting it implies USE_TRANSMISSION.

Parameters ​
texture ​

Texture

Returns ​

void


transmissionFactor ​

Get Signature ​

get transmissionFactor(): number

Defined in: src/materials/LitMaterial.ts:441

Get the transmission factor.

Returns ​

number

Set Signature ​

set transmissionFactor(value): void

Defined in: src/materials/LitMaterial.ts:415

Set the transmission factor, toggling the transmission shader path and resolving the scene color pyramid.

Parameters ​
value ​

number

Returns ​

void


thicknessFactor ​

Get Signature ​

get thicknessFactor(): number

Defined in: src/materials/LitMaterial.ts:451

Get the volume thickness factor.

Returns ​

number

Set Signature ​

set thicknessFactor(value): void

Defined in: src/materials/LitMaterial.ts:446

Set the volume thickness factor used for transmission attenuation.

Parameters ​
value ​

number

Returns ​

void


thicknessMap ​

Get Signature ​

get thicknessMap(): Texture

Defined in: src/materials/LitMaterial.ts:466

Get the thickness texture.

Returns ​

Texture

Set Signature ​

set thicknessMap(texture): void

Defined in: src/materials/LitMaterial.ts:460

glTF KHR_materials_volume thicknessTexture — G channel scales thicknessFactor per fragment, so a single material can vary from thin (bright, near source color) to thick (heavily attenuated) across its surface. Setting it enables the USE_THICKNESSMAP shader path.

Parameters ​
texture ​

Texture

Returns ​

void


attenuationDistance ​

Get Signature ​

get attenuationDistance(): number

Defined in: src/materials/LitMaterial.ts:483

Get the attenuation distance, returning Infinity when attenuation is effectively disabled.

Returns ​

number

Set Signature ​

set attenuationDistance(value): void

Defined in: src/materials/LitMaterial.ts:473

Distance (in world units) after which the transmitted radiance has been attenuated to 1/e of its initial intensity. Use Number.POSITIVE_INFINITY to disable attenuation.

Parameters ​
value ​

number

Returns ​

void


attenuationColor ​

Get Signature ​

get attenuationColor(): Color

Defined in: src/materials/LitMaterial.ts:494

Get the attenuation (transmission absorption) color.

Returns ​

Color

Set Signature ​

set attenuationColor(value): void

Defined in: src/materials/LitMaterial.ts:489

Set the attenuation (transmission absorption) color.

Parameters ​
value ​

Color

Returns ​

void


transmissionAlphaMode ​

Get Signature ​

get transmissionAlphaMode(): boolean

Defined in: src/materials/LitMaterial.ts:510

Whether transmission also attenuates the output alpha for see-through compositing.

Returns ​

boolean

Set Signature ​

set transmissionAlphaMode(value): void

Defined in: src/materials/LitMaterial.ts:505

When set to true, the transmission shader path attenuates this fragment's output alpha by transmission as well as RGB so an alpha:true swapchain composites whatever's behind the canvas (HTML page background, video element, ...) through the glass. Off by default — opaque-queue draws keep alpha=1 so demos that share an opaque canvas with other geometry don't inherit unwanted blending.

Parameters ​
value ​

boolean

Returns ​

void


alphaMode ​

Get Signature ​

get alphaMode(): AlphaMode

Defined in: src/materials/LitMaterial.ts:515

glTF-aligned alpha handling. See AlphaMode.

Returns ​

AlphaMode

Set Signature ​

set alphaMode(mode): void

Defined in: src/materials/LitMaterial.ts:520

Set the glTF-aligned alpha mode, configuring blend/discard state and render queue accordingly.

Parameters ​
mode ​

AlphaMode

Returns ​

void


baseColor ​

Get Signature ​

get baseColor(): Color

Defined in: src/materials/LitMaterial.ts:599

get base color (tint color)

Returns ​

Color

Set Signature ​

set baseColor(color): void

Defined in: src/materials/LitMaterial.ts:592

set base color (tint color)

Parameters ​
color ​

Color

Returns ​

void

Overrides ​

Material.baseColor


roughness ​

Get Signature ​

get roughness(): number

Defined in: src/materials/LitMaterial.ts:604

Get the surface roughness.

Returns ​

number

Set Signature ​

set roughness(value): void

Defined in: src/materials/LitMaterial.ts:609

Set the surface roughness.

Parameters ​
value ​

number

Returns ​

void


metallic ​

Get Signature ​

get metallic(): number

Defined in: src/materials/LitMaterial.ts:614

Get the metallic factor.

Returns ​

number

Set Signature ​

set metallic(value): void

Defined in: src/materials/LitMaterial.ts:619

Set the metallic factor.

Parameters ​
value ​

number

Returns ​

void


emissiveColor ​

Get Signature ​

get emissiveColor(): Color

Defined in: src/materials/LitMaterial.ts:624

Get the emissive color.

Returns ​

Color

Set Signature ​

set emissiveColor(value): void

Defined in: src/materials/LitMaterial.ts:629

Set the emissive color.

Parameters ​
value ​

Color

Returns ​

void


emissiveIntensity ​

Get Signature ​

get emissiveIntensity(): number

Defined in: src/materials/LitMaterial.ts:634

Get the emissive intensity.

Returns ​

number

Set Signature ​

set emissiveIntensity(value): void

Defined in: src/materials/LitMaterial.ts:639

Set the emissive intensity.

Parameters ​
value ​

number

Returns ​

void


ao ​

Get Signature ​

get ao(): number

Defined in: src/materials/LitMaterial.ts:644

Get the ambient occlusion factor.

Returns ​

number

Set Signature ​

set ao(value): void

Defined in: src/materials/LitMaterial.ts:649

Set the ambient occlusion factor.

Parameters ​
value ​

number

Returns ​

void


oitMode ​

Get Signature ​

get oitMode(): "sorted" | "weighted" | "depth-peel"

Defined in: src/materials/Material.ts:69

Order-independent transparency mode opt-in.

  • 'sorted' (default): back-to-front sorted alpha-blend. Cheap, correct between meshes, but in-mesh triangle order is geometry- based not depth-based so self-overlapping meshes (spheres, torus) show banding.
  • 'weighted': McGuire-Bavoil 2013 Weighted-Blended OIT. Single- pass, order-independent, no in-mesh banding. Approximate — accum.rgb/accum.a degenerates to a depth-weighted average so α=1 looks averaged-milky at small scene scales (the front-vs- back depth-weight ratio saturates the paper's z/200 norm). Use for unbounded transparent layer counts: particles, smoke, foliage, hair cards.
  • 'depth-peel': Dual depth peeling. Multi-pass (passCount × 2 layers), order-correct over operator. α=1 is cleanly opaque — front fragment dominates because subsequent layers get multiplied by (1 - frontColor.a) = 0. Hard layer count limit (default 10). Use for hero glass, scientific visualization, layered architectural geometry.

All three only take effect when engine.setting.render.useOIT is true (otherwise everything falls through the sorted path).

Setter notifies attached renderers so the corresponding derived pass(es) get lazily generated when flipping mode at runtime. Without this, callers had to follow up with an alphaMode setter call to provoke refreshRenderClassification → castNeedPass.

Documented at Material-level (not LitMaterial) so any future material subclass (particle, decal) can opt in.

Returns ​

"sorted" | "weighted" | "depth-peel"

Set Signature ​

set oitMode(value): void

Defined in: src/materials/Material.ts:74

Set the order-independent transparency mode, notifying renderers to re-classify the affected passes.

Parameters ​
value ​

"sorted" | "weighted" | "depth-peel"

Returns ​

void

Inherited from ​

Material.oitMode


shader ​

Get Signature ​

get shader(): Shader

Defined in: src/materials/Material.ts:96

Get the shader bound to this material.

Returns ​

Shader

Set Signature ​

set shader(shader): void

Defined in: src/materials/Material.ts:90

Set the shader for this material and cache its default sub-shader.

Parameters ​
shader ​

Shader

Returns ​

void

Inherited from ​

Material.shader


doubleSide ​

Get Signature ​

get doubleSide(): boolean

Defined in: src/materials/Material.ts:101

Whether the default sub-shader renders both faces (no back-face culling).

Returns ​

boolean

Set Signature ​

set doubleSide(value): void

Defined in: src/materials/Material.ts:106

Enable or disable double-sided rendering on the default sub-shader.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

WaterMaterial.doubleSide


castShadow ​

Get Signature ​

get castShadow(): boolean

Defined in: src/materials/Material.ts:111

Whether this material casts shadows.

Returns ​

boolean

Set Signature ​

set castShadow(value): void

Defined in: src/materials/Material.ts:116

Enable or disable shadow casting for this material.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

WaterMaterial.castShadow


acceptShadow ​

Get Signature ​

get acceptShadow(): boolean

Defined in: src/materials/Material.ts:124

Whether this material receives shadows from other casters.

Returns ​

boolean

Set Signature ​

set acceptShadow(value): void

Defined in: src/materials/Material.ts:129

Enable or disable shadow receiving for this material.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

Material.acceptShadow


castReflection ​

Get Signature ​

get castReflection(): boolean

Defined in: src/materials/Material.ts:139

Whether this material contributes to reflection probes.

Returns ​

boolean

Set Signature ​

set castReflection(value): void

Defined in: src/materials/Material.ts:144

Enable or disable reflection casting for this material.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

Material.castReflection


blendMode ​

Get Signature ​

get blendMode(): BlendMode

Defined in: src/materials/Material.ts:149

The blend mode of the default sub-shader.

Returns ​

BlendMode

Set Signature ​

set blendMode(value): void

Defined in: src/materials/Material.ts:154

Set the blend mode of the default sub-shader.

Parameters ​
value ​

BlendMode

Returns ​

void

Inherited from ​

WaterMaterial.blendMode


depthCompare ​

Get Signature ​

get depthCompare(): GPUCompareFunction

Defined in: src/materials/Material.ts:159

The depth comparison function of the default sub-shader.

Returns ​

GPUCompareFunction

Set Signature ​

set depthCompare(value): void

Defined in: src/materials/Material.ts:164

Set the depth comparison function across all passes of this material.

Parameters ​
value ​

GPUCompareFunction

Returns ​

void

Inherited from ​

Material.depthCompare


transparent ​

Get Signature ​

get transparent(): boolean

Defined in: src/materials/Material.ts:175

Whether this material is rendered as transparent.

Returns ​

boolean

Set Signature ​

set transparent(value): void

Defined in: src/materials/Material.ts:180

Enable or disable transparency, moving the pass to the transparent queue when enabled.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

WaterMaterial.transparent


cullMode ​

Get Signature ​

get cullMode(): GPUCullMode

Defined in: src/materials/Material.ts:188

The face culling mode of the default sub-shader.

Returns ​

GPUCullMode

Set Signature ​

set cullMode(value): void

Defined in: src/materials/Material.ts:193

Set the face culling mode across all passes of this material.

Parameters ​
value ​

GPUCullMode

Returns ​

void

Inherited from ​

UnLitTexArrayMaterial.cullMode


depthWriteEnabled ​

Get Signature ​

get depthWriteEnabled(): boolean

Defined in: src/materials/Material.ts:205

Whether depth writing is enabled for the default sub-shader.

Returns ​

boolean

Set Signature ​

set depthWriteEnabled(value): void

Defined in: src/materials/Material.ts:210

Enable or disable depth writing for the default sub-shader.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

Material.depthWriteEnabled


stencilFront ​

Get Signature ​

get stencilFront(): GPUStencilFaceState

Defined in: src/materials/Material.ts:217

Stencil front face state

Returns ​

GPUStencilFaceState

Set Signature ​

set stencilFront(value): void

Defined in: src/materials/Material.ts:222

Set the stencil front face state.

Parameters ​
value ​

GPUStencilFaceState

Returns ​

void

Inherited from ​

Material.stencilFront


stencilBack ​

Get Signature ​

get stencilBack(): GPUStencilFaceState

Defined in: src/materials/Material.ts:229

Stencil back face state

Returns ​

GPUStencilFaceState

Set Signature ​

set stencilBack(value): void

Defined in: src/materials/Material.ts:234

Set the stencil back face state.

Parameters ​
value ​

GPUStencilFaceState

Returns ​

void

Inherited from ​

Material.stencilBack


stencilReadMask ​

Get Signature ​

get stencilReadMask(): number

Defined in: src/materials/Material.ts:241

Stencil read mask

Returns ​

number

Set Signature ​

set stencilReadMask(value): void

Defined in: src/materials/Material.ts:246

Set the stencil read mask.

Parameters ​
value ​

number

Returns ​

void

Inherited from ​

Material.stencilReadMask


stencilWriteMask ​

Get Signature ​

get stencilWriteMask(): number

Defined in: src/materials/Material.ts:253

Stencil write mask

Returns ​

number

Set Signature ​

set stencilWriteMask(value): void

Defined in: src/materials/Material.ts:258

Set the stencil write mask.

Parameters ​
value ​

number

Returns ​

void

Inherited from ​

Material.stencilWriteMask


stencilRef ​

Get Signature ​

get stencilRef(): number

Defined in: src/materials/Material.ts:265

Stencil reference value

Returns ​

number

Set Signature ​

set stencilRef(value): void

Defined in: src/materials/Material.ts:270

Set the stencil reference value.

Parameters ​
value ​

number

Returns ​

void

Inherited from ​

Material.stencilRef


useBillboard ​

Set Signature ​

set useBillboard(value): void

Defined in: src/materials/Material.ts:275

Enable or disable billboard orientation via the USE_BILLBOARD shader define.

Parameters ​
value ​

boolean

Returns ​

void

Inherited from ​

Material.useBillboard


topology ​

Get Signature ​

get topology(): GPUPrimitiveTopology

Defined in: src/materials/Material.ts:280

The primitive topology of the default sub-shader.

Returns ​

GPUPrimitiveTopology

Set Signature ​

set topology(value): void

Defined in: src/materials/Material.ts:285

Set the primitive topology of the default sub-shader.

Parameters ​
value ​

GPUPrimitiveTopology

Returns ​

void

Inherited from ​

Material.topology

Methods ​

clone() ​

clone(): Material

Defined in: src/materials/LitMaterial.ts:38

Clone this material into a new LitMaterial, copying PBR uniforms and textures.

Returns ​

Material

Overrides ​

Material.clone


getPass() ​

getPass(passType): RenderShaderPass[]

Defined in: src/materials/Material.ts:304

get render pass by renderType

Parameters ​

passType ​

PassType

Returns ​

RenderShaderPass[]

Inherited from ​

Material.getPass


getAllPass() ​

getAllPass(): RenderShaderPass[]

Defined in: src/materials/Material.ts:312

get all color render pass

Returns ​

RenderShaderPass[]

Inherited from ​

Material.getAllPass


destroy() ​

destroy(force): void

Defined in: src/materials/Material.ts:328

Release this material's shader and clear its identifying fields.

Parameters ​

force ​

boolean

Returns ​

void

Inherited from ​

Material.destroy


setDefine() ​

setDefine(define, value): void

Defined in: src/materials/Material.ts:337

Set a shader define flag on this material's shader.

Parameters ​

define ​

string

value ​

boolean

Returns ​

void

Inherited from ​

Material.setDefine


getDefine() ​

getDefine(define): boolean

Defined in: src/materials/Material.ts:342

Get the value of a shader define flag.

Parameters ​

define ​

string

Returns ​

boolean

Inherited from ​

Material.getDefine


setTexture() ​

setTexture(propertyName, texture): void

Defined in: src/materials/Material.ts:347

Bind a texture to the named shader property.

Parameters ​

propertyName ​

string

texture ​

Texture

Returns ​

void

Inherited from ​

Material.setTexture


setStorageBuffer() ​

setStorageBuffer(propertyName, buffer): void

Defined in: src/materials/Material.ts:352

Bind a storage GPU buffer to the named shader property.

Parameters ​

propertyName ​

string

buffer ​

StorageGPUBuffer

Returns ​

void

Inherited from ​

Material.setStorageBuffer


setUniformBuffer() ​

setUniformBuffer(propertyName, buffer): void

Defined in: src/materials/Material.ts:357

Bind a uniform GPU buffer to the named shader property.

Parameters ​

propertyName ​

string

buffer ​

UniformGPUBuffer

Returns ​

void

Inherited from ​

Material.setUniformBuffer


setUniformFloat() ​

setUniformFloat(propertyName, value): void

Defined in: src/materials/Material.ts:363

Set a float uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

number

Returns ​

void

Inherited from ​

Material.setUniformFloat


setUniformInt32() ​

setUniformInt32(propertyName, value): void

Defined in: src/materials/Material.ts:368

Set a 32-bit integer uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

number

Returns ​

void

Inherited from ​

Material.setUniformInt32


setUniformVector2() ​

setUniformVector2(propertyName, value): void

Defined in: src/materials/Material.ts:373

Set a Vector2 uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

Vector2

Returns ​

void

Inherited from ​

Material.setUniformVector2


setUniformVector3() ​

setUniformVector3(propertyName, value): void

Defined in: src/materials/Material.ts:378

Set a Vector3 uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

Vector3

Returns ​

void

Inherited from ​

Material.setUniformVector3


setUniformVector4() ​

setUniformVector4(propertyName, value): void

Defined in: src/materials/Material.ts:383

Set a Vector4 uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

Vector4

Returns ​

void

Inherited from ​

Material.setUniformVector4


setUniformColor() ​

setUniformColor(propertyName, value): void

Defined in: src/materials/Material.ts:388

Set a color uniform on the named shader property.

Parameters ​

propertyName ​

string

value ​

Color

Returns ​

void

Inherited from ​

Material.setUniformColor


getUniformFloat() ​

getUniformFloat(str): any

Defined in: src/materials/Material.ts:393

Get the float value of the named uniform.

Parameters ​

str ​

string

Returns ​

any

Inherited from ​

Material.getUniformFloat


getUniformInt32() ​

getUniformInt32(str): any

Defined in: src/materials/Material.ts:398

Get the 32-bit integer value of the named uniform.

Parameters ​

str ​

string

Returns ​

any

Inherited from ​

Material.getUniformInt32


getUniformV2() ​

getUniformV2(str): Vector2

Defined in: src/materials/Material.ts:403

Get the Vector2 value of the named uniform.

Parameters ​

str ​

string

Returns ​

Vector2

Inherited from ​

Material.getUniformV2


getUniformV3() ​

getUniformV3(str): Vector3

Defined in: src/materials/Material.ts:408

Get the Vector3 value of the named uniform.

Parameters ​

str ​

string

Returns ​

Vector3

Inherited from ​

Material.getUniformV3


getUniformV4() ​

getUniformV4(str): Vector4

Defined in: src/materials/Material.ts:413

Get the Vector4 value of the named uniform.

Parameters ​

str ​

string

Returns ​

Vector4

Inherited from ​

Material.getUniformV4


getUniformColor() ​

getUniformColor(str): Color

Defined in: src/materials/Material.ts:418

Get the color value of the named uniform.

Parameters ​

str ​

string

Returns ​

Color

Inherited from ​

Material.getUniformColor


getTexture() ​

getTexture(str): Texture

Defined in: src/materials/Material.ts:423

Get the texture bound to the named shader property.

Parameters ​

str ​

string

Returns ​

Texture

Inherited from ​

Material.getTexture


getStorageBuffer() ​

getStorageBuffer(str): StorageGPUBuffer

Defined in: src/materials/Material.ts:428

Get the storage buffer bound to the named shader property.

Parameters ​

str ​

string

Returns ​

StorageGPUBuffer

Inherited from ​

Material.getStorageBuffer


getStructStorageBuffer() ​

getStructStorageBuffer(str): GPUBufferBase

Defined in: src/materials/Material.ts:433

Get the struct storage buffer bound to the named shader property.

Parameters ​

str ​

string

Returns ​

GPUBufferBase

Inherited from ​

Material.getStructStorageBuffer


getUniformBuffer() ​

getUniformBuffer(str): GPUBufferBase

Defined in: src/materials/Material.ts:438

Get the uniform buffer bound to the named shader property.

Parameters ​

str ​

string

Returns ​

GPUBufferBase

Inherited from ​

Material.getUniformBuffer


applyUniform() ​

applyUniform(): void

Defined in: src/materials/Material.ts:443

Upload pending uniform changes to the GPU.

Returns ​

void

Inherited from ​

Material.applyUniform

Released under the MIT License