Skip to content

Documentation / scene / IMixinLight

Type Alias: IMixinLight

IMixinLight = object & TextureMixinInstanceTypes<["normal"]> & IMixinAlbedoColor

Defined in: libs/scene/src/material/mixins/lit.ts:22

Interface for light mixin

Type Declaration

normalScale

normalScale: number

normalMapMode

normalMapMode: "tangent-space" | "object-space"

doubleSidedLighting

doubleSidedLighting: boolean

needCalculateEnvLight()

needCalculateEnvLight(): boolean

Returns

boolean

getUniformNormalScale()

getUniformNormalScale(scope): PBShaderExp

Parameters

scope

PBInsideFunctionScope

Returns

PBShaderExp

getEnvLightIrradiance()

getEnvLightIrradiance(scope, normal): PBShaderExp

Parameters

scope

PBInsideFunctionScope

normal

PBShaderExp

Returns

PBShaderExp

getEnvLightRadiance()

getEnvLightRadiance(scope, reflectVec, roughness): PBShaderExp

Parameters

scope

PBInsideFunctionScope

reflectVec

PBShaderExp

roughness

PBShaderExp

Returns

PBShaderExp

calculateViewVector()

calculateViewVector(scope, worldPos): PBShaderExp

Parameters

scope

PBInsideFunctionScope

worldPos

PBShaderExp

Returns

PBShaderExp

calculateReflectionVector()

calculateReflectionVector(scope, normal, viewVec): PBShaderExp

Parameters

scope

PBInsideFunctionScope

normal

PBShaderExp

viewVec

PBShaderExp

Returns

PBShaderExp

calculateTBN()

calculateTBN(scope, worldPos, worldNormal?, worldTangent?, worldBinormal?): PBShaderExp

Parameters

scope

PBInsideFunctionScope

worldPos

PBShaderExp

worldNormal?

PBShaderExp

worldTangent?

PBShaderExp

worldBinormal?

PBShaderExp

Returns

PBShaderExp

calculateNormal()

calculateNormal(scope, worldPos, worldNormal?, worldTangent?, worldBinormal?): PBShaderExp

Parameters

scope

PBInsideFunctionScope

worldPos

PBShaderExp

worldNormal?

PBShaderExp

worldTangent?

PBShaderExp

worldBinormal?

PBShaderExp

Returns

PBShaderExp

calculateNormalAndTBN()

calculateNormalAndTBN(scope, worldPos, worldNormal?, worldTangent?, worldBinormal?): PBShaderExp

Parameters

scope

PBInsideFunctionScope

worldPos

PBShaderExp

worldNormal?

PBShaderExp

worldTangent?

PBShaderExp

worldBinormal?

PBShaderExp

Returns

PBShaderExp

calculateLightAttenuation()

calculateLightAttenuation(scope, type, worldPos, posRange, dirCutoff): PBShaderExp

Parameters

scope

PBInsideFunctionScope

type

PBShaderExp

worldPos

PBShaderExp

posRange

PBShaderExp

dirCutoff

PBShaderExp

Returns

PBShaderExp

calculateLightDirection()

calculateLightDirection(scope, type, worldPos, posRange, dirCutoff): PBShaderExp

Parameters

scope

PBInsideFunctionScope

type

PBShaderExp

worldPos

PBShaderExp

posRange

PBShaderExp

dirCutoff

PBShaderExp

Returns

PBShaderExp

calculateShadow()

calculateShadow(scope, worldPos, NoL): PBShaderExp

Parameters

scope

PBInsideFunctionScope

worldPos

PBShaderExp

NoL

PBShaderExp

Returns

PBShaderExp

forEachLight()

forEachLight(scope, callback): void

Parameters

scope

PBInsideFunctionScope

callback

(this, type, posRange, dirCutoff, colorIntensity, extra, shadow) => void

Returns

void

Released under the MIT License.