cloudiful-bevy-outline
Small reusable Bevy outline helper crate for geometry-shell outlines.
What it provides
GpmoOutlinePlugin: initializes default outline assetsGpmoOutlinePlugin::with_default_style(...): installs a custom default outline styleOutlineStyle: configurable color, emissive strength, and shell scaleOutlineAssets: default cached material/style resourceOutlineShell: marker component for spawned outline meshescreate_outline_material(...): build a custom outline material from anOutlineStyleoutline_shell_transform(...): build the transform used for shell scalingspawn_outline_mesh(...): attach an outline mesh with a custom material/stylespawn_default_outline_mesh(...): attach an outline mesh using the plugin's default style
What it does not provide
- screen-space outlines
- stencil-based outline passes
- automatic mesh duplication for arbitrary scenes
This crate intentionally stays simple: it supports the common "draw a slightly enlarged backface-only shell" outline technique.
Usage
Add the plugin:
use *;
use ;
let mut app = new;
app.
.add_plugins;
app.update;
assert!;
Spawn an outline child with the default material/style resource:
use *;
use ;
Then toggle the outline child's Visibility.
The full runnable example lives at examples/basic.rs.
Default Style Flow
GpmoOutlinePlugin creates one default material at startup and stores it in
OutlineAssets.
- use
OutlineAssetswhen many outline shells can share one default look - use
GpmoOutlinePlugin::with_default_style(...)when the whole app should start with a different default style - use
create_outline_material(...)when one outline needs its own material - use
outline_shell_transform(...)when you need the shell scale without spawning through the helper
Custom style example:
use *;
use ;
let mut app = new;
app.
.add_plugins;
app.update;
let outline_assets = app.world.;
assert_eq!;
Technique
This crate uses a geometry-shell outline:
- draw the normal mesh
- draw a second mesh with front-face culling
- scale that second mesh slightly larger
- only the outside silhouette remains visible