Apply a pixelation effect to any Bevy mesh or scene without post-processing.
PixelateMeshPlugin
, where you specify a component that tracks the main camera.Pixelate
component to any entity that you want to pixelate.The tracking component is needed because the plugin draws the textures on 2D canvases that need to rotate to always face the main camera.
| bevy | pixelate_mesh | |------|---------------| | 0.10 | 0.1 |
The following is an annotated minimal example. More can be found in the examples folder.
```rust use bevy::prelude::; use pixelate_mesh::prelude::;
fn main() {
App::new()
.addplugins(DefaultPlugins)
// Add the plugin
.addplugin(PixelateMeshPlugin::
// Create a component for the main camera
struct MainCamera;
fn setup(
mut commands: Commands,
mut meshes: ResMut
commands.spawn((
// Add the tracking component to the camera
MainCamera,
Camera3dBundle {
transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
..default()
},
));
} ```
The plugin tries to emulate the effect as seen in Prodeus: