这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
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
743 changes: 565 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_zeroverse"
description = "bevy zeroverse synthetic dataset generator"
version = "0.13.3"
version = "0.14.0"
edition = "2021"
authors = ["mosure <mitchell@mosure.me>"]
license = "MIT"
Expand Down Expand Up @@ -48,6 +48,7 @@ default = [

multi_threaded = [
"bevy/multi_threaded",
"rayon",
]

development = ["bevy/dynamic_linking"]
Expand All @@ -60,12 +61,14 @@ python = ["extension-module", "pyo3", "webgpu"]

viewer = [
"bevy_egui",
"bevy_gaussian_splatting",
"bevy-inspector-egui",
"bevy_panorbit_camera",
"bevy/bevy_ui",
]

web = [
"rayon",
"viewer",
"webgpu",
]
Expand All @@ -79,16 +82,18 @@ webgpu = [
[dependencies]
bevy_args = "1.8"
bevy_egui = { version = "0.34", optional = true }
bevy_gaussian_splatting = { version = "5.0", default-features = false, features = ["buffer_storage", "sh3", "io_flexbuffers", "io_ply", "planar", "sort_rayon"], optional = true }
bevy-inspector-egui = { version = "0.31", optional = true }
bevy_panorbit_camera = { version = "0.26", optional = true, features = ["bevy_egui"] }
bytemuck = { version = "1.23", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
futures-intrusive = "0.5"
glob = "0.3"
itertools = "0.14"
noise = { version = "0.9" }
pollster = "0.4"
pyo3 = { version = "0.23", features = ["macros"], optional = true }
rand = "0.8"
rand = { version = "0.8", features = ["small_rng"] }
rayon = { version = "1.10", optional = true }
serde = "1.0"
strum = "0.27"
Expand Down Expand Up @@ -133,8 +138,7 @@ features = [


[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
futures-intrusive = { version = "0.5.0" }
criterion = { version = "0.6", features = ["html_reports"] }
pollster = { version = "0.4" }

[profile.dev.package."*"]
Expand Down
1 change: 1 addition & 0 deletions ffi/python/bevy_zeroverse_dataloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class BevyZeroverseDataset(Dataset):
'normal': bevy_zeroverse_ffi.RenderMode.Normal,
'optical_flow': bevy_zeroverse_ffi.RenderMode.OpticalFlow,
'position': bevy_zeroverse_ffi.RenderMode.Position,
'sdf': bevy_zeroverse_ffi.RenderMode.Sdf,
'semantic': bevy_zeroverse_ffi.RenderMode.Semantic,
}

Expand Down
2 changes: 2 additions & 0 deletions ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ impl Default for SamplerState {
// RenderMode::Normal,
// RenderMode::OpticalFlow,
// RenderMode::Position,
// RenderMode::Sdf,
],
step: 0,
timesteps: vec![0.125],
Expand Down Expand Up @@ -406,6 +407,7 @@ fn sample_stream(
RenderMode::Normal => view.normal = image_data,
RenderMode::OpticalFlow => view.optical_flow = image_data,
RenderMode::Position => view.position = image_data,
RenderMode::Sdf => panic!("sdf rendering not supported"),
RenderMode::Semantic => panic!("semantic rendering not supported"),
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use bevy_args::{
Serialize,
ValueEnum,
};
use bevy_gaussian_splatting::GaussianCamera;
use rand::Rng;

#[cfg(feature = "python")]
Expand Down Expand Up @@ -814,6 +815,9 @@ fn insert_cameras(
..default()
},
Exposure::INDOOR,
GaussianCamera {
warmup: true,
},
Projection::Perspective(zeroverse_camera.perspective_sampler.sample()),
zeroverse_camera.override_transform.unwrap_or(zeroverse_camera.trajectory.sample(0.0)),
MotionVectorPrepass,
Expand Down Expand Up @@ -986,6 +990,9 @@ fn setup_editor_camera(
hdr: true,
..default()
},
GaussianCamera {
warmup: true,
},
Projection::Perspective(PerspectiveProjection {
far: 25.0,
..default()
Expand Down
10 changes: 10 additions & 0 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ pub mod depth;
pub mod normal;
pub mod optical_flow;
pub mod position;
pub mod sdf;
pub mod semantic;


// TODO: render mode should be a per-camera setting
#[derive(
Debug,
Default,
Expand All @@ -48,6 +50,7 @@ pub enum RenderMode {
Normal,
OpticalFlow,
Position,
Sdf,
Semantic,
}

Expand Down Expand Up @@ -94,6 +97,7 @@ impl Plugin for RenderPlugin {
app.add_plugins(normal::NormalPlugin);
app.add_plugins(optical_flow::OpticalFlowPlugin);
app.add_plugins(position::PositionPlugin);
app.add_plugins(sdf::SdfPlugin);
app.add_plugins(semantic::SemanticPlugin);

// TODO: add wireframe depth, pbr disable, normals
Expand All @@ -108,6 +112,7 @@ impl Plugin for RenderPlugin {
auto_disable_pbr_material::<normal::Normal>,
auto_disable_pbr_material::<optical_flow::OpticalFlow>,
auto_disable_pbr_material::<position::Position>,
auto_disable_pbr_material::<sdf::Sdf>,
auto_disable_pbr_material::<semantic::Semantic>,
enable_pbr_material,
)
Expand Down Expand Up @@ -206,6 +211,10 @@ fn apply_render_modes(
commands.entity(entity)
.insert(position::Position);
}
RenderMode::Sdf => {
commands.entity(entity)
.insert(sdf::Sdf);
}
RenderMode::Semantic => {
commands.entity(entity)
.insert(semantic::Semantic);
Expand All @@ -221,6 +230,7 @@ fn apply_render_modes(
.remove::<normal::Normal>()
.remove::<optical_flow::OpticalFlow>()
.remove::<position::Position>()
.remove::<sdf::Sdf>()
.remove::<semantic::Semantic>();

insert_render_mode_flag(&mut commands, entity);
Expand Down
Loading
Loading