Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eefd48b
initial bevy_material
atlv24 Aug 27, 2025
1ae51b0
Builds, re-export from bevy_render to minimize diff
Zeophlite Oct 14, 2025
ae9c26b
Setup
Zeophlite Oct 14, 2025
c0688a4
Convert MeshPipelineViewLayouts and MeshPipeline to RenderStartup system
Zeophlite Oct 14, 2025
a5339cf
mesh_pipeline_view_layout_key_from_msaa and mesh_pipeline_view_layout…
Zeophlite Oct 14, 2025
1448bb5
SkinUniforms to RenderStartup
Zeophlite Oct 17, 2025
dd90580
Opaque move
Zeophlite Sep 28, 2025
f747d6f
Move ShaderLabel, DrawFunctionLabel, wgpu exports from render_resourc…
Zeophlite Oct 14, 2025
1bbbe47
Move DrawFunctionId
Zeophlite Oct 14, 2025
471ca19
Move SpecializedMeshPipelineError
Zeophlite Oct 14, 2025
7a38b16
Move MESH_PIPELINE_VIEW_LAYOUT_SAFE_MAX_TEXTURES, MeshPipelineKey
Zeophlite Oct 14, 2025
a73219d
Move MATERIAL_BIND_GROUP_INDEX, ErasedMaterialPipelineKey, ErasedMate…
Zeophlite Oct 14, 2025
12358ac
Move MeshPipelineViewLayout, MeshPipelineViewLayoutKey, MeshPipelineV…
Zeophlite Oct 14, 2025
0da6d52
Move MeshLayouts
Zeophlite Oct 14, 2025
09e03ea
Deprecate get_image_texture for MeshPipeline and Mesh2dPipeline, chan…
Zeophlite Oct 14, 2025
06c1350
Move most of lightmap to bevy_render
Zeophlite Oct 14, 2025
7bb3f00
Move MaterialBindingId, MaterialBindGroupIndex, MaterialBindGroupSlot…
Zeophlite Oct 14, 2025
14f15be
Move MeshTransforms, MeshUniform, MeshInputUniform, MeshFlags, Render…
Zeophlite Oct 14, 2025
efa29b6
Move MAX_JOINTS, MAX_TOTAL_JOINTS, JOINTS_PER_ALLOCATION_UNIT, JOINT_…
Zeophlite Oct 14, 2025
0490cbd
Move util consts
Zeophlite Oct 14, 2025
cdd7be1
Move RenderMeshInstances, RenderMeshInstancesCpu, RenderMeshInstances…
Zeophlite Oct 14, 2025
06ff5cc
Move MaterialProperties and MaterialPipeline to bevy_material
Zeophlite Oct 14, 2025
20de02d
More on migration guide / release notes
Zeophlite Oct 17, 2025
3c10cfb
Move UvChannel to bevy_material
Zeophlite Dec 2, 2025
3cb765c
doc fix
Zeophlite Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ bevy_light = ["bevy_internal/bevy_light"]
# Provides shaders usable through asset handles.
bevy_shader = ["bevy_internal/bevy_shader"]

# Provides materials.
bevy_material = ["bevy_internal/bevy_material"]

# Adds support for gizmos
bevy_gizmos = ["bevy_internal/bevy_gizmos"]

Expand Down
1 change: 1 addition & 0 deletions crates/bevy_core_pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bevy_derive = { path = "../bevy_derive", version = "0.18.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.18.0-dev" }
bevy_image = { path = "../bevy_image", version = "0.18.0-dev" }
bevy_camera = { path = "../bevy_camera", version = "0.18.0-dev" }
bevy_material = { path = "../bevy_material", version = "0.18.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.18.0-dev" }
bevy_shader = { path = "../bevy_shader", version = "0.18.0-dev" }
bevy_render = { path = "../bevy_render", version = "0.18.0-dev" }
Expand Down
7 changes: 5 additions & 2 deletions crates/bevy_core_pipeline/src/core_3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ pub mod graph {
}
}

// PERF: vulkan docs recommend using 24 bit depth for better performance
pub const CORE_3D_DEPTH_FORMAT: TextureFormat = TextureFormat::Depth32Float;
pub use bevy_render::mesh::util::CORE_3D_DEPTH_FORMAT;

/// True if multisampled depth textures are supported on this platform.
///
Expand Down Expand Up @@ -847,6 +846,10 @@ pub fn prepare_core_3d_depth_textures(
}
}

/// A material can specify [`MaterialProperties::reads_view_transmission_texture`](`bevy_material::material::MaterialProperties`) to read from [`ViewTransmissionTexture`].
///
/// This allows taking color output from the [`Opaque3d`] pass as an input, (for screen-space transmission) but requires
/// rendering to take place in a separate [`Transmissive3d`] pass.
#[derive(Component)]
pub struct ViewTransmissionTexture {
pub texture: Texture,
Expand Down
6 changes: 4 additions & 2 deletions crates/bevy_gizmos_render/src/pipeline_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use bevy_ecs::{
system::{Commands, Query, Res, ResMut},
};
use bevy_image::BevyDefault as _;
use bevy_pbr::{MeshPipeline, MeshPipelineKey, SetMeshViewBindGroup};
use bevy_pbr::{init_mesh_pipeline, MeshPipeline, MeshPipelineKey, SetMeshViewBindGroup};
use bevy_render::{
render_asset::{prepare_assets, RenderAssets},
render_phase::{
Expand Down Expand Up @@ -56,7 +56,9 @@ impl Plugin for LineGizmo3dPlugin {
)
.add_systems(
RenderStartup,
init_line_gizmo_pipelines.after(init_line_gizmo_uniform_bind_group_layout),
init_line_gizmo_pipelines
.after(init_line_gizmo_uniform_bind_group_layout)
.after(init_mesh_pipeline),
)
.add_systems(
Render,
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_gltf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bevy_mesh = { path = "../bevy_mesh", version = "0.18.0-dev" }
bevy_pbr = { path = "../bevy_pbr", version = "0.18.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.18.0-dev" }
bevy_render = { path = "../bevy_render", version = "0.18.0-dev" }
bevy_material = { path = "../bevy_material", version = "0.18.0-dev" }
bevy_scene = { path = "../bevy_scene", version = "0.18.0-dev" }
bevy_transform = { path = "../bevy_transform", version = "0.18.0-dev" }
bevy_tasks = { path = "../bevy_tasks", version = "0.18.0-dev" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
crate::loader::gltf_ext::{material::uv_channel, texture::texture_handle_from_info},
bevy_asset::Handle,
bevy_image::Image,
bevy_pbr::UvChannel,
bevy_material::UvChannel,
gltf::json::texture::Info,
serde_json::value,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_json::Value;
#[cfg(feature = "pbr_multi_layer_material_textures")]
use {
crate::loader::gltf_ext::material::parse_material_extension_texture, bevy_asset::Handle,
bevy_image::Image, bevy_pbr::UvChannel,
bevy_image::Image, bevy_material::UvChannel,
};

/// Parsed data from the `KHR_materials_clearcoat` extension.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_json::Value;
#[cfg(feature = "pbr_specular_textures")]
use {
crate::loader::gltf_ext::material::parse_material_extension_texture, bevy_asset::Handle,
bevy_image::Image, bevy_pbr::UvChannel,
bevy_image::Image, bevy_material::UvChannel,
};

/// Parsed data from the `KHR_materials_specular` extension.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_gltf/src/loader/gltf_ext/material.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy_material::UvChannel;
use bevy_math::Affine2;
use bevy_pbr::UvChannel;
use bevy_render::alpha::AlphaMode;

use gltf::{json::texture::Info, Material};
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_gltf/src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ use bevy_image::{
ImageType, TextureError,
};
use bevy_light::{DirectionalLight, PointLight, SpotLight};
#[cfg(feature = "pbr_transmission_textures")]
use bevy_material::UvChannel;
use bevy_math::{Mat4, Vec3};
use bevy_mesh::{
morph::{MeshMorphWeights, MorphAttributes, MorphTargetImage, MorphWeights},
skinning::{SkinnedMesh, SkinnedMeshInverseBindposes},
Indices, Mesh, Mesh3d, MeshVertexAttribute, PrimitiveTopology,
};
#[cfg(feature = "pbr_transmission_textures")]
use bevy_pbr::UvChannel;
use bevy_pbr::{MeshMaterial3d, StandardMaterial, MAX_JOINTS};
use bevy_platform::collections::{HashMap, HashSet};
use bevy_render::render_resource::Face;
Expand Down
12 changes: 11 additions & 1 deletion crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ android-game-activity = ["bevy_winit/android-game-activity"]

# Transmission textures in `StandardMaterial`:
pbr_transmission_textures = [
"bevy_render?/pbr_transmission_textures",
"bevy_pbr?/pbr_transmission_textures",
"bevy_gltf?/pbr_transmission_textures",
]
Expand All @@ -154,27 +155,34 @@ pbr_clustered_decals = ["bevy_pbr?/pbr_clustered_decals"]

# Light Texture support
pbr_light_textures = [
"bevy_render?/pbr_light_textures",
"bevy_pbr?/pbr_clustered_decals",
"bevy_pbr?/pbr_light_textures",
]

# Multi-layer material textures in `StandardMaterial`:
pbr_multi_layer_material_textures = [
"bevy_render?/pbr_multi_layer_material_textures",
"bevy_pbr?/pbr_multi_layer_material_textures",
"bevy_gltf?/pbr_multi_layer_material_textures",
]

# Anisotropy texture in `StandardMaterial`:
pbr_anisotropy_texture = [
"bevy_render?/pbr_anisotropy_texture",
"bevy_pbr?/pbr_anisotropy_texture",
"bevy_gltf?/pbr_anisotropy_texture",
]

# Percentage-closer soft shadows
experimental_pbr_pcss = ["bevy_pbr?/experimental_pbr_pcss"]
experimental_pbr_pcss = [
"bevy_render?/experimental_pbr_pcss",
"bevy_pbr?/experimental_pbr_pcss",
]

# Specular textures in `StandardMaterial`:
pbr_specular_textures = [
"bevy_render?/pbr_specular_textures",
"bevy_pbr?/pbr_specular_textures",
"bevy_gltf?/pbr_specular_textures",
]
Expand Down Expand Up @@ -227,6 +235,7 @@ bevy_window = ["dep:bevy_window", "dep:bevy_a11y", "bevy_image"]
bevy_winit = ["dep:bevy_winit", "bevy_window"]
bevy_camera = ["dep:bevy_camera", "bevy_mesh", "bevy_window"]
bevy_scene = ["dep:bevy_scene", "bevy_asset"]
bevy_material = ["dep:bevy_material", "bevy_image", "bevy_shader"]
bevy_light = ["dep:bevy_light", "bevy_camera", "bevy_gizmos?/bevy_light"]
bevy_render = [
"dep:bevy_render",
Expand Down Expand Up @@ -489,6 +498,7 @@ bevy_gltf = { path = "../bevy_gltf", optional = true, version = "0.18.0-dev" }
bevy_feathers = { path = "../bevy_feathers", optional = true, version = "0.18.0-dev" }
bevy_image = { path = "../bevy_image", optional = true, version = "0.18.0-dev" }
bevy_shader = { path = "../bevy_shader", optional = true, version = "0.18.0-dev" }
bevy_material = { path = "../bevy_material", optional = true, version = "0.18.0-dev" }
bevy_mesh = { path = "../bevy_mesh", optional = true, version = "0.18.0-dev" }
bevy_camera = { path = "../bevy_camera", optional = true, version = "0.18.0-dev" }
bevy_light = { path = "../bevy_light", optional = true, version = "0.18.0-dev" }
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_internal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub use bevy_input_focus as input_focus;
pub use bevy_light as light;
#[cfg(feature = "bevy_log")]
pub use bevy_log as log;
#[cfg(feature = "bevy_material")]
pub use bevy_material as material;
pub use bevy_math as math;
#[cfg(feature = "bevy_mesh")]
pub use bevy_mesh as mesh;
Expand Down
4 changes: 4 additions & 0 deletions crates/bevy_internal/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ pub use crate::camera::prelude::*;
#[cfg(feature = "bevy_shader")]
pub use crate::shader::prelude::*;

#[doc(hidden)]
#[cfg(feature = "bevy_material")]
pub use crate::material::prelude::*;

pub use bevy_derive::{bevy_main, Deref, DerefMut};

#[doc(hidden)]
Expand Down
45 changes: 45 additions & 0 deletions crates/bevy_material/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[package]
name = "bevy_material"
version = "0.18.0-dev"
edition = "2024"
description = "Provides a material abstraction for Bevy Engine"
homepage = "https://bevy.org"
repository = "https://github.com/bevyengine/bevy"
license = "MIT OR Apache-2.0"
keywords = ["bevy"]

[dependencies]
# bevy
bevy_app = { path = "../bevy_app", version = "0.18.0-dev" }
bevy_asset = { path = "../bevy_asset", version = "0.18.0-dev" }
bevy_camera = { path = "../bevy_camera", version = "0.18.0-dev" }
bevy_color = { path = "../bevy_color", version = "0.18.0-dev" }
bevy_derive = { path = "../bevy_derive", version = "0.18.0-dev" }
bevy_utils = { path = "../bevy_utils", version = "0.18.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.18.0-dev" }
bevy_material_macros = { path = "macros", version = "0.18.0-dev" }
bevy_math = { path = "../bevy_math", version = "0.18.0-dev" }
bevy_mesh = { path = "../bevy_mesh", version = "0.18.0-dev" }
bevy_image = { path = "../bevy_image", version = "0.18.0-dev" }
bevy_shader = { path = "../bevy_shader", version = "0.18.0-dev" }
bevy_transform = { path = "../bevy_transform", version = "0.18.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.18.0-dev" }
bevy_platform = { path = "../bevy_platform", version = "0.18.0-dev" }

encase = "0.12"
offset-allocator = "0.2"
tracing = { version = "0.1", default-features = false, features = ["std"] }
thiserror = { version = "2", default-features = false }
wgpu-types = { version = "26", default-features = false }
variadics_please = "1.1"
bitflags = "2"
static_assertions = "1"
nonmax = "0.5"
smallvec = { version = "1", default-features = false }

[lints]
workspace = true

[package.metadata.docs.rs]
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
all-features = true
Loading