Compare commits
6 Commits
custom
...
release-0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b995b4662a | ||
![]() |
2fa7b3b6d0 | ||
![]() |
a7ece4ce85 | ||
![]() |
b3ab4fc2b3 | ||
![]() |
12daeebf83 | ||
![]() |
52ccd768c5 |
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
categories = ["game-engines", "graphics", "gui", "rendering"]
|
||||
description = "A refreshingly simple data-driven game engine and app framework"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_animation"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides animation functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_app"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides core App functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_asset"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides asset functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_audio"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides audio functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_core"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides core functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_core_pipeline"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
authors = [
|
||||
"Bevy Contributors <bevyengine@gmail.com>",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_derive"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides derive implementations for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_diagnostic"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides diagnostic functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_dylib"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Force the Bevy Engine to be dynamically linked for faster linking"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_dynamic_plugin"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides dynamic plugin loading capabilities for non-wasm platforms"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_ecs"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Bevy Engine's entity component system"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_ecs_macros"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
description = "Bevy ECS Macros"
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_encase_derive"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Bevy derive macro for encase"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_gilrs"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Gamepad system made using Gilrs for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_gltf"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Bevy Engine GLTF loading"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_hierarchy"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides hierarchy functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_input"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides input functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_internal"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "An internal Bevy crate used to facilitate optional dynamic linking via the 'dynamic' feature"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_log"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides logging for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_macro_utils"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "A collection of utils for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_math"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides math functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_mikktspace"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
authors = ["Benjamin Wasty <benny.wasty@gmail.com>", "David Harvey-Macaulay <alteous@outlook.com>", "Layl Bongers <LaylConway@users.noreply.github.com>"]
|
||||
description = "Mikkelsen tangent space algorithm"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_pbr"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Adds PBR rendering to Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -9,7 +9,7 @@ use bevy_ecs::{
|
||||
prelude::*,
|
||||
system::{lifetimeless::*, SystemParamItem, SystemState},
|
||||
};
|
||||
use bevy_math::{Mat4, Vec2};
|
||||
use bevy_math::{Mat3A, Mat4, Vec2};
|
||||
use bevy_reflect::TypeUuid;
|
||||
use bevy_render::{
|
||||
extract_component::{ComponentUniforms, DynamicUniformIndex, UniformComponentPlugin},
|
||||
@ -117,6 +117,9 @@ bitflags::bitflags! {
|
||||
#[repr(transparent)]
|
||||
struct MeshFlags: u32 {
|
||||
const SHADOW_RECEIVER = (1 << 0);
|
||||
// Indicates the sign of the determinant of the 3x3 model matrix. If the sign is positive,
|
||||
// then the flag should be set, else it should not be set.
|
||||
const SIGN_DETERMINANT_MODEL_3X3 = (1 << 31);
|
||||
const NONE = 0;
|
||||
const UNINITIALIZED = 0xFFFF;
|
||||
}
|
||||
@ -143,13 +146,16 @@ pub fn extract_meshes(
|
||||
|
||||
for (entity, _, transform, handle, not_receiver, not_caster) in visible_meshes {
|
||||
let transform = transform.compute_matrix();
|
||||
let shadow_receiver_flags = if not_receiver.is_some() {
|
||||
MeshFlags::empty().bits
|
||||
let mut flags = if not_receiver.is_some() {
|
||||
MeshFlags::empty()
|
||||
} else {
|
||||
MeshFlags::SHADOW_RECEIVER.bits
|
||||
MeshFlags::SHADOW_RECEIVER
|
||||
};
|
||||
if Mat3A::from_mat4(transform).determinant().is_sign_positive() {
|
||||
flags |= MeshFlags::SIGN_DETERMINANT_MODEL_3X3;
|
||||
}
|
||||
let uniform = MeshUniform {
|
||||
flags: shadow_receiver_flags,
|
||||
flags: flags.bits,
|
||||
transform,
|
||||
inverse_transpose_model: transform.inverse().transpose(),
|
||||
};
|
||||
|
@ -17,20 +17,47 @@ fn mesh_position_local_to_clip(model: mat4x4<f32>, vertex_position: vec4<f32>) -
|
||||
}
|
||||
|
||||
fn mesh_normal_local_to_world(vertex_normal: vec3<f32>) -> vec3<f32> {
|
||||
return mat3x3<f32>(
|
||||
mesh.inverse_transpose_model[0].xyz,
|
||||
mesh.inverse_transpose_model[1].xyz,
|
||||
mesh.inverse_transpose_model[2].xyz
|
||||
) * vertex_normal;
|
||||
// NOTE: The mikktspace method of normal mapping requires that the world normal is
|
||||
// re-normalized in the vertex shader to match the way mikktspace bakes vertex tangents
|
||||
// and normal maps so that the exact inverse process is applied when shading. Blender, Unity,
|
||||
// Unreal Engine, Godot, and more all use the mikktspace method. Do not change this code
|
||||
// unless you really know what you are doing.
|
||||
// http://www.mikktspace.com/
|
||||
return normalize(
|
||||
mat3x3<f32>(
|
||||
mesh.inverse_transpose_model[0].xyz,
|
||||
mesh.inverse_transpose_model[1].xyz,
|
||||
mesh.inverse_transpose_model[2].xyz
|
||||
) * vertex_normal
|
||||
);
|
||||
}
|
||||
|
||||
// Calculates the sign of the determinant of the 3x3 model matrix based on a
|
||||
// mesh flag
|
||||
fn sign_determinant_model_3x3() -> f32 {
|
||||
// bool(u32) is false if 0u else true
|
||||
// f32(bool) is 1.0 if true else 0.0
|
||||
// * 2.0 - 1.0 remaps 0.0 or 1.0 to -1.0 or 1.0 respectively
|
||||
return f32(bool(mesh.flags & MESH_FLAGS_SIGN_DETERMINANT_MODEL_3X3_BIT)) * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
fn mesh_tangent_local_to_world(model: mat4x4<f32>, vertex_tangent: vec4<f32>) -> vec4<f32> {
|
||||
// NOTE: The mikktspace method of normal mapping requires that the world tangent is
|
||||
// re-normalized in the vertex shader to match the way mikktspace bakes vertex tangents
|
||||
// and normal maps so that the exact inverse process is applied when shading. Blender, Unity,
|
||||
// Unreal Engine, Godot, and more all use the mikktspace method. Do not change this code
|
||||
// unless you really know what you are doing.
|
||||
// http://www.mikktspace.com/
|
||||
return vec4<f32>(
|
||||
mat3x3<f32>(
|
||||
model[0].xyz,
|
||||
model[1].xyz,
|
||||
model[2].xyz
|
||||
) * vertex_tangent.xyz,
|
||||
vertex_tangent.w
|
||||
normalize(
|
||||
mat3x3<f32>(
|
||||
model[0].xyz,
|
||||
model[1].xyz,
|
||||
model[2].xyz
|
||||
) * vertex_tangent.xyz
|
||||
),
|
||||
// NOTE: Multiplying by the sign of the determinant of the 3x3 model matrix accounts for
|
||||
// situations such as negative scaling.
|
||||
vertex_tangent.w * sign_determinant_model_3x3()
|
||||
);
|
||||
}
|
||||
|
@ -14,3 +14,5 @@ struct SkinnedMesh {
|
||||
#endif
|
||||
|
||||
let MESH_FLAGS_SHADOW_RECEIVER_BIT: u32 = 1u;
|
||||
// 2^31 - if the flag is set, the sign is positive, else it is negative
|
||||
let MESH_FLAGS_SIGN_DETERMINANT_MODEL_3X3_BIT: u32 = 2147483648u;
|
||||
|
@ -15,7 +15,13 @@ fn prepare_normal(
|
||||
#endif
|
||||
is_front: bool,
|
||||
) -> vec3<f32> {
|
||||
var N: vec3<f32> = normalize(world_normal);
|
||||
// NOTE: The mikktspace method of normal mapping explicitly requires that the world normal NOT
|
||||
// be re-normalized in the fragment shader. This is primarily to match the way mikktspace
|
||||
// bakes vertex tangents and normal maps so that this is the exact inverse. Blender, Unity,
|
||||
// Unreal Engine, Godot, and more all use the mikktspace method. Do not change this code
|
||||
// unless you really know what you are doing.
|
||||
// http://www.mikktspace.com/
|
||||
var N: vec3<f32> = world_normal;
|
||||
|
||||
#ifdef VERTEX_TANGENTS
|
||||
#ifdef STANDARDMATERIAL_NORMAL_MAP
|
||||
@ -236,7 +242,7 @@ fn pbr(
|
||||
fn tone_mapping(in: vec4<f32>) -> vec4<f32> {
|
||||
// tone_mapping
|
||||
return vec4<f32>(reinhard_luminance(in.rgb), in.a);
|
||||
|
||||
|
||||
// Gamma correction.
|
||||
// Not needed with sRGB buffer
|
||||
// output_color.rgb = pow(output_color.rgb, vec3(1.0 / 2.2));
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_ptr"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Utilities for working with untyped pointers in a more safe way"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_reflect"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Dynamically interact with rust types"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_reflect_derive"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Derive implementations for bevy_reflect"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_render"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides rendering functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_render_macros"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Derive implementations for bevy_render"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_scene"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides scene functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_sprite"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides sprite functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
struct View {
|
||||
view_proj: mat4x4<f32>,
|
||||
inverse_view_proj: mat4x4<f32>,
|
||||
view: mat4x4<f32>,
|
||||
inverse_view: mat4x4<f32>,
|
||||
projection: mat4x4<f32>,
|
||||
inverse_projection: mat4x4<f32>,
|
||||
world_position: vec3<f32>,
|
||||
width: f32,
|
||||
height: f32,
|
||||
|
@ -1,6 +1,13 @@
|
||||
struct View {
|
||||
view_proj: mat4x4<f32>,
|
||||
inverse_view_proj: mat4x4<f32>,
|
||||
view: mat4x4<f32>,
|
||||
inverse_view: mat4x4<f32>,
|
||||
projection: mat4x4<f32>,
|
||||
inverse_projection: mat4x4<f32>,
|
||||
world_position: vec3<f32>,
|
||||
width: f32,
|
||||
height: f32,
|
||||
};
|
||||
@group(0) @binding(0)
|
||||
var<uniform> view: View;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_tasks"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "A task executor for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_text"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides text functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_time"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides time functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_transform"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides transform functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_ui"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "A custom ECS-driven UI framework built specifically for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,13 @@
|
||||
struct View {
|
||||
view_proj: mat4x4<f32>,
|
||||
inverse_view_proj: mat4x4<f32>,
|
||||
view: mat4x4<f32>,
|
||||
inverse_view: mat4x4<f32>,
|
||||
projection: mat4x4<f32>,
|
||||
inverse_projection: mat4x4<f32>,
|
||||
world_position: vec3<f32>,
|
||||
width: f32,
|
||||
height: f32,
|
||||
};
|
||||
@group(0) @binding(0)
|
||||
var<uniform> view: View;
|
||||
@ -22,7 +29,7 @@ fn vertex(
|
||||
out.position = view.view_proj * vec4<f32>(vertex_position, 1.0);
|
||||
out.color = vertex_color;
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
@group(1) @binding(0)
|
||||
var sprite_texture: texture_2d<f32>;
|
||||
@ -31,7 +38,7 @@ var sprite_sampler: sampler;
|
||||
|
||||
@fragment
|
||||
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
var color = textureSample(sprite_texture, sprite_sampler, in.uv);
|
||||
var color = textureSample(sprite_texture, sprite_sampler, in.uv);
|
||||
color = in.color * color;
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_utils"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "A collection of utils for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_window"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "Provides windowing functionality for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
@ -22,7 +22,10 @@ pub mod prelude {
|
||||
}
|
||||
|
||||
use bevy_app::prelude::*;
|
||||
use bevy_ecs::{event::Events, schedule::SystemLabel};
|
||||
use bevy_ecs::{
|
||||
event::Events,
|
||||
schedule::{ParallelSystemDescriptorCoercion, SystemLabel},
|
||||
};
|
||||
|
||||
/// The configuration information for the [`WindowPlugin`].
|
||||
///
|
||||
@ -106,7 +109,10 @@ impl Plugin for WindowPlugin {
|
||||
}
|
||||
|
||||
if settings.exit_on_all_closed {
|
||||
app.add_system(exit_on_all_closed);
|
||||
app.add_system_to_stage(
|
||||
CoreStage::PostUpdate,
|
||||
exit_on_all_closed.after(ModifiesWindows),
|
||||
);
|
||||
}
|
||||
if settings.close_when_requested {
|
||||
app.add_system(close_when_requested);
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_winit"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
edition = "2021"
|
||||
description = "A winit window and input backend for Bevy Engine"
|
||||
homepage = "https://bevyengine.org"
|
||||
|
Loading…
Reference in New Issue
Block a user