From 591db70d084f866a3a64634e494ec485c02c2431 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 2 Apr 2024 07:05:17 +0200 Subject: [PATCH] base asteroid density on actual ring density --- assets/shaders/jupiters_rings.wgsl | 16 +++++----- src/defs.txt | 2 +- src/hud.rs | 28 +++++++++++++++--- src/nature.rs | 47 ++++++++++++++++++++++++++++++ src/world.rs | 39 +++++++++++++++++++------ 5 files changed, 110 insertions(+), 22 deletions(-) diff --git a/assets/shaders/jupiters_rings.wgsl b/assets/shaders/jupiters_rings.wgsl index 90c4db2..dc8ed48 100644 --- a/assets/shaders/jupiters_rings.wgsl +++ b/assets/shaders/jupiters_rings.wgsl @@ -7,7 +7,7 @@ @group(2) @binding(1) var jupiter_radius: f32; const jupiter_radius_Mm: f32 = 71.492; -const brightness = 0.05; +const brightness = 0.025; fn smooth_edge(start: f32, end: f32, value: f32) -> f32 { var x: f32 = (value - start) / (end - start); @@ -15,6 +15,9 @@ fn smooth_edge(start: f32, end: f32, value: f32) -> f32 { } fn ring_density(radius: f32) -> f32 { + // NOTE: Keep this in sync with src/nature.rs::ring_density + // Input: distance to center of jupiter in million meters + // Output: relative brightness of the ring let halo_inner: f32 = 92.0; let halo_outer: f32 = 122.5; let main_inner: f32 = 122.5; @@ -26,13 +29,10 @@ fn ring_density(radius: f32) -> f32 { let metis_notch_center: f32 = 128.0; let metis_notch_width: f32 = 0.6; - let halo_brightness: f32 = 0.3; - let main_brightness: f32 = 0.4; - let almathea_brightness: f32 = 0.2; - let thebe_brightness: f32 = 0.2; - - let inner_smooth_factor: f32 = 2.0; // Smooth inner edges - let outer_smooth_factor: f32 = 1.5; // Rougher outer edges + let halo_brightness: f32 = 0.75; + let main_brightness: f32 = 1.0; + let almathea_brightness: f32 = 0.5; + let thebe_brightness: f32 = 0.5; var density: f32 = 0.0; diff --git a/src/defs.txt b/src/defs.txt index 857d81d..27edfe2 100644 --- a/src/defs.txt +++ b/src/defs.txt @@ -7,7 +7,7 @@ actor 0 0 0 jupiter rotationz -0.28 angularmomentum 30 30 30 -actor 0 0 0 suit +actor 0 593051 0 suit relativeto jupiter orbit 220000e3 0.66 player yes diff --git a/src/hud.rs b/src/hud.rs index dbd5c17..9725855 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -218,6 +218,24 @@ fn setup( ..default() } ), + TextSection::new( + "\n位置 ", + TextStyle { + font: asset_server.load(FONT), + font_size: settings.font_size_hud, + color: Color::GRAY, + ..default() + }, + ), + TextSection::new( + "", + TextStyle { + font: asset_server.load(FONT), + font_size: settings.font_size_hud, + color: Color::GRAY, + ..default() + } + ), TextSection::new( "\nSuit Integrity ", TextStyle { @@ -368,7 +386,7 @@ fn update( time: Res