Update to 0.14 + Add 0BSD option
This commit is contained in:
parent
347594e421
commit
56aee7bc7c
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bevy_dither_post_process"
|
name = "bevy_dither_post_process"
|
||||||
version = "0.1.4"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies.bevy]
|
[dependencies.bevy]
|
||||||
version = "0.13"
|
version = "0.14"
|
||||||
|
5
LICENSE-0BSD
Normal file
5
LICENSE-0BSD
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Copyright (C) 2024 by Silas Bartha silas@exvacuum.dev
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
README.md
14
README.md
@ -1,6 +1,7 @@
|
|||||||
# bevy_dither_post_process
|
# bevy_dither_post_process
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||

|

|
||||||

|

|
||||||
[](https://exvacuum.github.io/bevy_dither_post_process)
|
[](https://exvacuum.github.io/bevy_dither_post_process)
|
||||||
@ -20,10 +21,17 @@ bevy_dither_post_process::components::DitherPostProcessSettings::new(3, &asset_s
|
|||||||
|
|
||||||
| Crate Version | Bevy Version |
|
| Crate Version | Bevy Version |
|
||||||
|--- |--- |
|
|--- |--- |
|
||||||
|
| 0.2 | 0.14 |
|
||||||
| 0.1 | 0.13 |
|
| 0.1 | 0.13 |
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
### crates.io
|
||||||
|
```toml
|
||||||
|
[dependencies]
|
||||||
|
bevy_dither_post_process = "0.2"
|
||||||
|
```
|
||||||
|
|
||||||
### Using git URL in Cargo.toml
|
### Using git URL in Cargo.toml
|
||||||
```toml
|
```toml
|
||||||
[dependencies.bevy_dither_post_process]
|
[dependencies.bevy_dither_post_process]
|
||||||
@ -57,3 +65,7 @@ commands.spawn((
|
|||||||
|
|
||||||
This effect will only run for cameras which contain this component.
|
This effect will only run for cameras which contain this component.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This crate is licensed under your choice of 0BSD, Apache-2.0, or MIT license.
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ impl Plugin for DitherPostProcessPlugin {
|
|||||||
|
|
||||||
app.add_plugins((ExtractComponentPlugin::<DitherPostProcessSettings>::default(),));
|
app.add_plugins((ExtractComponentPlugin::<DitherPostProcessSettings>::default(),));
|
||||||
|
|
||||||
let Ok(render_app) = app.get_sub_app_mut(RenderApp) else {
|
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ impl Plugin for DitherPostProcessPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn finish(&self, app: &mut App) {
|
fn finish(&self, app: &mut App) {
|
||||||
let Ok(render_app) = app.get_sub_app_mut(RenderApp) else {
|
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
12
src/nodes.rs
12
src/nodes.rs
@ -2,14 +2,10 @@ use bevy::{
|
|||||||
ecs::query::QueryItem,
|
ecs::query::QueryItem,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
render::{
|
render::{
|
||||||
render_asset::RenderAssets,
|
render_asset::RenderAssets, render_graph::{NodeRunError, RenderGraphContext, RenderLabel, ViewNode}, render_resource::{
|
||||||
render_graph::{NodeRunError, RenderGraphContext, RenderLabel, ViewNode},
|
|
||||||
render_resource::{
|
|
||||||
BindGroupEntries, Operations, PipelineCache, RenderPassColorAttachment,
|
BindGroupEntries, Operations, PipelineCache, RenderPassColorAttachment,
|
||||||
RenderPassDescriptor,
|
RenderPassDescriptor,
|
||||||
},
|
}, renderer::RenderContext, texture::GpuImage, view::ViewTarget
|
||||||
renderer::RenderContext,
|
|
||||||
view::ViewTarget,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -46,8 +42,8 @@ impl ViewNode for DitherRenderNode {
|
|||||||
let post_process = view_target.post_process_write();
|
let post_process = view_target.post_process_write();
|
||||||
|
|
||||||
let Some(threshold_map) = world
|
let Some(threshold_map) = world
|
||||||
.resource::<RenderAssets<Image>>()
|
.resource::<RenderAssets<GpuImage>>()
|
||||||
.get(dither_post_process_settings.handle())
|
.get(dither_post_process_settings.handle().id())
|
||||||
else {
|
else {
|
||||||
warn!("Failed to get threshold map, skipping...");
|
warn!("Failed to get threshold map, skipping...");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user