diff --git a/examples/3d/lightmaps.rs b/examples/3d/lightmaps.rs index a033493fca0e1..7601acc86c8bd 100644 --- a/examples/3d/lightmaps.rs +++ b/examples/3d/lightmaps.rs @@ -8,7 +8,7 @@ fn main() { .add_plugins(DefaultPlugins) .insert_resource(AmbientLight { color: Color::WHITE, - brightness: 0.2, + brightness: 0.0, }) .add_systems(Startup, setup) .add_systems(Update, add_lightmaps_to_meshes) @@ -36,9 +36,15 @@ fn add_lightmaps_to_meshes( (With>, Without), >, ) { + let exposure = 250.0; for (entity, name, material) in meshes.iter() { + if &**name == "Light" { + materials.get_mut(material).unwrap().emissive = Color::WHITE * exposure; + continue; + } + if &**name == "large_box" { - materials.get_mut(material).unwrap().lightmap_exposure = 120.0; + materials.get_mut(material).unwrap().lightmap_exposure = exposure; commands.entity(entity).insert(Lightmap { image: asset_server.load("lightmaps/CornellBox-Large.zstd.ktx2"), ..default() @@ -47,7 +53,7 @@ fn add_lightmaps_to_meshes( } if &**name == "small_box" { - materials.get_mut(material).unwrap().lightmap_exposure = 120.0; + materials.get_mut(material).unwrap().lightmap_exposure = exposure; commands.entity(entity).insert(Lightmap { image: asset_server.load("lightmaps/CornellBox-Small.zstd.ktx2"), ..default() @@ -56,7 +62,7 @@ fn add_lightmaps_to_meshes( } if name.starts_with("cornell_box") { - materials.get_mut(material).unwrap().lightmap_exposure = 120.0; + materials.get_mut(material).unwrap().lightmap_exposure = exposure; commands.entity(entity).insert(Lightmap { image: asset_server.load("lightmaps/CornellBox-Box.zstd.ktx2"), ..default()