Skip to content

Commit ec002d7

Browse files
authored
Merge pull request #4 from johanhelsing/bevy-0.10
Port to bevy 0.10
2 parents 6b1bf88 + 2c76064 commit ec002d7

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Cargo.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ repository = "https://github.com/johanhelsing/noisy_bevy"
1010
version = "0.2.0"
1111

1212
[dependencies]
13-
bevy = {version = "0.9", features = ["bevy_asset", "render"], default-features = false}
13+
bevy = { version = "0.10", features = ["bevy_asset", "bevy_render"], default-features = false }
1414

1515
[dev-dependencies]
16-
bevy = {version = "0.9", default-features = false, features = [
17-
"render",
16+
bevy = { version = "0.10", default-features = false, features = [
17+
"bevy_render",
18+
"bevy_sprite",
1819
"bevy_asset",
1920
"bevy_winit",
2021
"filesystem_watcher",
2122
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
22-
]}
23+
] }
2324
rand = "0.8"
24-
bevy_egui = {version = "0.17", default-features = false, features = ["default_fonts"]}
25-
bevy-inspector-egui = {version = "0.14", default-features = false}
26-
bevy_pancam = { version = "0.7", features = ["bevy-inspector-egui", "bevy_egui"] }
25+
# bevy_egui = {version = "0.17", default-features = false, features = ["default_fonts"]}
26+
bevy_egui = {git = "https://github.com/mvlabat/bevy_egui", branch = "bevy-0.10", default-features = false, features = ["default_fonts"]}
27+
# bevy-inspector-egui = {version = "0.14", default-features = false}
28+
# bevy_pancam = { version = "0.7", features = ["bevy-inspector-egui", "bevy_egui"] }
29+
bevy_pancam = { git = "https://github.com/johanhelsing/bevy_pancam", branch = "bevy-0.10", features = ["bevy_egui"] }
2730
insta = "1.21"

assets/examples/asteroid_background.wgsl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#import bevy_pbr::mesh_view_bindings
2-
#import bevy_pbr::utils
1+
#import bevy_render::view
32
#import noisy_bevy::prelude
43
// #import bevy_pbr::mesh_functions
54
#import bevy_sprite::mesh2d_bindings
@@ -17,9 +16,9 @@ fn fragment(
1716
#import bevy_sprite::mesh2d_vertex_output
1817
) -> @location(0) vec4<f32> {
1918
// perf: better to do in vertex shader!
20-
let p = world_position.xy - vec2(mesh.model[3].x, mesh.model[3].y); // ignoring rotation
19+
var p = world_position.xy - vec2(mesh.model[3].x, mesh.model[3].y); // ignoring rotation
2120
// sample noise
22-
let p = p.xy;
21+
p = p.xy;
2322
let params = material.params;
2423
let freq_scale = params.x;
2524
let amp_scale = params.y;
@@ -35,8 +34,8 @@ fn fragment(
3534
// ...or add some extra turbulence to the "atmosphere"
3635
let n = fbm_simplex_2d_seeded(p * freq_scale, 7, 2.0, 0.5, seed) * amp_scale;
3736

38-
let v = d - n;
39-
let v = pow(-v * 0.1 + 0.3, 2.1);
37+
var v = d - n;
38+
v = pow(-v * 0.1 + 0.3, 2.1);
4039

4140
return vec4(v, v, v, 1.);
4241
}

examples/asteroids.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use bevy::{
55
render::{camera::ScalingMode, render_resource::AsBindGroup},
66
sprite::{Material2d, Material2dPlugin, MaterialMesh2dBundle},
77
};
8-
use bevy_inspector_egui::WorldInspectorPlugin;
8+
// use bevy_inspector_egui::WorldInspectorPlugin;
99
use bevy_pancam::{PanCam, PanCamPlugin};
1010
use noisy_bevy::{simplex_noise_2d_seeded, NoisyShaderPlugin};
1111

@@ -20,7 +20,7 @@ fn main() {
2020
.add_plugin(NoisyShaderPlugin)
2121
.add_plugin(PanCamPlugin::default())
2222
.add_plugin(Material2dPlugin::<AsteroidBackgroundMaterial>::default())
23-
.add_plugin(WorldInspectorPlugin::default())
23+
// .add_plugin(WorldInspectorPlugin::default())
2424
.add_startup_system(setup)
2525
.add_system(expand_asteroids)
2626
.run();

0 commit comments

Comments
 (0)