From 7080c8d34ca2f4076be8c1a8ce1ec20d23472ba2 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 21 Mar 2024 03:20:44 +0100 Subject: [PATCH] implemented maximum star magnitude, looks actually better w/ less stars --- src/world.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/world.rs b/src/world.rs index 2769775..eefb3c4 100644 --- a/src/world.rs +++ b/src/world.rs @@ -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 {