Cannot get sunlight to work

(Jem Bishop) #1

Hi when I try to insert a sunlight into the world it does not appear to work.
here is my code:

  fn initialize_light(world: &mut World) {
    let light = Light::from(SunLight {
        color: Rgb::new(1.0, 1.0, 1.0),
        ..SunLight::default()
    });

    world.create_entity().with(light).build();
}

which gives:

The pointlight however works fine:

fn initialize_light(world: &mut World) {

let light: Light = PointLight {

    intensity: 10.0,

    color: Rgb::new(1.0, 1.0, 1.0),

    ..PointLight::default()

}

.into();

let mut transform = Transform::default();

transform.set_translation_xyz(5.0, 5.0, 20.0);

world.create_entity().with(light).with(transform).build();

}

#2

Sunlight is not implemented in the current renderer, I think it’s a leftover from the old renderer port. We should probably remove that enum value unless someone implements sunlight in shaders.

2 Likes