Skip to content

Commit 0e351b0

Browse files
committed
c
1 parent 935ed69 commit 0e351b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/shaders/common.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct CameraUniforms {
3535

3636
// CHECKITOUT: this special attenuation function ensures lights don't affect geometry outside the maximum light radius
3737
fn rangeAttenuation(distance: f32) -> f32 {
38-
return clamp(1.f - pow(distance / 2, 4.f), 0.f, 1.f) / (distance * distance);
38+
return clamp(1.f - pow(distance / 2.f, 4.f), 0.f, 1.f) / (distance * distance);
3939
}
4040

4141
fn calculateLightContrib(light: Light, posWorld: vec3f, nor: vec3f) -> vec3f {

src/shaders/shaders.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ export const constants = {
3636
numSlices: 32,
3737
sliceLength: 1,
3838
tileSize: 256,
39-
maxLightsPerCluster: 512,
39+
maxLightsPerCluster: 1024,
4040

4141
performanceTesting: false,
4242

4343
near: 0.1,
4444
far: 5000,
4545

46-
lightRadius: 1
46+
lightRadius: 2
4747
};
4848

4949
// =================================

src/stage/lights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function hueToRgb(h: number) {
1313
export class Lights {
1414
private camera: Camera;
1515

16-
numLights = 10000;
16+
numLights = 1024;
1717
static readonly maxNumLights = 10000;
1818
static readonly numFloatsPerLight = 8; // vec3f is aligned at 16 byte boundaries
1919

0 commit comments

Comments
 (0)