Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: headless renderer doesn't support bevy/multi-threaded #81

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ Cargo.lock

.DS_Store

www/assets/
screenshots/
headless_output/
www/assets/
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ tooling = ["byte-unit"]

perftest = []

headless = [
"io_flexbuffers",
"io_ply",
"planar",
"buffer_storage",
"f16",
"sort_rayon",
"sort_std",
]

viewer = [
"bevy-inspector-egui",
"bevy_panorbit_camera",
Expand Down
18 changes: 4 additions & 14 deletions examples/headless.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// for running the gaussian splatting viewer without a window ( i.e on a server )
//! ensure the "test_images" directory exists in the root of the project
// c_rr --example headless -- [filename]
//! ensure the "headless_output" directory exists in the root of the project
// c_rr --example headless --no-default-features --features "headless" -- [filename]

use bevy::{
app::ScheduleRunnerPlugin, core::Name, core_pipeline::tonemapping::Tonemapping, prelude::*, render::renderer::RenderDevice,
};
use bevy_panorbit_camera::{PanOrbitCamera, PanOrbitCameraPlugin};

use bevy_gaussian_splatting::{
random_gaussians, utils::get_arg, GaussianCloud, GaussianSplattingBundle,
Expand Down Expand Up @@ -333,7 +332,7 @@ mod frame_capture {
};

let images_dir =
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test_images");
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("headless_output");
std::fs::create_dir_all(&images_dir).unwrap();

let uuid = bevy::utils::Uuid::new_v4();
Expand Down Expand Up @@ -405,13 +404,6 @@ fn setup_gaussian_cloud(
},
..default()
},
PanOrbitCamera {
allow_upside_down: true,
orbit_smoothness: 0.0,
pan_smoothness: 0.0,
zoom_smoothness: 0.0,
..default()
},
));
}

Expand Down Expand Up @@ -445,16 +437,14 @@ fn headless_app() {
);

app.add_plugins(frame_capture::image_copy::ImageCopyPlugin);

// headless frame capture
app.add_plugins(frame_capture::scene::CaptureFramePlugin);

app.add_plugins(ScheduleRunnerPlugin::run_loop(
std::time::Duration::from_secs_f64(1.0 / 60.0),
));

app.add_plugins(PanOrbitCameraPlugin);

// setup for gaussian splatting
app.add_plugins(GaussianSplattingPlugin);

Expand Down
Loading