Build renderer and material component foundations
Add dedicated skinned rendering, pose restoration, shared Material and Material Instance slots, registry-driven components, Surface/Solari integration, transactional schema upgrades, navigation authoring, documentation, and evaluation evidence.
This commit is contained in:
1 parent
0553a85220
commit
0798aa5d57
169 files changed
+27098
-3469
No files matched your search
@@ -0,0 +1,47 @@
|
||||
use super::Pathtracer;
|
||||
use bevy_ecs::{
|
||||
component::Component,
|
||||
entity::Entity,
|
||||
query::With,
|
||||
system::{Commands, Query, Res, ResMut},
|
||||
};
|
||||
use bevy_image::ToExtents;
|
||||
use bevy_render::{
|
||||
camera::ExtractedCamera,
|
||||
render_resource::{TextureDescriptor, TextureDimension, TextureFormat, TextureUsages},
|
||||
renderer::RenderDevice,
|
||||
texture::{CachedTexture, TextureCache},
|
||||
};
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct PathtracerAccumulationTexture(pub CachedTexture);
|
||||
|
||||
pub fn prepare_pathtracer_accumulation_texture(
|
||||
query: Query<(Entity, &ExtractedCamera), With<Pathtracer>>,
|
||||
mut texture_cache: ResMut<TextureCache>,
|
||||
render_device: Res<RenderDevice>,
|
||||
mut commands: Commands,
|
||||
) {
|
||||
for (entity, camera) in &query {
|
||||
let Some(viewport) = camera.physical_viewport_size else {
|
||||
continue;
|
||||
};
|
||||
|
||||
let descriptor = TextureDescriptor {
|
||||
label: Some("pathtracer_accumulation_texture"),
|
||||
size: viewport.to_extents(),
|
||||
mip_level_count: 1,
|
||||
sample_count: 1,
|
||||
dimension: TextureDimension::D2,
|
||||
format: TextureFormat::Rgba32Float,
|
||||
usage: TextureUsages::STORAGE_BINDING,
|
||||
view_formats: &[],
|
||||
};
|
||||
|
||||
commands
|
||||
.entity(entity)
|
||||
.insert(PathtracerAccumulationTexture(
|
||||
texture_cache.get(&render_device, descriptor),
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user