| Crates.io | bevy_edge_detection_outline |
| lib.rs | bevy_edge_detection_outline |
| version | 0.1.1 |
| created_at | 2025-10-08 15:05:37.277881+00 |
| updated_at | 2025-10-08 16:16:59.572146+00 |
| description | Edge detection outline post-processing plugin for Bevy (WGSL shader). |
| homepage | https://github.com/Mediocre-AI/bevy_edge_detection_outline |
| repository | |
| max_upload_size | |
| id | 1874081 |
| size | 1,146,359 |
A post-processing outline effect for Bevy (0.17.2+) that detects edges from depth, normals, and/or color and draws customizable outlines. This is a re-implementation of the original plugin with a Bevy 0.17.2 rendering pipeline.
| Crate version | Bevy version |
|---|---|
| 0.1.x | 0.17.2 – 0.17.x |
EdgeDetectionPlugin to your app; no manual render graph wiring.edge_color.DepthPrepass and NormalPrepass.Add the plugin and enable the prepasses on your camera; attach EdgeDetection to the camera entity to configure the effect.
use bevy::prelude::*;
use bevy_edge_detection_outline::{EdgeDetectionPlugin, EdgeDetection};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(EdgeDetectionPlugin::default())
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Camera3d::default(),
bevy::core_pipeline::prepass::DepthPrepass::default(),
bevy::core_pipeline::prepass::NormalPrepass::default(),
EdgeDetection::default(),
));
}
Linux/macOS/Windows:
cargo run --example 3d_shapesWSL2 (Windows Subsystem for Linux):
WINIT_UNIX_BACKEND=x11 cargo run --example 3d_shapesPanOrbitCamera.edge_color via the EGUI window.This repo serves the example via Vite. Use pnpm for the dev server, and build.sh to produce the wasm/JS artifacts.
rustup target add wasm32-unknown-unknown
cargo install -f wasm-bindgen-cli
npm install -g pnpm
pnpm install
./build.sh
This compiles examples/3d_shapes.rs to wasm32-unknown-unknown and runs wasm-bindgen, outputting JS/WASM into target/ consumed by index.html.
pnpm dev
Open the shown localhost URL and press Enter or click “Start Game”. Re-run ./build.sh to rebuild, then refresh the page.
Notes:
This project is a re-implementation of the bevy_edge_detection plugin for Bevy 0.17.2.