config: add use_passthrough

This commit is contained in:
galister
2024-12-07 15:24:22 +09:00
parent a71f4de0ff
commit 65432ebde4
2 changed files with 9 additions and 2 deletions

View File

@@ -147,7 +147,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
stage_offset: Affine3A::IDENTITY,
};
let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|| !app_state.session.config.use_passthrough
{
create_skybox(&xr_state, &app_state)
} else {
None
@@ -222,7 +224,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
if main_session_visible {
log::debug!("Destroying skybox.");
skybox = None;
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|| !app_state.session.config.use_passthrough
{
log::debug!("Allocating skybox.");
skybox = create_skybox(&xr_state, &app_state);
}

View File

@@ -287,6 +287,9 @@ pub struct GeneralConfig {
#[serde(default = "def_true")]
pub use_skybox: bool,
#[serde(default = "def_true")]
pub use_passthrough: bool,
#[serde(default = "def_max_height")]
pub screen_max_height: u16,