Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 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: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ target
/bevy-strolle/assets/demo
/bevy-strolle/examples/bench-*
/bevy-strolle/examples/scene*
/Cargo.lock
Comment thread
Patryk27 marked this conversation as resolved.
Outdated
Cargo.lock
*.lock
35 changes: 33 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,36 @@ members = [
]

[patch."crates-io"]
# TODO https://github.com/gfx-rs/naga/issues/2373
naga = { git = "https://github.com/Patryk27/naga", branch = "v0.13.0-strolle" }
bevy = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_render = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_ptr = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_utils = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_tasks = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_reflect = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_mikktspace = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_ecs = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_math = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_app = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_color = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_core = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_asset = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_a11y = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_time = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_hierarchy = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_window = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_diagnostic = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_gilrs = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_transform = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_state = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_winit = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_audio = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_core_pipeline = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_animation = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_scene = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_sprite = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_pbr = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_gizmos = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_text = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_gltf = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_ui = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
bevy_internal = { git = "https://github.com/glasspangolin/bevy", branch = "v0.14.2-strolle" }
22 changes: 13 additions & 9 deletions bevy-strolle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ version = "0.1.0"
edition = "2021"

[dependencies]
bevy = "0.12.1" # TODO use default-features = false
bevy_egui = "0.24"
bevy = { version = "0.14.2", default-features = false, features = ["default"] }
bevy_egui = { version = "0.29.0" }
Comment thread
Patryk27 marked this conversation as resolved.
Outdated
spirv-std = { git = "https://github.com/glasspangolin/rust-gpu.git" }
log = "0.4.18"
strolle = { path = "../strolle", features = ["metrics"] }
wgpu = "0.17.2"
wgpu = "0.20.1"

[dev-dependencies]
bevy = { version = "0.12.1", features = ["jpeg"] }
bevy_mod_raycast = "0.16.0"
bevy_rapier3d = "0.23.0"
lazy_static = "1.4.0"
smooth-bevy-cameras = "0.10.0"
zip = { version = "0.6.6", default-features = false, features = ["deflate"] }
bevy = { version = "0.14.2", default-features = false, features = ["default", "jpeg"] }
bevy_mod_raycast = { version = "0.18.0" }
smooth-bevy-cameras = { version = "0.12.0"}
lazy_static = "1.5.0"
zip = { version = "2.2.0", default-features = false, features = ["deflate"] }

[patch.crates-io]
Comment thread
Patryk27 marked this conversation as resolved.
Outdated
bevy = { version = "0.14.2" }
bevy_render = {version = "0.14.2"}
49 changes: 25 additions & 24 deletions bevy-strolle/examples/_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ use std::env;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;

use bevy::core_pipeline::core_3d::graph::Core3d;
use bevy::prelude::*;
use bevy::render::camera::CameraRenderGraph;
use bevy::window::{CursorGrabMode, PrimaryWindow};
use bevy_strolle::prelude::*;
use smooth_bevy_cameras::controllers::fps::FpsCameraController;
use zip::ZipArchive;
use bevy_strolle::graph::StrolleGraph;

pub fn extract_assets() {
extract_asset("cornell");
Expand Down Expand Up @@ -48,7 +49,7 @@ fn extract_asset(name: &str) {
// -----------------------------------------------------------------------------

pub fn handle_camera(
keys: Res<Input<KeyCode>>,
keys: Res<ButtonInput<KeyCode>>,
mut window: Query<&mut Window, With<PrimaryWindow>>,
mut camera: Query<(
&Transform,
Expand All @@ -64,8 +65,8 @@ pub fn handle_camera(
mut fps_camera_controller,
) = camera.single_mut();

if keys.just_pressed(KeyCode::Key1) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit1) {
camera_render_graph.set(StrolleGraph);

camera.mode = match camera.mode {
st::CameraMode::Image { denoise } => {
Expand All @@ -75,8 +76,8 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::Key2) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit2) {
camera_render_graph.set(StrolleGraph);

camera.mode = match camera.mode {
st::CameraMode::DiDiffuse { denoise } => {
Expand All @@ -86,8 +87,8 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::Key3) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit3) {
camera_render_graph.set(StrolleGraph);

camera.mode = match camera.mode {
st::CameraMode::DiSpecular { denoise } => {
Expand All @@ -97,8 +98,8 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::Key4) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit4) {
camera_render_graph.set(StrolleGraph);

camera.mode = match camera.mode {
st::CameraMode::GiDiffuse { denoise } => {
Expand All @@ -108,8 +109,8 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::Key5) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit5) {
camera_render_graph.set(StrolleGraph);

camera.mode = match camera.mode {
st::CameraMode::GiSpecular { denoise } => {
Expand All @@ -119,20 +120,20 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::Key8) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit8) {
camera_render_graph.set(StrolleGraph);

camera.mode = st::CameraMode::BvhHeatmap;
}

if keys.just_pressed(KeyCode::Key9) {
camera_render_graph.set(bevy_strolle::graph::NAME);
if keys.just_pressed(KeyCode::Digit9) {
camera_render_graph.set(StrolleGraph);

camera.mode = st::CameraMode::Reference { depth: 1 };
}

if keys.just_pressed(KeyCode::Key0) {
camera_render_graph.set("core_3d");
if keys.just_pressed(KeyCode::Digit0) {
camera_render_graph.set(Core3d);
}

if keys.just_pressed(KeyCode::Semicolon) {
Expand All @@ -149,7 +150,7 @@ pub fn handle_camera(
};
}

if keys.just_pressed(KeyCode::X) {
if keys.just_pressed(KeyCode::KeyX) {
println!("{:?}", camera_xform.translation);
}
}
Expand All @@ -173,20 +174,20 @@ impl Default for Sun {
}
}

pub fn handle_sun(keys: Res<Input<KeyCode>>, mut sun: ResMut<Sun>) {
if keys.just_pressed(KeyCode::H) {
pub fn handle_sun(keys: Res<ButtonInput<KeyCode>>, mut sun: ResMut<Sun>) {
if keys.just_pressed(KeyCode::KeyH) {
sun.azimuth -= 0.05;
}

if keys.just_pressed(KeyCode::J) {
if keys.just_pressed(KeyCode::KeyJ) {
sun.altitude -= 0.05;
}

if keys.just_pressed(KeyCode::K) {
if keys.just_pressed(KeyCode::KeyK) {
sun.altitude += 0.05;
}

if keys.just_pressed(KeyCode::L) {
if keys.just_pressed(KeyCode::KeyL) {
sun.azimuth += 0.05;
}
}
Expand Down
5 changes: 3 additions & 2 deletions bevy-strolle/examples/cornell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use bevy::math::vec3;
use bevy::prelude::*;
use bevy::render::camera::CameraRenderGraph;
use bevy::window::WindowResolution;
use bevy_strolle::graph::StrolleGraph;
use bevy_strolle::prelude::*;
use smooth_bevy_cameras::controllers::orbit::{
OrbitCameraBundle, OrbitCameraController, OrbitCameraPlugin,
Expand Down Expand Up @@ -56,14 +57,14 @@ fn setup(mut commands: Commands, assets: Res<AssetServer>) {
commands
.spawn(Camera3dBundle {
camera_render_graph: CameraRenderGraph::new(
bevy_strolle::graph::NAME,
StrolleGraph,
),
camera: Camera {
hdr: true,
..default()
},
..default()
})
}).insert(StrolleCamera::default())
Comment thread
Patryk27 marked this conversation as resolved.
Outdated
.insert(OrbitCameraBundle::new(
{
OrbitCameraController {
Expand Down
Loading