fog
This commit is contained in:
@@ -20,11 +20,16 @@ fn main() {
|
|||||||
level_instantiation::map_plugin,
|
level_instantiation::map_plugin,
|
||||||
interaction::plugin,
|
interaction::plugin,
|
||||||
RapierPhysicsPlugin::<NoUserData>::default(),
|
RapierPhysicsPlugin::<NoUserData>::default(),
|
||||||
RapierDebugRenderPlugin::default(),
|
// RapierDebugRenderPlugin::default(),
|
||||||
player::plugin,
|
player::plugin,
|
||||||
// debugging::plugin
|
// debugging::plugin
|
||||||
))
|
))
|
||||||
.init_state::<GameState>()
|
.init_state::<GameState>()
|
||||||
|
.insert_resource(AmbientLight {
|
||||||
|
color: Color::srgba(0.8, 0.8, 1.0, 1.0),
|
||||||
|
// brightness: 10.0,
|
||||||
|
brightness: 80
|
||||||
|
})
|
||||||
.add_systems(OnEnter(GameState::Playing), setup)
|
.add_systems(OnEnter(GameState::Playing), setup)
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
input::mouse::AccumulatedMouseMotion, prelude::*, render::view::RenderLayers, window::{PrimaryWindow, WindowResized}
|
input::mouse::AccumulatedMouseMotion, pbr::VolumetricFog, prelude::*, render::view::RenderLayers, window::{PrimaryWindow, WindowResized}
|
||||||
};
|
};
|
||||||
use bevy_kira_audio::{Audio, AudioControl};
|
use bevy_kira_audio::{Audio, AudioControl};
|
||||||
use bevy_rapier3d::prelude::*;
|
use bevy_rapier3d::prelude::*;
|
||||||
@@ -127,6 +127,14 @@ pub fn init_player(
|
|||||||
fov: 90.0_f32.to_radians(),
|
fov: 90.0_f32.to_radians(),
|
||||||
..default()
|
..default()
|
||||||
}),
|
}),
|
||||||
|
DistanceFog {
|
||||||
|
color: Color::srgba(0.12, 0.08, 0.08, 0.65),
|
||||||
|
falloff: FogFalloff::Linear {
|
||||||
|
start: 3.0,
|
||||||
|
end: 12.0,
|
||||||
|
},
|
||||||
|
..default()
|
||||||
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
// camera voor pitslampke
|
// camera voor pitslampke
|
||||||
@@ -153,10 +161,10 @@ pub fn init_player(
|
|||||||
Flashlight,
|
Flashlight,
|
||||||
SpotLight {
|
SpotLight {
|
||||||
intensity: 0.0,
|
intensity: 0.0,
|
||||||
color: Color::WHITE,
|
color: Color::srgba(0.9, 0.628, 0.392, 1.0),
|
||||||
range: 4.0,
|
range: 5.0,
|
||||||
outer_angle: 30.0_f32.to_radians(), // wide cone for flashlight
|
outer_angle: 28.0_f32.to_radians(), // wide cone for flashlight
|
||||||
inner_angle: 10.0_f32.to_radians(), // narrower inner cone
|
inner_angle: 12.0_f32.to_radians(), // narrower inner cone
|
||||||
shadows_enabled: false, // (set to true for realism)
|
shadows_enabled: false, // (set to true for realism)
|
||||||
radius: 0.35, // low value for hard light
|
radius: 0.35, // low value for hard light
|
||||||
..default()
|
..default()
|
||||||
@@ -390,7 +398,7 @@ pub fn handle_flashlight(
|
|||||||
spotlight.intensity = if spotlight.intensity > 0.0 {
|
spotlight.intensity = if spotlight.intensity > 0.0 {
|
||||||
0.0
|
0.0
|
||||||
} else {
|
} else {
|
||||||
300_000.0
|
320_000.0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user