Start Revive of Depth Prepass#5523
Start Revive of Depth Prepass#5523ChristopherBiscardi wants to merge 3 commits intobevyengine:mainfrom
Conversation
| @@ -0,0 +1,104 @@ | |||
| // NOTE: Keep in sync with pbr.wgsl | |||
| [[block]] | |||
There was a problem hiding this comment.
TODO: update syntax
|
solved
Fixed with: pub fn queue_depth_prepass_meshes<M: Material>(
...
render_materials: Res<RenderMaterials<M>>,
) |
| @@ -0,0 +1,786 @@ | |||
| use crate::{ | |||
| draw_3d_graph, AlphaMode, MeshPipeline, MeshUniform, StandardMaterial, MeshViewBindGroup, | |||
There was a problem hiding this comment.
I made TransformBindGroup, MeshViewBindGroup because the transform no longer exists. I'm not yet sure if that was the right succession.
| impl FromWorld for DepthPrepassPipeline { | ||
| fn from_world(world: &mut World) -> Self { | ||
| let render_device = world.get_resource::<RenderDevice>().unwrap(); | ||
| let mesh_pipeline = world.get_resource::<MeshPipeline>().unwrap(); |
There was a problem hiding this comment.
PbrPipeline became MeshPipeline I think.
| ty: BindingType::Buffer { | ||
| ty: BufferBindingType::Uniform, | ||
| has_dynamic_offset: false, | ||
| // TODO: change this to StandardMaterialUniformData::std140_size_static once crevice fixes this! |
There was a problem hiding this comment.
Bevy uses encase now. This probably can be updated.
| } | ||
|
|
||
|
|
||
| // TODO: ActiveCameras |
There was a problem hiding this comment.
ActivesCameras are no longer a thing and the user is expected to track that themselves. I've subbed in "all 3d cameras" in the meantime.
|
The PR is almost compiling. Two major outstanding issues are accessing the active 3d camera ( |
|
@superdump said they're choosing to pursue a different approach, so closing this. |
reviving:
9262c8f(#3072)temp link to original discord thread: https://discord.com/channels/691052431525675048/1002129015936655361/1002480744360317008
Objective
Adds a depth pre-pass so that custom materials can access the depth buffer data when implementing effects such as drawing the intersection of an opaque and an alpha-blended object on the alpha blended object.
Solution
Changelog
Migration Guide