34 lines
No EOL
813 B
Rust
34 lines
No EOL
813 B
Rust
use crate::scene::*;
|
|
use crate::offaxis::*;
|
|
use crate::screeninfo;
|
|
use crate::screeninfo::ScreenInfo;
|
|
|
|
use bevy::{prelude::*, window::PresentMode, render::camera::CameraProjectionPlugin};
|
|
|
|
pub fn cycle_msaa(input: Res<Input<KeyCode>>, mut msaa: ResMut<Msaa>) {
|
|
if input.just_pressed(KeyCode::M) {
|
|
if msaa.samples == 4 {
|
|
info!("Not using MSAA");
|
|
msaa.samples = 1;
|
|
} else {
|
|
info!("Using 4x MSAA");
|
|
msaa.samples = 4;
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn update_offaxis(mut query : Query<(
|
|
&mut OffAxisProjection,
|
|
&ScreenInfo
|
|
)>
|
|
) {
|
|
for (mut q,si) in query.iter_mut() {
|
|
|
|
// we fake access to far for updating the matrix
|
|
(*q).far *= 1.0;
|
|
|
|
println!("Update {:?}",q);
|
|
|
|
println!("Screeninfo {}",si.name);
|
|
}
|
|
} |