Compare commits
No commits in common. "custom" and "release-0.16.1" have entirely different histories.
custom
...
release-0.
@ -756,7 +756,7 @@ unsafe fn CompareSubGroups(mut pg1: *const SSubGroup, mut pg2: *const SSubGroup)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while i < (*pg1).iNrFaces as usize && bStillSame {
|
while i < (*pg1).iNrFaces as usize && bStillSame {
|
||||||
bStillSame = if (&(*pg1).pTriMembers)[i] == (&(*pg2).pTriMembers)[i] {
|
bStillSame = if (*pg1).pTriMembers[i] == (*pg2).pTriMembers[i] {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Reflect)]
|
|
||||||
#[reflect(Default, Clone, PartialEq)]
|
|
||||||
pub enum InterpolationMethod {
|
|
||||||
#[default]
|
|
||||||
Linear,
|
|
||||||
Flat,
|
|
||||||
}
|
|
@ -31,7 +31,6 @@ pub mod decal;
|
|||||||
pub mod deferred;
|
pub mod deferred;
|
||||||
mod extended_material;
|
mod extended_material;
|
||||||
mod fog;
|
mod fog;
|
||||||
mod interpolation;
|
|
||||||
mod light;
|
mod light;
|
||||||
mod light_probe;
|
mod light_probe;
|
||||||
mod lightmap;
|
mod lightmap;
|
||||||
@ -54,7 +53,6 @@ pub use components::*;
|
|||||||
pub use decal::clustered::ClusteredDecalPlugin;
|
pub use decal::clustered::ClusteredDecalPlugin;
|
||||||
pub use extended_material::*;
|
pub use extended_material::*;
|
||||||
pub use fog::*;
|
pub use fog::*;
|
||||||
pub use interpolation::*;
|
|
||||||
pub use light::*;
|
pub use light::*;
|
||||||
pub use light_probe::*;
|
pub use light_probe::*;
|
||||||
pub use lightmap::*;
|
pub use lightmap::*;
|
||||||
|
@ -386,23 +386,6 @@ pub struct StandardMaterial {
|
|||||||
///
|
///
|
||||||
/// [`Mesh::generate_tangents`]: bevy_render::mesh::Mesh::generate_tangents
|
/// [`Mesh::generate_tangents`]: bevy_render::mesh::Mesh::generate_tangents
|
||||||
/// [`Mesh::with_generated_tangents`]: bevy_render::mesh::Mesh::with_generated_tangents
|
/// [`Mesh::with_generated_tangents`]: bevy_render::mesh::Mesh::with_generated_tangents
|
||||||
///
|
|
||||||
/// # Usage
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// # use bevy_asset::{AssetServer, Handle};
|
|
||||||
/// # use bevy_ecs::change_detection::Res;
|
|
||||||
/// # use bevy_image::{Image, ImageLoaderSettings};
|
|
||||||
/// #
|
|
||||||
/// fn load_normal_map(asset_server: Res<AssetServer>) {
|
|
||||||
/// let normal_handle: Handle<Image> = asset_server.load_with_settings(
|
|
||||||
/// "textures/parallax_example/cube_normal.png",
|
|
||||||
/// // The normal map texture is in linear color space. Lighting won't look correct
|
|
||||||
/// // if `is_srgb` is `true`, which is the default.
|
|
||||||
/// |settings: &mut ImageLoaderSettings| settings.is_srgb = false,
|
|
||||||
/// );
|
|
||||||
/// }
|
|
||||||
/// ```
|
|
||||||
#[texture(9)]
|
#[texture(9)]
|
||||||
#[sampler(10)]
|
#[sampler(10)]
|
||||||
#[dependency]
|
#[dependency]
|
||||||
@ -769,8 +752,6 @@ pub struct StandardMaterial {
|
|||||||
|
|
||||||
/// The transform applied to the UVs corresponding to `ATTRIBUTE_UV_0` on the mesh before sampling. Default is identity.
|
/// The transform applied to the UVs corresponding to `ATTRIBUTE_UV_0` on the mesh before sampling. Default is identity.
|
||||||
pub uv_transform: Affine2,
|
pub uv_transform: Affine2,
|
||||||
|
|
||||||
pub interpolation_method: InterpolationMethod,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StandardMaterial {
|
impl StandardMaterial {
|
||||||
@ -926,7 +907,6 @@ impl Default for StandardMaterial {
|
|||||||
opaque_render_method: OpaqueRendererMethod::Auto,
|
opaque_render_method: OpaqueRendererMethod::Auto,
|
||||||
deferred_lighting_pass_id: DEFAULT_PBR_DEFERRED_LIGHTING_PASS_ID,
|
deferred_lighting_pass_id: DEFAULT_PBR_DEFERRED_LIGHTING_PASS_ID,
|
||||||
uv_transform: Affine2::IDENTITY,
|
uv_transform: Affine2::IDENTITY,
|
||||||
interpolation_method: InterpolationMethod::Linear,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1230,7 +1210,6 @@ bitflags! {
|
|||||||
const CLEARCOAT_NORMAL_UV = 0x100000;
|
const CLEARCOAT_NORMAL_UV = 0x100000;
|
||||||
const SPECULAR_UV = 0x200000;
|
const SPECULAR_UV = 0x200000;
|
||||||
const SPECULAR_TINT_UV = 0x400000;
|
const SPECULAR_TINT_UV = 0x400000;
|
||||||
const FLAT_INTERPOLATION = 0x800000;
|
|
||||||
const DEPTH_BIAS = 0xffffffff_00000000;
|
const DEPTH_BIAS = 0xffffffff_00000000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1355,17 +1334,11 @@ impl From<&StandardMaterial> for StandardMaterialKey {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
key.set(
|
|
||||||
StandardMaterialKey::FLAT_INTERPOLATION,
|
|
||||||
material.interpolation_method == InterpolationMethod::Flat,
|
|
||||||
);
|
|
||||||
|
|
||||||
key.insert(StandardMaterialKey::from_bits_retain(
|
key.insert(StandardMaterialKey::from_bits_retain(
|
||||||
// Casting to i32 first to ensure the full i32 range is preserved.
|
// Casting to i32 first to ensure the full i32 range is preserved.
|
||||||
// (wgpu expects the depth_bias as an i32 when this is extracted in a later step)
|
// (wgpu expects the depth_bias as an i32 when this is extracted in a later step)
|
||||||
(material.depth_bias as i32 as u64) << STANDARD_MATERIAL_KEY_DEPTH_BIAS_SHIFT,
|
(material.depth_bias as i32 as u64) << STANDARD_MATERIAL_KEY_DEPTH_BIAS_SHIFT,
|
||||||
));
|
));
|
||||||
|
|
||||||
key
|
key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1526,14 +1499,9 @@ impl Material for StandardMaterial {
|
|||||||
StandardMaterialKey::SPECULAR_TINT_UV,
|
StandardMaterialKey::SPECULAR_TINT_UV,
|
||||||
"STANDARD_MATERIAL_SPECULAR_TINT_UV_B",
|
"STANDARD_MATERIAL_SPECULAR_TINT_UV_B",
|
||||||
),
|
),
|
||||||
(
|
|
||||||
StandardMaterialKey::FLAT_INTERPOLATION,
|
|
||||||
"STANDARD_MATERIAL_FLAT_INTERPOLATION",
|
|
||||||
),
|
|
||||||
] {
|
] {
|
||||||
if key.bind_group_data.intersects(flags) {
|
if key.bind_group_data.intersects(flags) {
|
||||||
shader_defs.push(shader_def.into());
|
shader_defs.push(shader_def.into());
|
||||||
descriptor.vertex.shader_defs.push(shader_def.into());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1556,7 +1524,6 @@ impl Material for StandardMaterial {
|
|||||||
depth_stencil.bias.constant =
|
depth_stencil.bias.constant =
|
||||||
(key.bind_group_data.bits() >> STANDARD_MATERIAL_KEY_DEPTH_BIAS_SHIFT) as i32;
|
(key.bind_group_data.bits() >> STANDARD_MATERIAL_KEY_DEPTH_BIAS_SHIFT) as i32;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,7 @@ struct VertexOutput {
|
|||||||
// and `frag coord` when used as a fragment stage input
|
// and `frag coord` when used as a fragment stage input
|
||||||
@builtin(position) position: vec4<f32>,
|
@builtin(position) position: vec4<f32>,
|
||||||
@location(0) world_position: vec4<f32>,
|
@location(0) world_position: vec4<f32>,
|
||||||
#ifdef STANDARD_MATERIAL_FLAT_INTERPOLATION
|
|
||||||
@location(1) @interpolate(flat) world_normal: vec3<f32>,
|
|
||||||
#else
|
|
||||||
@location(1) world_normal: vec3<f32>,
|
@location(1) world_normal: vec3<f32>,
|
||||||
#endif
|
|
||||||
#ifdef VERTEX_UVS_A
|
#ifdef VERTEX_UVS_A
|
||||||
@location(2) uv: vec2<f32>,
|
@location(2) uv: vec2<f32>,
|
||||||
#endif
|
#endif
|
||||||
@ -49,12 +45,8 @@ struct VertexOutput {
|
|||||||
@location(4) world_tangent: vec4<f32>,
|
@location(4) world_tangent: vec4<f32>,
|
||||||
#endif
|
#endif
|
||||||
#ifdef VERTEX_COLORS
|
#ifdef VERTEX_COLORS
|
||||||
#ifdef STANDARD_MATERIAL_FLAT_INTERPOLATION
|
|
||||||
@location(5) @interpolate(flat) color: vec4<f32>,
|
|
||||||
#else
|
|
||||||
@location(5) color: vec4<f32>,
|
@location(5) color: vec4<f32>,
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#ifdef VERTEX_OUTPUT_INSTANCE_INDEX
|
#ifdef VERTEX_OUTPUT_INSTANCE_INDEX
|
||||||
@location(6) @interpolate(flat) instance_index: u32,
|
@location(6) @interpolate(flat) instance_index: u32,
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
[toolchain]
|
|
||||||
channel = "nightly"
|
|
Loading…
Reference in New Issue
Block a user