dtcristo / bevy_pixels Goto Github PK
View Code? Open in Web Editor NEWBevy plugin that uses Pixels (a tiny pixel buffer) for rendering
Home Page: https://docs.rs/bevy_pixels
License: Apache License 2.0
Bevy plugin that uses Pixels (a tiny pixel buffer) for rendering
Home Page: https://docs.rs/bevy_pixels
License: Apache License 2.0
Hello, maybe bevy_pixels shines with pixel collision with twisted shapes ?
if possible, could you show this with a dragon curve shape or a fractal snowflake ?
I just added this to my Cargo.toml on PopOS Linux:
bevy = { version = "0.6", default_features = false } bevy_pixels = "0.3"
(Swapping in bevy 0.6.1 doesn't change anything.)
The result was this error message:
error: Please select a feature to build for unix:
x11
,wayland
--> /home/sean/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:10:1
|
10 | compile_error!("Please select a feature to build for unix:x11
,wayland
");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the same problem that this other project is facing: StarArawn/bevy_tiled#65
I modified the bevy dependency as mentioned in that ticket to:
bevy = { version = "0.5", default-features = false, features = ["x11"] }
and everything worked.
Potential fix here, but it presumably won't work well for wayland users: https://github.com/StarArawn/bevy_tiled/pull/66/files
But of course that step shouldn't be required if possible. Could you take a look at how to remove this hiccup from the linux installation process? Thanks!
I was trying to use bevy_pixels
in my new Bevy 0.10 project, but it didn't work, which is totally understandable, since Bevy 0.10 was released, like, this week ๐
I might try to create Pull Request to this repository at some point, but for now I only re-created parts of this crate in my own repo (link).
Hey, thank you for this nice little crate !
However when running the example the square is not moving...
I have the same problem within my simulation too.
I'm working on a game that runs on Windows and WASM. It already uses Pixels and Bevy (though not bevy_pixels), but the main loop is managed by Pixels and the glue code I'm using to transfer things like inputs to Bevy is kinda ugly.
I tried using your plugin to get something cleaner, but it doesn't build for the web. So I also tried to implement the Pixels example, but it's a task way too complex for my rust skill level.
Do you think it's something achievable, and if I may ask, would you mind make your plugin compatible with WASM? Thank you :)
I am getting the following error when trying to build with this crate:
error: failed to select a version for `web-sys`.
... required by package `wgpu v0.12.0`
... which satisfies dependency `wgpu = "^0.12.0"` of package `bevy_render v0.7.0`
... which satisfies dependency `bevy_render = "^0.7.0"` of package `bevy_core_pipeline v0.7.0`
... which satisfies dependency `bevy_core_pipeline = "^0.7.0"` of package `bevy_pbr v0.7.0`
... which satisfies dependency `bevy_pbr = "^0.7.0"` of package `bevy_internal v0.7.0`
... which satisfies dependency `bevy_internal = "^0.7.0"` of package `bevy v0.7.0`
... which satisfies dependency `bevy = "^0.7"` of package `bevy_pixels v0.5.0`
... which satisfies dependency `bevy_pixels = "^0.5"` of package `kaminta v0.1.0 (/home/elfein/Projects/kaminta)`
versions that meet the requirements `^0.3.53` are: 0.3.60, 0.3.59, 0.3.58, 0.3.57, 0.3.56, 0.3.55, 0.3.54, 0.3.53
the package `wgpu` depends on `web-sys`, with features: `GpuBufferUsage` but `web-sys` does not have these features.
all possible versions conflict with previously selected packages.
previously selected package `web-sys v0.3.58`
... which satisfies dependency `web-sys = "^0.3.53"` of package `wgpu v0.12.0`
... which satisfies dependency `wgpu = "^0.12.0"` of package `bevy_render v0.7.0`
... which satisfies dependency `bevy_render = "^0.7.0"` of package `bevy_core_pipeline v0.7.0`
... which satisfies dependency `bevy_core_pipeline = "^0.7.0"` of package `bevy_pbr v0.7.0`
... which satisfies dependency `bevy_pbr = "^0.7.0"` of package `bevy_internal v0.7.0`
... which satisfies dependency `bevy_internal = "^0.7.0"` of package `bevy v0.7.0`
... which satisfies dependency `bevy = "^0.7"` of package `bevy_pixels v0.5.0`
... which satisfies dependency `bevy_pixels = "^0.5"` of package `kaminta v0.1.0 (/home/elfein/Projects/kaminta)`
failed to select a version for `web-sys` which could resolve this conflict
My dependencies
look like so:
[dependencies]
bevy = { version = "0.8", default_features = false }
bevy_pixels = "0.5"
I am still new to shaders and the library Pixels, but currently I'm running my shader pipeline off the encoder from pixels.
let _ = pixels.render_with(|encoder, surface_texture, context| {
context
.scaling_renderer
.render(encoder, &post_process.texture1);
post_process.render(encoder, surface_texture);
Are we able to use shaders with this plugin?
Hi, I want to start using bevy_pixels, but seems like it has to be updated first.
Whenever I try to run the most basic code with bevy_pixels the app crashes.
This is the most basic code that gives this error:
use bevy::prelude::*;
use bevy_pixels::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(PixelsPlugin)
.run();
}
What happens is that the application will open and it will show a screen with a white background, but then it will panic. This happens as soon as I add the PixelsPlugin in the main function. Without it there are no problems.
error message:
2022-02-20T17:41:26.114561Z INFO bevy_render::renderer: AdapterInfo { name: "Quadro M1200", vendor: 4318, device: 5046, device_type: DiscreteGpu, backend: Vulkan }
2022-02-20T17:41:26.553636Z ERROR wgpu_hal::vulkan::instance: VALIDATION [NVIDIA (0x0)]
vkCreateSwapchainKHR: internal drawable creation failed
2022-02-20T17:41:26.554363Z ERROR wgpu_hal::vulkan::instance: objects: (type: SWAPCHAIN_KHR, hndl: 0x25e79a54f88, name: ?)
thread 'main' panicked at 'Error in Surface::configure: parent device is lost', C:\Users\mathi.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:214:9
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
error: process didn't exit successfully: target\debug\raytrace_test.exe
(exit code: 101)
I noticed that multiple windows support is in the TODO list. My current project has reached the point where I need multiple window support, so I was wondering if that would be coming to this library in the near future.
Either way, is there a better work-around than just rendering the second window through a system unrelated to bevy_pixels?
Thanks for making a useful library!
Hi! ๐ pixels
author here.
I noticed this crate uses a very outdated version of the crate. I am interested in pulling this project into the pixels
repo so that it stays up-to-date!
@dtcristo If you don't mind transferring the crate name over to me on crates.io, I would be happy to take over.
Noticed I had a very noticable memory leak in my program. Commented everything out except the App::build() and went my way through the systems commenting out each one until the memory leak stopped. It only stopped once .add_plugin(PixelsPlugin) was commented out.
I also tried it in a new and empty project with just the App::build() in it and still got a memory leak.
Here's a github with said empty project https://github.com/BradFitz66/Memory-Leak-Repro/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.