Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation for Area Lights #16078

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a82ca13
Added area lights object
SergioRZMasson Oct 18, 2024
19f3e2e
Added area lights object
SergioRZMasson Oct 18, 2024
cc027a1
Added initial shader implementation
SergioRZMasson Oct 21, 2024
6657813
Fixed shader tipo
SergioRZMasson Oct 21, 2024
44553d8
Fixed shader compilation errors
SergioRZMasson Oct 21, 2024
267157e
Fixed texures bind
SergioRZMasson Oct 21, 2024
8c3786a
Trying to get textures to work
SergioRZMasson Oct 21, 2024
e1f9c2d
Get specular to work
SergioRZMasson Oct 22, 2024
f4f10a3
Small fixes
SergioRZMasson Oct 22, 2024
9d38e67
Fixed sampling
SergioRZMasson Oct 22, 2024
b135647
Merge branch 'master' of https://github.com/SergioRZMasson/Babylon.js…
SergioRZMasson Nov 27, 2024
7b5e66c
Changed AreaLights to use roughness in the Standard material instead …
SergioRZMasson Nov 27, 2024
71e8de9
Initial implementation for PBR
SergioRZMasson Nov 28, 2024
5552e12
Cleanup of PBR Area light code
SergioRZMasson Nov 28, 2024
db54467
Moved LTC texture to side tool
SergioRZMasson Dec 2, 2024
812e12f
Merge branch 'master' into sergio/area-light
SergioRZMasson Dec 5, 2024
2834639
Merged with master
SergioRZMasson Dec 9, 2024
5d4ee0d
Changed area lights to use base64 encoded float16
SergioRZMasson Dec 10, 2024
6a82d4e
Merged ltc data into single array
SergioRZMasson Dec 10, 2024
80848a8
Changed LTC2 texture to be RGB
SergioRZMasson Dec 10, 2024
026ac3d
Changed base64 to use Babylon's encoder
SergioRZMasson Dec 10, 2024
653f990
Moved area lights to be bind at the material level
SergioRZMasson Dec 12, 2024
d770a0a
Fixed shaders for standard material
SergioRZMasson Dec 12, 2024
bffff65
Small code cleanup
SergioRZMasson Dec 12, 2024
1ff3a5c
Moved LTC texture tools to the correct place
SergioRZMasson Dec 16, 2024
c6f3ead
Added LTC as binary folder
SergioRZMasson Dec 16, 2024
af2ca91
Added ltc bin to cdn
SergioRZMasson Dec 16, 2024
3c733e7
Added implementation to standard material
SergioRZMasson Dec 16, 2024
415818b
Added inspector element for areaLights
SergioRZMasson Jan 8, 2025
e137096
Renamed areaLight to rectAreaLight
SergioRZMasson Jan 8, 2025
484561b
Renamed areaLight to rectAreaLight
SergioRZMasson Jan 8, 2025
2e96a62
Merged with master
SergioRZMasson Jan 8, 2025
2ba432e
Moved shader code to not be compiled when there are no Area Lights
SergioRZMasson Jan 13, 2025
87311c8
Fixed file names and function signatures
SergioRZMasson Jan 13, 2025
edc1904
Added notes to handle NME
SergioRZMasson Jan 13, 2025
98d0a40
Reduced code complexity for setting area lights width and height
SergioRZMasson Jan 13, 2025
6eb0f1f
Fixed documentation
SergioRZMasson Jan 13, 2025
3191ce7
Small documentation update
SergioRZMasson Jan 13, 2025
7469000
Removed area lights code from scene and materials
SergioRZMasson Jan 14, 2025
c474b93
Moved is loading area lights flag to scene
SergioRZMasson Jan 14, 2025
a8dc927
Added IAreaLightLTCProvider interface to allow users to provide their…
SergioRZMasson Jan 15, 2025
978bc65
Merge branch 'master' of https://github.com/SergioRZMasson/Babylon.js…
SergioRZMasson Jan 15, 2025
3b9b579
Cleanup uncessary changes
SergioRZMasson Jan 15, 2025
aca386a
Small code cleanup
SergioRZMasson Jan 15, 2025
4a876a2
Fixed WGSL shader
SergioRZMasson Jan 15, 2025
9973803
Fixed WGSL shader
SergioRZMasson Jan 15, 2025
a272ad8
Added initial WebGPU implementation for StandardMaterial
SergioRZMasson Jan 15, 2025
4a9865e
Fixed issue with diffuse color on WebGPU
SergioRZMasson Jan 16, 2025
c741a61
Finished area lights implementation for WebGPU
SergioRZMasson Jan 16, 2025
cbea906
Added visualization tests
SergioRZMasson Jan 16, 2025
a695c17
Removed area lights LTC from babylon CDN, moved it assets repo
SergioRZMasson Jan 16, 2025
fac1e8a
Fixed Area Lights validation tests
SergioRZMasson Jan 16, 2025
547af10
Fixed tab issues in shaders
SergioRZMasson Jan 16, 2025
8021848
Fixed tab issues in shaders
SergioRZMasson Jan 16, 2025
d201e6c
Separated AreaLights and RectAreaLights to improver future backwards …
SergioRZMasson Jan 16, 2025
179ac1d
Separated AreaLights and RectAreaLights to improver future backwards …
SergioRZMasson Jan 16, 2025
51e0e8b
Small documentation fix
SergioRZMasson Jan 16, 2025
86a5b1d
Update packages/dev/core/src/Lights/LTC/ltcTextureTool.ts
SergioRZMasson Jan 17, 2025
90b6ff9
Update packages/dev/core/src/Lights/LTC/ltcTextureTool.ts
SergioRZMasson Jan 17, 2025
2194de1
Update packages/dev/core/src/Lights/LTC/ltcTextureTool.ts
SergioRZMasson Jan 17, 2025
6bdbdaa
Update packages/dev/core/src/Lights/areaLight.ts
SergioRZMasson Jan 17, 2025
c05a12e
Added review suggestions
SergioRZMasson Jan 17, 2025
ddc0a6b
Tried increasing frame count to allow LTC texture to be loaded during…
SergioRZMasson Jan 17, 2025
23efd48
Changed _position to be public position
SergioRZMasson Jan 17, 2025
f6a3e19
Update packages/dev/inspector/src/components/actionTabs/tabs/property…
SergioRZMasson Jan 17, 2025
0aeed06
Update packages/dev/core/src/Lights/areaLight.ts
SergioRZMasson Jan 17, 2025
4e60f5b
Fixed local variable naming convention
SergioRZMasson Jan 17, 2025
bca4291
Merge branch 'sergio/area-light' of https://github.com/SergioRZMasson…
SergioRZMasson Jan 17, 2025
0a30821
Fixed property name
SergioRZMasson Jan 17, 2025
bb4f0cf
Added small code improvements to shaders, fixed width and height calc…
SergioRZMasson Jan 17, 2025
1ae8039
Added inspiration credits
SergioRZMasson Jan 17, 2025
bd91bcc
Replaced link with perma link
SergioRZMasson Jan 17, 2025
67da5e5
Update packages/dev/core/src/Lights/LTC/ltcTextureTool.ts
SergioRZMasson Jan 17, 2025
51a0067
Added way to wait for Area Lights to be ready. Removed renderCount fr…
SergioRZMasson Jan 17, 2025
9342a82
Merge branch 'sergio/area-light' of https://github.com/SergioRZMasson…
SergioRZMasson Jan 17, 2025
455cb3d
Changed logic so that area Light works with scene.whenReadyAsync
SergioRZMasson Jan 17, 2025
a1c4ae4
Added way for users to set URL used by DefaultAreaLightLTCProvider
SergioRZMasson Jan 20, 2025
aca6725
Fixed ES6 issue
SergioRZMasson Jan 20, 2025
d739f4c
Merge branch 'master' of https://github.com/SergioRZMasson/Babylon.js…
SergioRZMasson Jan 20, 2025
79ef634
Updated validation tests
SergioRZMasson Jan 20, 2025
d9b601b
Improved code separation on shaders
SergioRZMasson Jan 20, 2025
62b01cd
Merge branch 'master' of https://github.com/SergioRZMasson/Babylon.js…
SergioRZMasson Jan 20, 2025
0cdf4e6
Changed DefaultAreaLightLTCProvider to use GetAssetUrl to load CDN files
SergioRZMasson Jan 20, 2025
b4195c2
Added missing uniforms to uniformList
SergioRZMasson Jan 21, 2025
947a714
Changed implementation of LTC textures on scene
SergioRZMasson Jan 21, 2025
b7e7dc9
Merge branch 'sergio/area-light' of https://github.com/SergioRZMasson…
SergioRZMasson Jan 22, 2025
0c29947
Changed area Light implementation to use texture ready to flag materi…
SergioRZMasson Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions packages/dev/core/src/Lights/LTC/ltcTextureTool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type { BaseTexture } from "core/Materials/Textures/baseTexture";
import { Tools } from "core/Misc/tools";
import type { Tuple } from "core/types";

/**
* Linearly transformed cosine textures that are used in the Area Lights shaders.
*/
export type ILTCTextures = {
/**
* Linearly transformed cosine texture BRDF Approximation.
*/
LTC1: BaseTexture;

/**
* Linearly transformed cosine texture Fresnel Approximation.
*/
LTC2: BaseTexture;
};

/**
* Linearly transformed cosine texture Fresnel Approximation.
* @returns Promise with data for LTC1 and LTC2 textures for area lights.
*/
export async function decodeLTCTextureDataAsync(): Promise<Tuple<Uint16Array, 2>> {
const ltc1 = new Uint16Array(64 * 64 * 4);
const ltc2 = new Uint16Array(64 * 64 * 4);
const file = await Tools.LoadFileAsync(Tools.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin"));
const ltcEncoded = new Uint16Array(file);

const pixelCount = ltcEncoded.length / 8;

for (let pixelIndex = 0; pixelIndex < pixelCount; pixelIndex++) {
ltc1[pixelIndex * 4] = ltcEncoded[pixelIndex * 8];
ltc1[pixelIndex * 4 + 1] = ltcEncoded[pixelIndex * 8 + 1];
ltc1[pixelIndex * 4 + 2] = ltcEncoded[pixelIndex * 8 + 2];
ltc1[pixelIndex * 4 + 3] = ltcEncoded[pixelIndex * 8 + 3];

ltc2[pixelIndex * 4] = ltcEncoded[pixelIndex * 8 + 4];
ltc2[pixelIndex * 4 + 1] = ltcEncoded[pixelIndex * 8 + 5];
ltc2[pixelIndex * 4 + 2] = ltcEncoded[pixelIndex * 8 + 6];
ltc2[pixelIndex * 4 + 3] = ltcEncoded[pixelIndex * 8 + 7];
}

return [ltc1, ltc2];
}
114 changes: 114 additions & 0 deletions packages/dev/core/src/Lights/areaLight.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import type { Vector3 } from "core/Maths/math.vector";
import { RawTexture } from "core/Materials/Textures/rawTexture";
import { Texture } from "core/Materials/Textures/texture";
import { Constants } from "core/Engines/constants";
import { Light } from "core/Lights/light";
import type { Effect } from "core/Materials/effect";
import type { ILTCTextures } from "core/Lights/LTC/ltcTextureTool";
import { decodeLTCTextureDataAsync } from "core/Lights/LTC/ltcTextureTool";
import type { Scene } from "core/scene";
import { Logger } from "core/Misc/logger";

declare module "../scene" {
export interface Scene {
/**
* @internal
*/
_ltcTextures?: ILTCTextures;
}
}

function createSceneLTCTextures(scene: Scene): void {
const useDelayedTextureLoading = scene.useDelayedTextureLoading;
scene.useDelayedTextureLoading = false;

const previousState = scene._blockEntityCollection;
scene._blockEntityCollection = false;

scene._ltcTextures = {
LTC1: RawTexture.CreateRGBATexture(null, 64, 64, scene.getEngine(), false, false, Constants.TEXTURE_LINEAR_LINEAR, Constants.TEXTURETYPE_HALF_FLOAT),
LTC2: RawTexture.CreateRGBATexture(null, 64, 64, scene.getEngine(), false, false, Constants.TEXTURE_LINEAR_LINEAR, Constants.TEXTURETYPE_HALF_FLOAT),
};

scene._blockEntityCollection = previousState;

scene._ltcTextures.LTC1.wrapU = Texture.CLAMP_ADDRESSMODE;
scene._ltcTextures.LTC1.wrapV = Texture.CLAMP_ADDRESSMODE;

scene._ltcTextures.LTC2.wrapU = Texture.CLAMP_ADDRESSMODE;
scene._ltcTextures.LTC2.wrapV = Texture.CLAMP_ADDRESSMODE;

scene.useDelayedTextureLoading = useDelayedTextureLoading;

decodeLTCTextureDataAsync()
.then((textureData) => {
if (scene._ltcTextures) {
const ltc1 = scene._ltcTextures?.LTC1 as RawTexture;
ltc1.update(textureData[0]);

const ltc2 = scene._ltcTextures?.LTC2 as RawTexture;
ltc2.update(textureData[1]);

scene.onDisposeObservable.addOnce(() => {
scene._ltcTextures?.LTC1.dispose();
scene._ltcTextures?.LTC2.dispose();
});
}
})
.catch((error) => {
Logger.Error(`Area Light fail to get LTC textures data. Error: ${error}`);
});
}

/**
* Abstract Area Light class that servers as parent for all Area Lights implementations.
* The light is emitted from the area in the -Z direction.
*/
export abstract class AreaLight extends Light {
/**
* Area Light position.
*/
public position: Vector3;

/**
* Creates a area light object.
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
* @param name The friendly name of the light
* @param position The position of the area light.
* @param scene The scene the light belongs to
*/
constructor(name: string, position: Vector3, scene?: Scene) {
super(name, scene);
this.position = position;

if (!this._scene._ltcTextures) {
createSceneLTCTextures(this._scene);
}
}

public override transferTexturesToEffect(effect: Effect): Light {
if (this._scene._ltcTextures) {
effect.setTexture("areaLightsLTC1Sampler", this._scene._ltcTextures.LTC1);
effect.setTexture("areaLightsLTC2Sampler", this._scene._ltcTextures.LTC2);
}
return this;
}

/**
* Prepares the list of defines specific to the light type.
* @param defines the list of defines
* @param lightIndex defines the index of the light for the effect
*/
public prepareLightSpecificDefines(defines: any, lightIndex: number): void {
defines["AREALIGHT" + lightIndex] = true;
defines["AREALIGHTUSED"] = true;
}

public override _isReady(): boolean {
if (this._scene._ltcTextures) {
return this._scene._ltcTextures.LTC1.isReady() && this._scene._ltcTextures.LTC2.isReady();
}

return false;
}
}
2 changes: 2 additions & 0 deletions packages/dev/core/src/Lights/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export * from "./directionalLight";
export * from "./hemisphericLight";
export * from "./pointLight";
export * from "./spotLight";
export * from "./areaLight";
export * from "./rectAreaLight";
export * from "./IES/iesLoader";
12 changes: 12 additions & 0 deletions packages/dev/core/src/Lights/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export abstract class Light extends Node implements ISortableLight {
*/
public static readonly LIGHTTYPEID_HEMISPHERICLIGHT = LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT;

/**
* Light type const id of the area light.
*/
public static readonly LIGHTTYPEID_RECT_AREALIGHT = LightConstants.LIGHTTYPEID_RECT_AREALIGHT;

/**
* Diffuse gives the basic color to an object.
*/
Expand Down Expand Up @@ -923,4 +928,11 @@ export abstract class Light extends Node implements ISortableLight {
* @param lightIndex defines the index of the light for the effect
*/
public abstract prepareLightSpecificDefines(defines: any, lightIndex: number): void;

/**
* @internal
*/
public _isReady() {
return true;
}
}
5 changes: 5 additions & 0 deletions packages/dev/core/src/Lights/lightConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export class LightConstants {
*/
public static readonly LIGHTTYPEID_HEMISPHERICLIGHT = 3;

/**
* Light type const id of the area light.
*/
public static readonly LIGHTTYPEID_RECT_AREALIGHT = 4;

/**
* Sort function to order lights for rendering.
* @param a First Light object to compare to second.
Expand Down
142 changes: 142 additions & 0 deletions packages/dev/core/src/Lights/rectAreaLight.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import { Vector3 } from "../Maths/math.vector";
import { Node } from "../node";
import { Light } from "./light";
import type { Effect } from "core/Materials/effect";
import { RegisterClass } from "core/Misc/typeStore";
import { serialize } from "../Misc/decorators";
import type { Scene } from "core/scene";
import { AreaLight } from "./areaLight";

Node.AddNodeConstructor("Light_Type_4", (name, scene) => {
return () => new RectAreaLight(name, Vector3.Zero(), 1, 1, scene);
});

/**
* A rectangular area light defined by an unique point in world space, a width and a height.
* The light is emitted from the rectangular area in the -Z direction.
*/
export class RectAreaLight extends AreaLight {
private readonly _width: Vector3;
private readonly _height: Vector3;
protected readonly _pointTransformedPosition: Vector3;
protected readonly _pointTransformedWidth: Vector3;
protected readonly _pointTransformedHeight: Vector3;

/**
* Rect Area Light width.
*/
@serialize()
public get width(): number {
return this._width.x;
}
/**
* Rect Area Light width.
*/
public set width(value: number) {
this._width.x = value;
}

/**
* Rect Area Light height.
*/
@serialize()
public get height(): number {
return this._height.y;
}
/**
* Rect Area Light height.
*/
public set height(value: number) {
this._height.y = value;
}

/**
* Creates a rectangular area light object.
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
* @param name The friendly name of the light
* @param position The position of the area light.
* @param width The width of the area light.
* @param height The height of the area light.
* @param scene The scene the light belongs to
*/
constructor(name: string, position: Vector3, width: number, height: number, scene?: Scene) {
super(name, position, scene);
this._width = new Vector3(width, 0, 0);
this._height = new Vector3(0, height, 0);
this._pointTransformedPosition = Vector3.Zero();
this._pointTransformedWidth = Vector3.Zero();
this._pointTransformedHeight = Vector3.Zero();
}

/**
* Returns the string "RectAreaLight"
* @returns the class name
*/
public override getClassName(): string {
return "RectAreaLight";
}

/**
* Returns the integer 4.
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
*/
public override getTypeID(): number {
return Light.LIGHTTYPEID_RECT_AREALIGHT;
}

protected _buildUniformLayout(): void {
this._uniformBuffer.addUniform("vLightData", 4);
this._uniformBuffer.addUniform("vLightDiffuse", 4);
this._uniformBuffer.addUniform("vLightSpecular", 4);
this._uniformBuffer.addUniform("vLightWidth", 4);
this._uniformBuffer.addUniform("vLightHeight", 4);
this._uniformBuffer.addUniform("shadowsInfo", 3);
this._uniformBuffer.addUniform("depthValues", 2);
this._uniformBuffer.create();
}

protected _computeTransformedInformation(): boolean {
if (this.parent && this.parent.getWorldMatrix) {
Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this._pointTransformedPosition);
Vector3.TransformNormalToRef(this._width, this.parent.getWorldMatrix(), this._pointTransformedWidth);
Vector3.TransformNormalToRef(this._height, this.parent.getWorldMatrix(), this._pointTransformedHeight);
return true;
}

return false;
}

/**
* Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
* @param effect The effect to update
* @param lightIndex The index of the light in the effect to update
* @returns The point light
*/
public transferToEffect(effect: Effect, lightIndex: string): RectAreaLight {
if (this._computeTransformedInformation()) {
SergioRZMasson marked this conversation as resolved.
Show resolved Hide resolved
this._uniformBuffer.updateFloat4("vLightData", this._pointTransformedPosition.x, this._pointTransformedPosition.y, this._pointTransformedPosition.z, 0, lightIndex);
this._uniformBuffer.updateFloat4("vLightWidth", this._pointTransformedWidth.x / 2, this._pointTransformedWidth.y / 2, this._pointTransformedWidth.z / 2, 0, lightIndex);
this._uniformBuffer.updateFloat4(
"vLightHeight",
this._pointTransformedHeight.x / 2,
this._pointTransformedHeight.y / 2,
this._pointTransformedHeight.z / 2,
0,
lightIndex
);
} else {
this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0.0, lightIndex);
this._uniformBuffer.updateFloat4("vLightWidth", this._width.x / 2, this._width.y / 2, this._width.z / 2, 0.0, lightIndex);
this._uniformBuffer.updateFloat4("vLightHeight", this._height.x / 2, this._height.y / 2, this._height.z / 2, 0.0, lightIndex);
}
return this;
}

public transferToNodeMaterialEffect(effect: Effect, lightDataUniformName: string) {
// TO DO: Implement this to add support for NME.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next PR @SergioRZMasson ?

return this;
}
}

// Register Class Name
RegisterClass("BABYLON.RectAreaLight", RectAreaLight);
11 changes: 11 additions & 0 deletions packages/dev/core/src/Materials/PBR/pbrBaseMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,15 @@ export abstract class PBRBaseMaterial extends PushMaterial {
return false;
}

// Check if Area Lights have LTC texture.
if (defines["AREALIGHTUSED"]) {
for (let index = 0; index < scene.lights.length; index++) {
if (!scene.lights[index]._isReady()) {
return false;
}
}
}

defines._renderId = scene.getRenderId();
drawWrapper._wasPreviouslyReady = forceWasNotReadyPreviously ? false : true;
drawWrapper._wasPreviouslyUsingInstances = !!useInstances;
Expand Down Expand Up @@ -1497,6 +1506,8 @@ export abstract class PBRBaseMaterial extends PushMaterial {
"oitDepthSampler",
"oitFrontColorSampler",
"icdfSampler",
"areaLightsLTC1Sampler",
"areaLightsLTC2Sampler",
];

const uniformBuffers = ["Material", "Scene", "Mesh"];
Expand Down
4 changes: 4 additions & 0 deletions packages/dev/core/src/Materials/materialHelper.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ export function PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, define
defines["POINTLIGHT" + index] = false;
defines["DIRLIGHT" + index] = false;
defines["SPOTLIGHT" + index] = false;
defines["AREALIGHT" + index] = false;
defines["SHADOW" + index] = false;
defines["SHADOWCSM" + index] = false;
defines["SHADOWCSMDEBUG" + index] = false;
Expand Down Expand Up @@ -607,6 +608,7 @@ export function PrepareDefinesForLight(
defines["HEMILIGHT" + lightIndex] = false;
defines["POINTLIGHT" + lightIndex] = false;
defines["DIRLIGHT" + lightIndex] = false;
defines["AREALIGHT" + lightIndex] = false;
SergioRZMasson marked this conversation as resolved.
Show resolved Hide resolved

light.prepareLightSpecificDefines(defines, lightIndex);

Expand Down Expand Up @@ -1053,6 +1055,8 @@ export function PrepareUniformsAndSamplersForLight(
"vLightDiffuse" + lightIndex,
"vLightSpecular" + lightIndex,
"vLightDirection" + lightIndex,
"vLightWidth" + lightIndex,
"vLightHeight" + lightIndex,
"vLightFalloff" + lightIndex,
"vLightGround" + lightIndex,
"lightMatrix" + lightIndex,
Expand Down
Loading
Loading