Skip to content

Commit c403df1

Browse files
committed
removed 'attenuation' from lights
1 parent 3c2eee7 commit c403df1

4 files changed

Lines changed: 0 additions & 10 deletions

File tree

-1.62 KB
Binary file not shown.
Binary file not shown.

crates/renderling/src/pbr.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,6 @@ pub fn shade_fragment(
586586
LightStyle::Point => {
587587
let PointLight {
588588
position,
589-
// TODO: remove unused `attenuation` from lights
590-
attenuation,
591589
color,
592590
intensity,
593591
} = slab.read(light.into_point_id());
@@ -606,8 +604,6 @@ pub fn shade_fragment(
606604
let SpotLight {
607605
position,
608606
direction,
609-
// TODO: remove unused `attenuation` from lights
610-
attenuation,
611607
inner_cutoff,
612608
outer_cutoff,
613609
color,

crates/renderling/src/pbr/light.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::Transform;
1010
pub struct SpotLight {
1111
pub position: Vec3,
1212
pub direction: Vec3,
13-
pub attenuation: Vec3,
1413
pub inner_cutoff: f32,
1514
pub outer_cutoff: f32,
1615
pub color: Vec4,
@@ -22,15 +21,13 @@ impl Default for SpotLight {
2221
let white = Vec4::splat(1.0);
2322
let inner_cutoff = core::f32::consts::PI / 3.0;
2423
let outer_cutoff = core::f32::consts::PI / 2.0;
25-
let attenuation = Vec3::new(1.0, 0.014, 0.007);
2624
let direction = Vec3::new(0.0, -1.0, 0.0);
2725
let color = white;
2826
let intensity = 1.0;
2927

3028
Self {
3129
position: Default::default(),
3230
direction,
33-
attenuation,
3431
inner_cutoff,
3532
outer_cutoff,
3633
color,
@@ -67,20 +64,17 @@ impl Default for DirectionalLight {
6764
#[derive(Copy, Clone, SlabItem)]
6865
pub struct PointLight {
6966
pub position: Vec3,
70-
pub attenuation: Vec3,
7167
pub color: Vec4,
7268
pub intensity: f32,
7369
}
7470

7571
impl Default for PointLight {
7672
fn default() -> Self {
77-
let attenuation = Vec3::new(1.0, 0.14, 0.07);
7873
let color = Vec4::splat(1.0);
7974
let intensity = 1.0;
8075

8176
Self {
8277
position: Default::default(),
83-
attenuation,
8478
color,
8579
intensity,
8680
}

0 commit comments

Comments
 (0)