这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_gaussian_splatting"
description = "bevy gaussian splatting render pipeline plugin"
version = "2.7.3"
version = "2.7.4"
edition = "2021"
authors = ["mosure <mitchell@mosure.me>"]
license = "MIT OR Apache-2.0"
Expand Down
12 changes: 10 additions & 2 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ fn queue_gaussians(

let draw_custom = transparent_3d_draw_functions.read().id::<DrawGaussians>();

for (view_entity, _view, _) in &mut views {
for (view_entity, view, _) in &mut views {
let Some(transparent_phase) = transparent_render_phases.get_mut(&view_entity) else {
continue;
};
Expand Down Expand Up @@ -343,6 +343,7 @@ fn queue_gaussians(
gaussian_mode: settings.gaussian_mode,
rasterize_mode: settings.rasterize_mode,
sample_count: msaa.samples(),
hdr: view.hdr,
};

let pipeline = pipelines.specialize(&pipeline_cache, &custom_pipeline, key);
Expand Down Expand Up @@ -625,6 +626,7 @@ pub struct GaussianCloudPipelineKey {
pub gaussian_mode: GaussianMode,
pub rasterize_mode: GaussianCloudRasterize,
pub sample_count: u32,
pub hdr: bool,
}

impl SpecializedRenderPipeline for GaussianCloudPipeline {
Expand All @@ -633,6 +635,12 @@ impl SpecializedRenderPipeline for GaussianCloudPipeline {
fn specialize(&self, key: Self::Key) -> RenderPipelineDescriptor {
let shader_defs = shader_defs(key);

let format = if key.hdr {
TextureFormat::Rgba16Float
} else {
TextureFormat::Rgba8UnormSrgb
};

RenderPipelineDescriptor {
label: Some("gaussian cloud render pipeline".into()),
layout: vec![
Expand All @@ -652,7 +660,7 @@ impl SpecializedRenderPipeline for GaussianCloudPipeline {
shader_defs,
entry_point: "fs_main".into(),
targets: vec![Some(ColorTargetState {
format: TextureFormat::Rgba8UnormSrgb,
format,
blend: Some(BlendState::PREMULTIPLIED_ALPHA_BLENDING),
write_mask: ColorWrites::ALL,
})],
Expand Down
Loading