implemented maximum star magnitude, looks actually better w/ less stars
This commit is contained in:
parent
beefe695f6
commit
7080c8d34c
|
@ -10,6 +10,7 @@ use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
|
|||
use std::f32::consts::PI;
|
||||
|
||||
const ASTEROID_SIZE: f32 = 100.0;
|
||||
const STARS_MAX_MAGNITUDE: f32 = 3.5;
|
||||
|
||||
//const SKYBOX_BRIGHTNESS: f32 = 300.0;
|
||||
//const SKYBOX_BRIGHTNESS_AR: f32 = 100.0;
|
||||
|
@ -145,8 +146,12 @@ pub fn setup(
|
|||
|
||||
// Generate starmap
|
||||
let sphere_handle = meshes.add(Sphere::new(1.0));
|
||||
let mut starcount = 0;
|
||||
for star in nature::STARS {
|
||||
let mag = star[3];
|
||||
if mag > STARS_MAX_MAGNITUDE {
|
||||
continue;
|
||||
}
|
||||
let scale_color = {|color: f32|
|
||||
if mag < -20.0 {
|
||||
color * 13.0f32 // Sun
|
||||
|
@ -182,7 +187,9 @@ pub fn setup(
|
|||
..default()
|
||||
}
|
||||
));
|
||||
starcount += 1;
|
||||
}
|
||||
info!("Generated {starcount} stars");
|
||||
|
||||
// Add Light from the Sun
|
||||
commands.spawn(DirectionalLightBundle {
|
||||
|
|
Loading…
Reference in a new issue