Giter Club home page Giter Club logo

bevy-examples's Introduction

Bevy Examples

This repo is a selection of contained examples using the Bevy game engine. It is mostly focused on examples that interact with shaders.

bevy-examples's People

Contributors

christopherbiscardi avatar raynalhugo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bevy-examples's Issues

ShaderUtilsPlugin causing error

"the trait bound (bevy::DefaultPlugins, ShaderUtilsPlugin, PlayerPlugin, camera::CameraPlugin, WorldPlugin, bevy_third_person_camera::ThirdPersonCameraPlugin, bevy_inspector_egui::quick::WorldInspectorPlugin, bevy::prelude::MaterialPlugin<ExtendedMaterial<bevy::prelude::StandardMaterial, ExtensionTest>>): bevy_app::plugin::sealed::Plugins<_> is not satisfied
perhaps two different versions of crate bevy_app are being used?"
is being reported whenever I add the ShaderUtilsPlugin, this maybe be my fault as I am new to bevy and rust. I'm using bevy 0.13.1.

Much thanks Maebh!

Register common lints in workspace-level lint section

Rust 1.74 allows specifying lints in a workspace-level Cargo.toml.

Common lints that Bevy applications trigger in clippy but are typically false flags are:

Lints can be defined at the workspace Cargo.toml.

[workspace]
members = ["examples/*"]
resolver = "2"

[workspace.lints.clippy]
type_complexity = "allow"
too_many_arguments = "allow"

Each package needs this in Cargo.toml.

[lints]
workspace = true

Bevy 13: Shader changes

  • Custom 2d and 3d mesh/material shaders should now use bind group 2 @group(2) @binding(x) for their bound resources, instead of bind group 1.
  • Many internal pieces of rendering code have changed so that mesh data is now in bind group 1, and material data is now in bind group 2. Semi-custom rendering setups (that don’t use the Material or Material2d APIs) should adapt to these changes.

Migrating from 0.12 to 0.13

Migrate shield with depth to Bevy 0.11

There are a lot of examples and it might be simpler to get them to work with Bevy 0.11 one by one. This issue is regarding one of the coolest, the shield-with-depth example.

It depends on

  • bevy_basic_camera
  • bevy_prepass_debug
  • bevy_shader_utils

So in total four crates need to be touched. We could migrate them to get to work with Bevy 0.11 and any other improvements such as enabling prepass motion vector would be left as future enhancements.

i have multiple prob with "cargo run --example voronoise-pan"

error[E0609]: no field time on type &mut CustomMaterial
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:62:20
|
62 | material.1.time =
| ^^^^ unknown field
|
= note: available fields are: color

error[E0599]: no method named seconds_since_startup found for struct bevy::prelude::Res<'_, bevy::prelude::Time> in the current scope
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:63:18
|
63 | time.seconds_since_startup() as f32;
| ^^^^^^^^^^^^^^^^^^^^^ method not found in Res<'_, Time>

error[E0308]: mismatched types
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:85:19
|
85 | .push("VERTEX_UVS".to_string());
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^ expected ShaderDefVal, found String
| |
| arguments to this method are incorrect
|
note: method defined here
--> C:\Users\Administrator.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:1836:12
|
1836 | pub fn push(&mut self, value: T) {
| ^^^^
help: call Into::into on this expression to convert std::string::String into ShaderDefVal
|
85 | .push("VERTEX_UVS".to_string().into());
| +++++++

error[E0308]: mismatched types
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:88:35
|
88 | fragment.shader_defs.push("VERTEX_UVS".to_string());
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^ expected ShaderDefVal, found String
| |
| arguments to this method are incorrect
|
note: method defined here
--> C:\Users\Administrator.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:1836:12
|
1836 | pub fn push(&mut self, value: T) {
| ^^^^
help: call Into::into on this expression to convert std::string::String into ShaderDefVal
|
88 | fragment.shader_defs.push("VERTEX_UVS".to_string().into());
| +++++++

Is this code open source?

This seems like a great little resource for Bevy shaders. Unfortunately, there's no license specified, so it's not clear whether the code can actually be used or redistributed.

Issue with 3D Perlin implementation

There seems to be an issue with the Perlin 3D implementation.
Passing the following data world_position.xyz * 5.0

  • Simplex 3D:
    image
  • Perlin 3D:
    image

It seems to have something to do with the algorithm only using the decimal part on one of the parameters, the cube has length of 1, notice how I multiplied the input by 5 and we see 5 stripes in one of the directions...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.