Skip to content

Conversation

Zeophlite
Copy link
Owner

@Zeophlite Zeophlite commented Oct 12, 2025

Objective

Solution

  • Move stuff, mainly look at these 3 crates:
    • from bevy_pbr to bevy_material
    • from bevy_render to bevy_material
    • from bevy_pbr to bevy_render
  • Some things are broken on purpose (see comments)

Testing

  • Builds

@github-actions
Copy link

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@github-actions
Copy link

You added a new feature but didn't update the readme. Please run cargo run -p build-templated-pages -- update features to update it, and commit the file change.

@Zeophlite Zeophlite changed the title Material prop3 Move MaterialProperties from bevy_pbr to bevy_material Oct 13, 2025
/// loaded, won't have entries in this table.
pub(crate) render_lightmaps: MainEntityHashMap<RenderLightmap>,

pub struct RenderLightmapsL {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contrast with RenderLightmapsU in crates/bevy_render/src/mesh/lightmap.rs

/// This is cleared and repopulated each frame during the `extract_lightmaps`
/// system.
#[derive(Resource)]
pub struct RenderLightmapsU {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contrast with RenderLightmapsL in crates/bevy_pbr/src/lightmap/mod.rs

free_slots_bitmask: u32,
}

struct AllocatedLightmap {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contrast with AllocatedLightmapUnloaded

impl FromWorld for MeshPipeline {
fn from_world(world: &mut World) -> Self {
// impl FromWorld for MeshPipeline {
pub fn meshPipeline_from_world(world: &mut World) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We change the FromWorld to be a RenderStartup system

.get_supported_read_only_binding_type(CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT);

todo!("Build 1x1 image");
// A 1x1x1 'all 1.0' texture to use as a dummy texture to use in place of optional StandardMaterial textures
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to handle dummy_white_gpu_image here

if let Some(handle) = handle_option {
let gpu_image = gpu_images.get(handle)?;
Some((&gpu_image.texture_view, &gpu_image.sampler))
} else {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to handle converting from dummy_white_gpu_image to a GpuImage

}
}

impl GetBatchData for MeshPipeline {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This impl moves to bevy_render

pub struct MeshLayouts {
/// The mesh model uniform (transform) and nothing else.
pub model_only: BindGroupLayoutDescriptor,
pub trait MeshLayoutsBuilder {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct MeshLayouts doesn't depend on wgpu , but impl MeshLayouts does, so split out here

/// A reference to all the mesh pipeline view layouts.
pub view_layouts: MeshPipelineViewLayouts,
// This dummy white texture is to be used in place of optional StandardMaterial textures
pub dummy_white_gpu_image: Handle<Image>,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be a GpuImage

fn extract_lightmaps(
render_lightmaps: ResMut<RenderLightmaps>,
render_lightmaps_u: ResMut<RenderLightmapsU>,
mut render_lightmaps_l: ResMut<RenderLightmapsL>,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea is we have split RenderLightmaps into 2 parts, the bit with wgpu-types and the bit with wgpu

};
render_lightmaps.slabs[usize::from(slab_index)].insert(slot_index, gpu_image.clone());
false
return false;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note a lot of shortcutting here to make it compile, I don't know how to do these actions

@Zeophlite
Copy link
Owner Author

Superceded by bevyengine#21543

@Zeophlite Zeophlite closed this Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants