Crate bevy_mod_outline

Source
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§

bundlesDeprecated
Legacy bundles.

Structs§

AsyncSceneInheritOutline
Automatically inherits outlines for the entities in a scene.
AutoGenerateOutlineNormalsPlugin
Automatically runs generate_outline_normals on every mesh.
ComputedOutline
A component for storing the computed depth at which the outline lies.
GenerateOutlineNormalsSettings
Settings for generating mesh outline normals.
InheritOutline
A component for inheriting outlines from the parent entity.
OutlineAlphaMask
A component for specifying an alpha mask texture.
OutlinePlaneDepth
A component which controls the depth sorting of flat outlines and stencils.
OutlinePlugin
Adds support for rendering outlines.
OutlineRenderLayers
A component for specifying what layer(s) the outline should be rendered for.
OutlineStencil
A component for stenciling meshes during outline rendering.
OutlineVolume
A component for rendering outlines around meshes.

Enums§

GenerateOutlineNormalsError
Failed to generate outline normals for the mesh.
NodeOutline
Labels for render graph nodes which draw outlines.
OutlineMode
A component which specifies how the outline should be rendered.
TextureChannel
The channel of a texture.

Constants§

ATTRIBUTE_OUTLINE_NORMAL
The direction to extrude the vertex when rendering the outline.

Traits§

OutlineMeshExt
Extension methods for Mesh.