Smooth pixel-perfect camera for Bevy

Overview

bevy_smooth_pixel_camera

A bevy plugin that adds a simple smooth pixel camera.

The smoothing is based on this video from aarthificial which explains how it works pretty nicely: https://youtu.be/jguyR4yJb1M

This method allows for smooth camera movement while retaining the pixel perfection of low resolution rendering.

Usage

  1. Add the bevy_smooth_pixel_camera crate to your project.
cargo add bevy_smooth_pixel_camera
  1. Add the PixelCameraPlugin and set the ImagePlugin to default_nearest.
use bevy::prelude::*;
use bevy_smooth_pixel_camera::prelude::*;

App::new().add_plugins((
    DefaultPlugins.set(ImagePlugin::default_nearest()),
    PixelCameraPlugin
));
  1. Add a pixel pefect camera to your scene.
use bevy::prelude::*;
use bevy_smooth_pixel_camera::prelude::*;

fn setup(mut commands: Commands) {
    commands.spawn((
        Camera2dBundle::default(),
        PixelCamera::from_scaling(4)
    ));
}
  1. That should be it! Make sure you move your camera via the PixelCamera.subpixel_pos property instead of the Transform component.

Bevy Compatibility

bevy bevy_smooth_pixel_camera
0.12.0 0.1.0
You might also like...
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

A Bevy plugin for loading the LDtk 2D tile map format.
A Bevy plugin for loading the LDtk 2D tile map format.

bevy_ldtk ( Tileset from "Cavernas" by Adam Saltsman ) A Bevy plugin for loading LDtk tile maps. Usage use bevy::prelude::*; use bevy_ldtk::*; fn mai

An ergonomic physics API for bevy games.

Heron An ergonomic physics API for 2d and 3d bevy games. (powered by rapier) How it looks like fn main() { App::build() .add_plugins(DefaultPlug

Inspector plugin for the bevy game engine
Inspector plugin for the bevy game engine

bevy-inspector-egui This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a debug interface using egui where

A plugin for Egui integration into Bevy
A plugin for Egui integration into Bevy

bevy_egui This crate provides a Egui integration for the Bevy game engine. Features: Desktop and web (bevy_webgl2) platforms support Clipboard (web su

Crossterm plugin for the bevy game engine
Crossterm plugin for the bevy game engine

What is bevy_crossterm? bevy_crossterm is a Bevy plugin that uses crossterm as a renderer. It provides custom components and events which allow users

Game physics in one weekend with bevy

Game Physics in a Weekend (in Rust) This project is an implementation of the Game Physics in a Weekend book using the Rust programming language and th

Releases(0.1.1)
Pixel-Perfect, 2D Renderer for Bevy that Seamlessly Targets Desktop and Web

bevy_retro ( Screenshot of Bounty Bros. game made with Bevy Retro and Skip'n Go ) Bevy Retro is a 2D, pixel-perfect renderer for Bevy that can target

Katharos Technology 224 Dec 23, 2022
A Bevy Engine plugin for making 2D paths, smooth animations with Bezier curves

bevy_pen_tool A Bevy Engine plugin for making 2D paths and smooth animations with Bezier curves TODO: Mesh-making functionality for building 2D shapes

Eli 36 Dec 22, 2022
Basic first-person fly camera for the Bevy game engine

bevy_flycam A basic first-person fly camera for Bevy 0.4 Controls WASD to move horizontally SPACE to ascend LSHIFT to descend ESC to grab/release curs

Spencer Burris 85 Dec 23, 2022
A 4X style camera for bevy.

A 4X style camera for bevy. Demo Default Key Bindings: W / A / S / D / Arrow Keys / Mouse Left - Move along the horizontal plane Q / E / Mouse Right -

null 30 Jan 4, 2023
A spectator camera plugin for the Bevy game engine

bevy_spectator A spectator camera plugin for the Bevy game engine. Controls Action Key Forward W Left A Backward S Right D Up Space Down LControl Alt.

Jonah Henriksson 5 Jan 2, 2023
Combine simple building blocks to create smooth cameras: first-person, chase, orbit, look-at, you name it!

?? dolly Combine simple building blocks to create smooth cameras: first-person, chase, orbit, look-at, you name it! Camera rigs made with dolly are en

Tomasz Stachowiak 284 Dec 26, 2022
Sandbox is a pixel physics simulator inspired by other such like Sandspiel and Noita

Sandbox Sandbox is a pixel physics simulator inspired by other such like Sandspiel and Noita. It's also a precursor for an ongoing game project. Sandb

Okko Hakola 76 Nov 3, 2022
Learning rust with the olc Pixel Game Engine.

olc rust sketches Learning Rust with the olc Pixel Game Engine. This project is based on olcPixelGameEngine-rs, a Rust API by Ivan Sadikov for the olc

Steve Ruiz 10 Oct 24, 2022
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022