fog
This commit is contained in:
@@ -20,11 +20,16 @@ fn main() {
|
||||
level_instantiation::map_plugin,
|
||||
interaction::plugin,
|
||||
RapierPhysicsPlugin::<NoUserData>::default(),
|
||||
RapierDebugRenderPlugin::default(),
|
||||
// RapierDebugRenderPlugin::default(),
|
||||
player::plugin,
|
||||
// debugging::plugin
|
||||
))
|
||||
.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)
|
||||
.run();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
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_rapier3d::prelude::*;
|
||||
@@ -127,6 +127,14 @@ pub fn init_player(
|
||||
fov: 90.0_f32.to_radians(),
|
||||
..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
|
||||
@@ -153,10 +161,10 @@ pub fn init_player(
|
||||
Flashlight,
|
||||
SpotLight {
|
||||
intensity: 0.0,
|
||||
color: Color::WHITE,
|
||||
range: 4.0,
|
||||
outer_angle: 30.0_f32.to_radians(), // wide cone for flashlight
|
||||
inner_angle: 10.0_f32.to_radians(), // narrower inner cone
|
||||
color: Color::srgba(0.9, 0.628, 0.392, 1.0),
|
||||
range: 5.0,
|
||||
outer_angle: 28.0_f32.to_radians(), // wide cone for flashlight
|
||||
inner_angle: 12.0_f32.to_radians(), // narrower inner cone
|
||||
shadows_enabled: false, // (set to true for realism)
|
||||
radius: 0.35, // low value for hard light
|
||||
..default()
|
||||
@@ -390,7 +398,7 @@ pub fn handle_flashlight(
|
||||
spotlight.intensity = if spotlight.intensity > 0.0 {
|
||||
0.0
|
||||
} else {
|
||||
300_000.0
|
||||
320_000.0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user