Skip to content

Commit 95c4e56

Browse files
mvaligurskyMartin Valigursky
andauthored
[Fix] Enforce lighting chunks used by clustered lighting are included (playcanvas#3156)
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent 3a62389 commit 95c4e56

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/graphics/program-lib/programs/standard.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,10 @@ var standard = {
463463
lighting = true;
464464
}
465465

466+
if (LayerComposition.clusteredLightingEnabled) {
467+
lighting = true;
468+
}
469+
466470
if (options.shadingModel === SPECULAR_PHONG) {
467471
options.fresnelModel = 0;
468472
options.specularAntialias = false;
@@ -1406,9 +1410,11 @@ var standard = {
14061410
if (LayerComposition.clusteredLightingEnabled) {
14071411

14081412
usesSpot = true;
1413+
hasPointLights = true;
1414+
usesLinearFalloff = true;
14091415

14101416
const clusterTextureFormat = WorldClusters.lightTextureFormat === WorldClusters.FORMAT_FLOAT ? "FLOAT" : "8BIT";
1411-
code += `#define CLUSTER_TEXTURE_${clusterTextureFormat}\n`;
1417+
code += `\n#define CLUSTER_TEXTURE_${clusterTextureFormat}\n`;
14121418
code += chunks.clusteredLightPS;
14131419
}
14141420

0 commit comments

Comments
 (0)