Compare commits
5 commits
ab5835325f
...
61ad406a28
Author | SHA1 | Date | |
---|---|---|---|
yuni | 61ad406a28 | ||
yuni | fd2088127b | ||
yuni | 87aa3f1024 | ||
yuni | c87a68b778 | ||
yuni | cb9fe1d500 |
|
@ -5,6 +5,7 @@
|
||||||
- Implement factory reset
|
- Implement factory reset
|
||||||
- Chats don't automatically advance now, the player has to press "Continue"
|
- Chats don't automatically advance now, the player has to press "Continue"
|
||||||
- Add sparkles to Jupiter's ring ✨😍✨ best visible from Farview Station
|
- Add sparkles to Jupiter's ring ✨😍✨ best visible from Farview Station
|
||||||
|
- Add auroras to Jupiter and Saturn
|
||||||
- Add setting to change pointer
|
- Add setting to change pointer
|
||||||
- Add meow
|
- Add meow
|
||||||
- Add more conversations
|
- Add more conversations
|
||||||
|
|
28
assets/shaders/aurora.wgsl
Normal file
28
assets/shaders/aurora.wgsl
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#import bevy_pbr::{
|
||||||
|
mesh_view_bindings::globals,
|
||||||
|
forward_io::VertexOutput,
|
||||||
|
}
|
||||||
|
|
||||||
|
const latitude_cutoff = 50.0;
|
||||||
|
const tau = 6.283185307179586;
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||||
|
let color = vec3<f32>(2.0, 11.0, 20.0);
|
||||||
|
var alpha = 0.0;
|
||||||
|
|
||||||
|
let lat = 180.0 * abs(in.uv[1] - 0.5);
|
||||||
|
let phase = in.uv[0] * 2.0 * 3.14159;
|
||||||
|
if (lat > latitude_cutoff) {
|
||||||
|
let y = (lat - latitude_cutoff) / (90.0 - latitude_cutoff);
|
||||||
|
//alpha = sin(phase * 5.0) + sin(5.0 * y);
|
||||||
|
alpha = 0.1 * clamp(-4.0 * cos(tau * sqrt(y + 0.007 * sin(phase * 20.0) + 0.1 * sin(phase))) - 3.0, 0.0, 1.0);
|
||||||
|
alpha += 0.05 * clamp(-1000.0 * cos(tau * y + 1.2 * sin(phase + 0.5)) - 970.0, 0.0, 1.0);
|
||||||
|
alpha += 0.22 * (1.0 + sin(0.0 + phase * 0.9)) * clamp(-1000.0 * cos(tau * sqrt(0.000 + y + 0.05 * sin(phase * 3.0) * sin(phase * 1.0) + 0.1 * sin(phase + 0.3))) - 999.6, 0.0, 1.0);
|
||||||
|
alpha += 0.09 * (1.0 + sin(0.3 + phase * 0.9)) * clamp(-1000.0 * cos(tau * sqrt(-0.17 + y + 0.02 * sin(phase * 2.0) * sin(phase * 5.0) + 0.2 * sin(phase + 0.3))) - 999.0, 0.0, 1.0);
|
||||||
|
alpha += 0.66 * (1.0 + sin(0.3 + phase * 0.9)) * clamp(-1000.0 * cos(tau * sqrt(-0.23 + y + 0.01 * sin(phase * 3.0) * sin(phase * 6.0) + 0.2 * sin(phase + 0.4))) - 999.0, 0.0, 1.0);
|
||||||
|
alpha *= 0.02;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vec4<f32>(color, clamp(alpha, 0.0, 1.0));
|
||||||
|
}
|
26
src/cmd.rs
26
src/cmd.rs
|
@ -106,6 +106,7 @@ struct ParserState {
|
||||||
orbit_phase: Option<f64>,
|
orbit_phase: Option<f64>,
|
||||||
has_physics: bool,
|
has_physics: bool,
|
||||||
has_ring: bool,
|
has_ring: bool,
|
||||||
|
has_aurora: bool,
|
||||||
wants_maxrotation: Option<f64>,
|
wants_maxrotation: Option<f64>,
|
||||||
wants_maxvelocity: Option<f64>,
|
wants_maxvelocity: Option<f64>,
|
||||||
wants_tolookat_id: Option<String>,
|
wants_tolookat_id: Option<String>,
|
||||||
|
@ -169,6 +170,7 @@ impl Default for ParserState {
|
||||||
orbit_phase: None,
|
orbit_phase: None,
|
||||||
has_physics: true,
|
has_physics: true,
|
||||||
has_ring: false,
|
has_ring: false,
|
||||||
|
has_aurora: false,
|
||||||
wants_maxrotation: None,
|
wants_maxrotation: None,
|
||||||
wants_maxvelocity: None,
|
wants_maxvelocity: None,
|
||||||
wants_tolookat_id: None,
|
wants_tolookat_id: None,
|
||||||
|
@ -473,6 +475,9 @@ pub fn load_defs(mut ew_spawn: EventWriter<SpawnEvent>) {
|
||||||
["ring", "yes"] => {
|
["ring", "yes"] => {
|
||||||
state.has_ring = true;
|
state.has_ring = true;
|
||||||
}
|
}
|
||||||
|
["aurora", "yes"] => {
|
||||||
|
state.has_aurora = true;
|
||||||
|
}
|
||||||
["tidally", "locked"] => {
|
["tidally", "locked"] => {
|
||||||
state.is_tidally_locked = true;
|
state.is_tidally_locked = true;
|
||||||
}
|
}
|
||||||
|
@ -907,6 +912,7 @@ fn spawn_entities(
|
||||||
mut meshes: ResMut<Assets<Mesh>>,
|
mut meshes: ResMut<Assets<Mesh>>,
|
||||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||||
mut materials_jupiter: ResMut<Assets<load::JupitersRing>>,
|
mut materials_jupiter: ResMut<Assets<load::JupitersRing>>,
|
||||||
|
mut materials_aurora: ResMut<Assets<load::JupitersAurora>>,
|
||||||
mut id2pos: ResMut<game::Id2Pos>,
|
mut id2pos: ResMut<game::Id2Pos>,
|
||||||
mut achievement_tracker: ResMut<var::AchievementTracker>,
|
mut achievement_tracker: ResMut<var::AchievementTracker>,
|
||||||
mut ew_updateavatar: EventWriter<hud::UpdateAvatarEvent>,
|
mut ew_updateavatar: EventWriter<hud::UpdateAvatarEvent>,
|
||||||
|
@ -1301,6 +1307,26 @@ fn spawn_entities(
|
||||||
NotShadowReceiver,
|
NotShadowReceiver,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if state.has_aurora {
|
||||||
|
let radius = state.model_scale * 1.01;
|
||||||
|
commands.spawn((
|
||||||
|
world::DespawnOnPlayerDeath,
|
||||||
|
MaterialMeshBundle {
|
||||||
|
mesh: meshes.add(Sphere::new(radius).mesh().uv(128, 128)),
|
||||||
|
material: materials_aurora.add(load::JupitersAurora {
|
||||||
|
alpha_mode: AlphaMode::Blend,
|
||||||
|
}),
|
||||||
|
transform: Transform::from_translation(absolute_pos.as_vec3()),
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
Position::new(absolute_pos),
|
||||||
|
//Rotation::default(),
|
||||||
|
Rotation::from(rotation),
|
||||||
|
NotShadowCaster,
|
||||||
|
NotShadowReceiver,
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ actor 0 0 0
|
||||||
planet yes
|
planet yes
|
||||||
sphere yes
|
sphere yes
|
||||||
ring yes
|
ring yes
|
||||||
|
aurora yes
|
||||||
physics off
|
physics off
|
||||||
rotationy 3.13
|
rotationy 3.13
|
||||||
rotationz 135
|
rotationz 135
|
||||||
|
@ -260,6 +261,7 @@ actor 0 0 0
|
||||||
planet yes
|
planet yes
|
||||||
sphere yes
|
sphere yes
|
||||||
ring yes
|
ring yes
|
||||||
|
aurora yes
|
||||||
physics off
|
physics off
|
||||||
scale 58232e3
|
scale 58232e3
|
||||||
axialtilt 26.73
|
axialtilt 26.73
|
||||||
|
|
|
@ -53,7 +53,6 @@ pub const PLAYER_AR_AVATARS: &[(Avatar, &str, f32, &str)] = &[
|
||||||
(Avatar::Dress, "suit_ar_dress", 1.0, "Dress"),
|
(Avatar::Dress, "suit_ar_dress", 1.0, "Dress"),
|
||||||
(Avatar::Nekomimi, "suit_ar_nekomimi", 1.0, "Cat Ears"),
|
(Avatar::Nekomimi, "suit_ar_nekomimi", 1.0, "Cat Ears"),
|
||||||
(Avatar::Wings, "suit_ar_wings", 1.0, "Wings"),
|
(Avatar::Wings, "suit_ar_wings", 1.0, "Wings"),
|
||||||
(Avatar::Bra, "suit_ar_bra", 1.0, "Bra"),
|
|
||||||
(Avatar::Armor, "suit_ar_armor", 1.0, "Armor"),
|
(Avatar::Armor, "suit_ar_armor", 1.0, "Armor"),
|
||||||
(Avatar::Asteroid, "metis", 1.3, "Asteroid"),
|
(Avatar::Asteroid, "metis", 1.3, "Asteroid"),
|
||||||
];
|
];
|
||||||
|
|
16
src/load.rs
16
src/load.rs
|
@ -19,6 +19,7 @@ pub struct LoadPlugin;
|
||||||
impl Plugin for LoadPlugin {
|
impl Plugin for LoadPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_plugins(MaterialPlugin::<JupitersRing>::default());
|
app.add_plugins(MaterialPlugin::<JupitersRing>::default());
|
||||||
|
app.add_plugins(MaterialPlugin::<JupitersAurora>::default());
|
||||||
app.add_plugins(MaterialPlugin::<SkyBox>::default());
|
app.add_plugins(MaterialPlugin::<SkyBox>::default());
|
||||||
app.add_plugins(MaterialPlugin::<
|
app.add_plugins(MaterialPlugin::<
|
||||||
ExtendedMaterial<StandardMaterial, AsteroidSurface>,
|
ExtendedMaterial<StandardMaterial, AsteroidSurface>,
|
||||||
|
@ -103,6 +104,21 @@ impl Material for JupitersRing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Jupiter's Aurora
|
||||||
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
|
pub struct JupitersAurora {
|
||||||
|
pub alpha_mode: AlphaMode,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Material for JupitersAurora {
|
||||||
|
fn fragment_shader() -> ShaderRef {
|
||||||
|
"shaders/aurora.wgsl".into()
|
||||||
|
}
|
||||||
|
fn alpha_mode(&self) -> AlphaMode {
|
||||||
|
self.alpha_mode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sky Box
|
// Sky Box
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct SkyBox {}
|
pub struct SkyBox {}
|
||||||
|
|
Loading…
Reference in a new issue