Skip to content

Commit

Permalink
Renamed + Added Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
exvacuum committed Jun 4, 2024
1 parent 19449be commit 8f15162
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docs
on:
push:
branches: [master]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: deploy
cancel-in-progress: false
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Setup pages
id: pages
uses: actions/configure-pages@v4
- name: Clean docs folder
run: cargo clean --doc
- name: Build docs
run: cargo doc --no-deps
- name: Add redirect
run: echo '<meta http-equiv="refresh" content="0;url=bevy_dither_post_process/index.html">' > target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 24 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Rust

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Note: This is a full-screen post process effect and cannot be enabled/disabled f
![](./doc/screenshot_smooth.png)
Configuration Used:
```rs
grex_outline_post_process::components::OutlinePostProcessSettings {
bevy_outline_post_process::components::OutlinePostProcessSettings {
weight: 2.0,
threshold: 0.0,
}
Expand Down
5 changes: 5 additions & 0 deletions src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand All @@ -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");
Expand Down

0 comments on commit 8f15162

Please sign in to comment.