-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update to Bevy 0.13 #232
base: main
Are you sure you want to change the base?
Update to Bevy 0.13 #232
Changes from 1 commit
324d9d3
4ee7629
f9896c7
8405dda
b0f4b55
ee73426
910c8e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,22 +16,21 @@ name = "extending_site_editor" | |
path = "examples/extending_menu.rs" | ||
|
||
[dependencies] | ||
bevy_egui = "0.23" | ||
bevy_mod_raycast = "0.16" | ||
bevy_mod_outline = "0.6" | ||
# PR merged after 0.10 but not released yet, bump to 0.10.1 once merged | ||
bevy_infinite_grid = { git = "https://github.com/ForesightMiningSoftwareCorporation/bevy_infinite_grid", rev = "86018dd" } | ||
bevy_gltf_export = { git = "https://github.com/luca-della-vedova/bevy_gltf_export", branch = "luca/transform_api"} | ||
bevy_polyline = "0.8.1" | ||
bevy_stl = "0.12" | ||
bevy_obj = { version = "0.12.1", features = ["scene"] } | ||
bevy_egui = "0.27" | ||
bevy_mod_raycast = "0.17" | ||
bevy_mod_outline = "0.7" | ||
bevy_infinite_grid = "0.12" | ||
bevy_gltf_export = { git = "https://github.com/luca-della-vedova/bevy_gltf_export", branch = "bevy_0.13"} | ||
bevy_polyline = { git = "https://github.com/luca-della-vedova/bevy_polyline", branch = "luca/bevy_0.13_panic" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
bevy_stl = "0.13" | ||
bevy_obj = { version = "0.13", features = ["scene"] } | ||
smallvec = "*" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_yaml = "0.8.23" | ||
serde_json = "1.0" | ||
wasm-bindgen = "0.2.87" | ||
futures-lite = "1.12.0" | ||
bevy = { version = "0.12", features = ["pnm", "jpeg", "tga"] } | ||
bevy = { version = "0.13", features = ["pnm", "jpeg", "tga"] } | ||
dirs = "5.0" | ||
thread_local = "*" | ||
geo = "0.27" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ use bevy_polyline::{ | |
material::PolylineMaterial, | ||
polyline::{Polyline, PolylineBundle}, | ||
}; | ||
use shape::UVSphere; | ||
|
||
#[derive(Clone, Debug, Resource)] | ||
pub struct InteractionAssets { | ||
|
@@ -228,47 +227,42 @@ impl FromWorld for InteractionAssets { | |
let mut meshes = world.get_resource_mut::<Assets<Mesh>>().unwrap(); | ||
let dagger_mesh = meshes.add(make_dagger_mesh()); | ||
let halo_mesh = meshes.add(make_halo_mesh()); | ||
let camera_control_mesh = meshes.add(Mesh::from(UVSphere { | ||
let camera_control_mesh = meshes.add(Mesh::from(Sphere { | ||
radius: 0.02, | ||
..Default::default() | ||
})); | ||
let arrow_mesh = meshes.add(make_cylinder_arrow_mesh()); | ||
let point_light_socket_mesh = meshes.add( | ||
make_cylinder(0.06, 0.02) | ||
.transform_by(Affine3A::from_translation(0.04 * Vec3::Z)) | ||
.into(), | ||
make_cylinder(0.06, 0.02).transform_by(Affine3A::from_translation(0.04 * Vec3::Z)), | ||
); | ||
let point_light_shine_mesh = meshes.add(Mesh::from(shape::UVSphere { | ||
let point_light_shine_mesh = meshes.add(Mesh::from(Sphere { | ||
radius: 0.05, | ||
..Default::default() | ||
})); | ||
let spot_light_cover_mesh = meshes.add( | ||
make_smooth_wrap( | ||
[ | ||
Circle { | ||
radius: 0.05, | ||
height: 0.0, | ||
}, | ||
Circle { | ||
radius: 0.01, | ||
height: 0.04, | ||
}, | ||
], | ||
32, | ||
) | ||
.into(), | ||
); | ||
let spot_light_cover_mesh = meshes.add(make_smooth_wrap( | ||
[ | ||
OffsetCircle { | ||
radius: 0.05, | ||
height: 0.0, | ||
}, | ||
OffsetCircle { | ||
radius: 0.01, | ||
height: 0.04, | ||
}, | ||
], | ||
32, | ||
)); | ||
let spot_light_shine_mesh = meshes.add( | ||
Mesh::from( | ||
make_bottom_circle( | ||
Circle { | ||
OffsetCircle { | ||
Comment on lines
-267
to
+261
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
radius: 0.05, | ||
height: 0.0, | ||
}, | ||
32, | ||
) | ||
.merge_with(make_top_circle( | ||
Circle { | ||
OffsetCircle { | ||
radius: 0.01, | ||
height: 0.04, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,10 @@ | |
*/ | ||
use crate::interaction::{InteractionAssets, PickingBlockers}; | ||
use bevy::{ | ||
core_pipeline::{ | ||
clear_color::ClearColorConfig, core_3d::Camera3dBundle, tonemapping::Tonemapping, | ||
}, | ||
core_pipeline::{core_3d::Camera3dBundle, tonemapping::Tonemapping}, | ||
prelude::*, | ||
render::{ | ||
camera::{Camera, Projection, ScalingMode}, | ||
camera::{Camera, Exposure, Projection, ScalingMode}, | ||
view::RenderLayers, | ||
}, | ||
}; | ||
|
@@ -257,11 +255,12 @@ impl FromWorld for CameraControls { | |
.spawn(DirectionalLightBundle { | ||
directional_light: DirectionalLight { | ||
shadows_enabled: false, | ||
illuminance: 20000., | ||
illuminance: 5000., | ||
..default() | ||
}, | ||
..default() | ||
}) | ||
.insert(RenderLayers::all()) | ||
.id(); | ||
|
||
let perspective_child_cameras = [ | ||
|
@@ -273,12 +272,15 @@ impl FromWorld for CameraControls { | |
world | ||
.spawn(Camera3dBundle { | ||
projection: Projection::Perspective(Default::default()), | ||
camera: Camera { order, ..default() }, | ||
camera_3d: Camera3d { | ||
camera: Camera { | ||
order, | ||
clear_color: ClearColorConfig::None, | ||
..default() | ||
}, | ||
tonemapping: Tonemapping::ReinhardLuminance, | ||
exposure: Exposure { | ||
ev100: Exposure::EV100_INDOOR, | ||
}, | ||
..default() | ||
}) | ||
.insert(VisibilityBundle { | ||
|
@@ -316,11 +318,12 @@ impl FromWorld for CameraControls { | |
)), | ||
directional_light: DirectionalLight { | ||
shadows_enabled: false, | ||
illuminance: 20000., | ||
illuminance: 5000., | ||
..default() | ||
}, | ||
..default() | ||
}) | ||
.insert(RenderLayers::all()) | ||
.id(); | ||
|
||
let ortho_projection = OrthographicProjection { | ||
|
@@ -341,13 +344,13 @@ impl FromWorld for CameraControls { | |
camera: Camera { | ||
is_active: false, | ||
order, | ||
..default() | ||
}, | ||
camera_3d: Camera3d { | ||
clear_color: ClearColorConfig::None, | ||
..default() | ||
}, | ||
projection: Projection::Orthographic(ortho_projection.clone()), | ||
exposure: Exposure { | ||
ev100: Exposure::EV100_INDOOR, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As part of the work on lighting and cameras, a new component was added for exposure. I'm defaulting it to indoor exposure and changing the light default accordingly. |
||
tonemapping: Tonemapping::ReinhardLuminance, | ||
..default() | ||
}) | ||
|
@@ -463,7 +466,7 @@ fn camera_controls( | |
|
||
// Ensure upright | ||
let forward = persp_transform.forward(); | ||
persp_transform.look_to(forward, Vec3::Z); | ||
persp_transform.look_to(*forward, Vec3::Z); | ||
} | ||
|
||
let proj = persp_proj.clone(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lights in the bevy renderer itself don't use the alpha channel (and it's unclear what alpha even means for a light color), hence changed them to be RGB