cloudiful-bevy-outline 0.2.4

Reusable geometry-shell outline plugin for Bevy.
Documentation
  • Coverage
  • 0%
    0 out of 16 items documented0 out of 11 items with examples
  • Size
  • Source code size: 95.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4m 42s Average build duration of successful builds.
  • all releases: 5m 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • cloudiful/bevy
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cloudiful

cloudiful-bevy-outline

Small reusable Bevy outline helper crate for geometry-shell outlines.

What it provides

  • GpmoOutlinePlugin: initializes default outline assets
  • OutlineStyle: configurable color, emissive strength, and shell scale
  • OutlineAssets: default cached material/style resource
  • OutlineShell: marker component for spawned outline meshes
  • spawn_outline_mesh(...): attach an outline mesh with a custom material/style
  • spawn_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 bevy::prelude::*;
use cloudiful_bevy_outline::GpmoOutlinePlugin;

App::new().add_plugins((DefaultPlugins, GpmoOutlinePlugin::default()));

Spawn an outline child:

use bevy::prelude::*;
use cloudiful_bevy_outline::{OutlineAssets, spawn_default_outline_mesh};

fn attach_outline(
    parent: &mut ChildSpawnerCommands,
    outline_assets: &OutlineAssets,
    mesh: Handle<Mesh>,
) {
    spawn_default_outline_mesh(parent, outline_assets, mesh, Visibility::Hidden);
}

Then toggle the outline child's Visibility.

Technique

This crate uses a geometry-shell outline:

  1. draw the normal mesh
  2. draw a second mesh with front-face culling
  3. scale that second mesh slightly larger
  4. only the outside silhouette remains visible