From 8f15162b4847ea30316f33fe3a7f0c20822fe926 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Tue, 4 Jun 2024 14:32:59 -0400 Subject: Renamed + Added Docs --- src/components.rs | 5 +++++ src/lib.rs | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components.rs b/src/components.rs index cc6c471..49f4684 100644 --- a/src/components.rs +++ b/src/components.rs @@ -3,8 +3,13 @@ use bevy::{ render::{extract_component::ExtractComponent, render_resource::ShaderType}, }; +/// Component which, when inserted into an entity with a camera and normal prepass, enables an outline effect for that +/// camera. #[derive(Component, ShaderType, ExtractComponent, PartialEq, Clone, Default)] pub struct OutlinePostProcessSettings { + /// Weight of outlines in pixels. pub weight: f32, + /// A threshold for normal differences, values below this threshold will not become outlines. + /// Higher values will result in more outlines which may look better on smooth surfaces. pub threshold: f32, } diff --git a/src/lib.rs b/src/lib.rs index 144dfe8..dd0b9ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,9 @@ #![warn(missing_docs)] +//! A plugin for the Bevy game engine which provides an outline post-process effect. The effect +//! makes use of a normal prepass to generate outlines where differences in the normal buffer +//! occur. + use bevy::{ asset::embedded_asset, core_pipeline::core_3d::graph::{Core3d, Node3d}, @@ -13,12 +17,14 @@ use bevy::{ pub use nodes::OutlineRenderLabel; -pub struct OutlinePostProcessPlugin; - +/// Components used by this plugin. pub mod components; mod nodes; mod resources; +/// Plugin which provides an outline post-processing effect. +pub struct OutlinePostProcessPlugin; + impl Plugin for OutlinePostProcessPlugin { fn build(&self, app: &mut App) { embedded_asset!(app, "../assets/shaders/outline_post_process.wgsl"); -- cgit v1.2.3