Skip to content

Commit 1a7b692

Browse files
committed
fixed pages bug with light radius
1 parent 34c28c0 commit 1a7b692

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/shaders/clustering.cs.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@group(0) @binding(2) var<storage, read_write> uClusters : array<ClusterSet>;
3636

3737
const MAX_LIGHTS_PER_CLUSTER : u32 = ${maxLights}u;
38-
const LIGHT_RADIUS : f32 = f32(${lightRadius});
38+
const LIGHT_RADIUS : f32 = f32(2.f);
3939

4040
// Logarithmic depth slicing: returns [near, far] z bounds for this slice.
4141
fn slice_edges_z(slice: u32) -> vec2<f32> {

src/shaders/common.wgsl

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

3131
// CHECKITOUT: this special attenuation function ensures lights don't affect geometry outside the maximum light radius
3232
fn rangeAttenuation(distance: f32) -> f32 {
33-
return clamp(1.f - pow(distance / ${lightRadius}, 4.f), 0.f, 1.f) / (distance * distance);
33+
return clamp(1.f - pow(distance / 2.f, 4.f), 0.f, 1.f) / (distance * distance);
3434
}
3535

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

0 commit comments

Comments
 (0)