Expand description
This crate provides a Bevy plugin, OutlinePlugin
, and associated
components for rendering outlines around meshes using the vertex extrusion
and jump flood methods.
Outlines are rendered in a seperate pass following the main 3D pass and using a separate depth buffer. This ensures that outlines are not clipped by non-outline geometry.
An outline consists of two parts, a volume and a stencil. The volume
will, by itself, cover the original object entirely with the outline
colour. The stencil prevents the body of an object from being filled in.
Stencils also allows other entities to occlude outlines, otherwise the
outline will be drawn on top of them. These parts are controlled by the
OutlineVolume
and OutlineStencil
components respectively.
The OutlineMode
component specifies the rendering method. Outlines may
be flattened into a plane in order to further avoid clipping, or left in
real space. The depth of flat outlines can be controlled using the
OutlinePlaneDepth
component.
Outlines can be inherited from the parent via the InheritOutline
component.
Vertex extrusion works best with meshes that have smooth surfaces. To
avoid visual artefacts when outlining meshes with hard edges, see the
OutlineMeshExt::generate_outline_normals
function and the
AutoGenerateOutlineNormalsPlugin
.
Jump flood support is currently experimental and can be enabled by
adding the OutlineMode::FloodFlat
component.
Modules§
- bundles
Deprecated - Legacy bundles.
Structs§
- Async
Scene Inherit Outline - Automatically inherits outlines for the entities in a scene.
- Auto
Generate Outline Normals Plugin - Automatically runs
generate_outline_normals
on every mesh. - Computed
Outline - A component for storing the computed depth at which the outline lies.
- Generate
Outline Normals Settings - Settings for generating mesh outline normals.
- Inherit
Outline - A component for inheriting outlines from the parent entity.
- Outline
Alpha Mask - A component for specifying an alpha mask texture.
- Outline
Plane Depth - A component which controls the depth sorting of flat outlines and stencils.
- Outline
Plugin - Adds support for rendering outlines.
- Outline
Render Layers - A component for specifying what layer(s) the outline should be rendered for.
- Outline
Stencil - A component for stenciling meshes during outline rendering.
- Outline
Volume - A component for rendering outlines around meshes.
Enums§
- Generate
Outline Normals Error - Failed to generate outline normals for the mesh.
- Node
Outline - Labels for render graph nodes which draw outlines.
- Outline
Mode - A component which specifies how the outline should be rendered.
- Texture
Channel - The channel of a texture.
Constants§
- ATTRIBUTE_
OUTLINE_ NORMAL - The direction to extrude the vertex when rendering the outline.
Traits§
- Outline
Mesh Ext - Extension methods for
Mesh
.