Skip to content

Commit

Permalink
Merge pull request #46 from MrGVSV/v0.11.0
Browse files Browse the repository at this point in the history
Bump version: 0.10.0 -> 0.11.0
  • Loading branch information
MrGVSV authored Jul 29, 2023
2 parents 5e721b6 + 1c5cf1e commit 37a72d7
Show file tree
Hide file tree
Showing 19 changed files with 110 additions and 815 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_proto"
version = "0.10.0"
version = "0.11.0"
edition = "2021"
authors = ["Gino Valente <gino.valente.code@gmail.com>"]
description = "Create config files for entities in Bevy"
Expand Down Expand Up @@ -99,7 +99,7 @@ bevy_ui = [
]

[dependencies]
bevy_proto_backend = { version = "0.3", path = "./bevy_proto_backend", default-features = false }
bevy_proto_backend = { version = "0.4", path = "./bevy_proto_backend", default-features = false }
bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] }
anyhow = "1.0"
serde = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This crate can be used for:
Add the following to your `[dependencies]` section in `Cargo.toml`:
```rust
bevy_proto = "0.10"
bevy_proto = "0.11"
```
Or use `cargo add`:
Expand All @@ -96,6 +96,7 @@ using the crate.

| bevy | bevy_proto |
|--------|------------|
| 0.11.0 | 0.11.0 |
| 0.10.1 | 0.10.0 |

For previous versions of this crate, see the [Previous Versions](#-previous-versions) section below.
Expand Down
4 changes: 2 additions & 2 deletions bevy_proto_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_proto_backend"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
authors = ["Gino Valente <gino.valente.code@gmail.com>"]
description = "Backend crate for bevy_proto"
Expand Down Expand Up @@ -62,7 +62,7 @@ bevy_ui = [
]

[dependencies]
bevy_proto_derive = { version = "0.5", path = "../bevy_proto_derive" }
bevy_proto_derive = { version = "0.6", path = "../bevy_proto_derive" }
bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] }
anyhow = "1.0"
serde = "1.0"
Expand Down
127 changes: 9 additions & 118 deletions bevy_proto_backend/src/impls/bevy_impls/core_pipeline.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use bevy::app::App;
use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomPrefilterSettings, BloomSettings};
use bevy::core_pipeline::bloom::BloomSettings;
use bevy::core_pipeline::clear_color::ClearColorConfig;
use bevy::core_pipeline::core_3d::{Camera3dDepthLoadOp, Camera3dDepthTextureUsage};
use bevy::core_pipeline::fxaa::Fxaa;
use bevy::core_pipeline::prepass::{DepthPrepass, NormalPrepass};
use bevy::core_pipeline::tonemapping::{DebandDither, Tonemapping};
use bevy::prelude::{Camera2d, Camera3d, Color};
use bevy::prelude::{Camera2d, Camera3d};
use bevy::reflect::{std_traits::ReflectDefault, Reflect};

use crate::impls::macros::{from_to, from_to_default, register_schematic};
use crate::impls::macros::{from_to_default, register_schematic};
use bevy_proto_derive::impl_external_schematic;

pub(super) fn register(app: &mut App) {
Expand All @@ -23,69 +23,10 @@ pub(super) fn register(app: &mut App) {
NormalPrepass,
Tonemapping
);

// Can be removed if https://github.com/bevyengine/bevy/pull/5781 is ever merged
app.register_type::<BloomPrefilterSettingsInput>()
.register_type::<BloomCompositeModeInput>()
.register_type::<ClearColorConfigInput>()
.register_type::<Camera3dDepthLoadOpInput>();
}

impl_external_schematic! {
#[schematic(from = BloomSettingsInput)]
struct BloomSettings {}
// ---
#[derive(Reflect)]
#[reflect(Default)]
pub struct BloomSettingsInput {
pub intensity: f32,
pub low_frequency_boost: f32,
pub low_frequency_boost_curvature: f32,
pub high_pass_frequency: f32,
pub prefilter_settings: BloomPrefilterSettingsInput,
pub composite_mode: BloomCompositeModeInput,
}
from_to_default!(
BloomSettings,
BloomSettingsInput,
|value: Input| Self {
intensity: value.intensity,
low_frequency_boost: value.low_frequency_boost,
low_frequency_boost_curvature: value.low_frequency_boost_curvature,
high_pass_frequency: value.high_pass_frequency,
prefilter_settings: value.prefilter_settings.into(),
composite_mode: value.composite_mode.into(),
}
);

#[derive(Reflect)]
#[reflect(Default)]
pub struct BloomPrefilterSettingsInput {
pub threshold: f32,
pub threshold_softness: f32,
}
from_to_default!(
BloomPrefilterSettings,
BloomPrefilterSettingsInput,
|value: Input| Self {
threshold: value.threshold,
threshold_softness: value.threshold_softness,
}
);

#[derive(Reflect)]
pub enum BloomCompositeModeInput {
EnergyConserving,
Additive,
}
from_to!(
BloomCompositeMode,
BloomCompositeModeInput,
|value| match value {
Input::EnergyConserving => Self::EnergyConserving,
Input::Additive => Self::Additive,
}
);
}

impl_external_schematic! {
Expand All @@ -95,13 +36,13 @@ impl_external_schematic! {
#[derive(Reflect)]
#[reflect(Default)]
pub struct Camera2dInput {
pub clear_color: ClearColorConfigInput,
pub clear_color: ClearColorConfig,
}
from_to_default!(
Camera2d,
Camera2dInput,
|value: Input| Self {
clear_color: value.clear_color.into(),
clear_color: value.clear_color,
}
);
}
Expand All @@ -113,32 +54,17 @@ impl_external_schematic! {
#[derive(Reflect)]
#[reflect(Default)]
pub struct Camera3dInput {
pub clear_color: ClearColorConfigInput,
pub depth_load_op: Camera3dDepthLoadOpInput,
pub clear_color: ClearColorConfig,
pub depth_load_op: Camera3dDepthLoadOp,
pub depth_texture_usages: Camera3dDepthTextureUsage,
}
from_to_default!(
Camera3d,
Camera3dInput,
|value: Input| Self {
clear_color: value.clear_color,
depth_load_op: value.depth_load_op,
depth_texture_usages: value.depth_texture_usages,
clear_color: value.clear_color.into(),
depth_load_op: value.depth_load_op.into()
}
);

#[derive(Reflect)]
#[reflect(Default)]
pub enum Camera3dDepthLoadOpInput {
Clear(f32),
Load,
}
from_to_default!(
Camera3dDepthLoadOp,
Camera3dDepthLoadOpInput,
|value: Input| match value {
Input::Clear(value) => Self::Clear(value),
Input::Load => Self::Load,
}
);
}
Expand All @@ -148,52 +74,17 @@ impl_external_schematic! {
}

impl_external_schematic! {
#[schematic(from = DepthPrepassInput)]
struct DepthPrepass {}
// ---
#[derive(Reflect)]
pub struct DepthPrepassInput;
impl From<DepthPrepassInput> for DepthPrepass {
fn from(_: DepthPrepassInput) -> Self {
Self
}
}
}

impl_external_schematic! {
struct Fxaa {}
}

impl_external_schematic! {
#[schematic(from = NormalPrepassInput)]
struct NormalPrepass {}
// ---
#[derive(Reflect)]
pub struct NormalPrepassInput;
impl From<NormalPrepassInput> for NormalPrepass {
fn from(_: NormalPrepassInput) -> Self {
Self
}
}
}

impl_external_schematic! {
enum Tonemapping {}
}

#[derive(Reflect)]
#[reflect(Default)]
pub enum ClearColorConfigInput {
Default,
Custom(Color),
None,
}
from_to_default!(
ClearColorConfig,
ClearColorConfigInput,
|value| match value {
Input::Default => Self::Default,
Input::Custom(color) => Self::Custom(color),
Input::None => Self::None,
}
);
16 changes: 1 addition & 15 deletions bevy_proto_backend/src/impls/bevy_impls/gltf.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
use bevy::app::App;
use bevy::gltf::GltfExtras;
use bevy::reflect::Reflect;

use crate::impls::macros::{from_to_default, register_schematic};
use crate::impls::macros::register_schematic;
use bevy_proto_derive::impl_external_schematic;

pub(super) fn register(app: &mut App) {
register_schematic!(app, GltfExtras);
}

impl_external_schematic! {
#[schematic(from = GltfExtrasInput)]
struct GltfExtras {}
// ---
#[derive(Reflect)]
pub struct GltfExtrasInput{
pub value: String,
}
from_to_default!(
GltfExtras,
GltfExtrasInput,
|value: Input| Self {
value: value.value,
}
);
}
Loading

0 comments on commit 37a72d7

Please sign in to comment.