-
Notifications
You must be signed in to change notification settings - Fork 0
Move MaterialProperties
from bevy_pbr
to bevy_material
#2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
You added a new feature but didn't update the readme. Please run |
MaterialProperties
from bevy_pbr
to bevy_material
/// loaded, won't have entries in this table. | ||
pub(crate) render_lightmaps: MainEntityHashMap<RenderLightmap>, | ||
|
||
pub struct RenderLightmapsL { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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>, |
There was a problem hiding this comment.
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>, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
Superceded by bevyengine#21543 |
Objective
MaterialProperties
frombevy_pbr
tobevy_material
(new crate that doesn't depend onwgpu
, justwgpu-types
)Solution
bevy_pbr
tobevy_material
bevy_render
tobevy_material
bevy_pbr
tobevy_render
Testing