Skip to content

Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.

Merge main into #6471

Ludovic Mariebc22eb04e75b
diff --cc crates/horizon-client-render/src/gfx.rs
index 29278d20f,da55c96ba..045c517fe
--- a/crates/horizon-client-render/src/gfx.rs
+++ b/crates/horizon-client-render/src/gfx.rs
@@@ -8161,47 -8228,9 +8233,47 @@@ impl Renderer
crate::screen_effects::Blend::Alpha => 0,
crate::screen_effects::Blend::Vignette => 4,
};
- pass.set_pipeline(&self.screen_pipelines[blend + (quad.sampling & 3) as usize]);
+ let tint = if quad.world_tint && self.hdr.is_some() {
+ 8
+ } else {
+ 0
+ };
+ pass.set_pipeline(
+ &self.screen_pipelines[tint + blend + (quad.sampling & 3) as usize],
+ );
pass.draw_indexed(0..6, (i * 4) as i32, 0..1);
}
+ drop(pass);
+ // A tint leaves the frame's alpha and goes over the kept world too: light sources
+ // under water still show the world, and still shine.
- if let Some(view) = self.hdr.as_ref().and_then(|h| h.kept_world_view())
++ if let Some(view) = self.hdr.as_ref().and_then(|h| h.hand_light_view())
+ && frame.screen.iter().any(|quad| quad.world_tint)
+ {
+ let attachments = [Some(wgpu::RenderPassColorAttachment {
+ view: &view,
+ resolve_target: None,
+ depth_slice: None,
+ ops: wgpu::Operations {
+ load: wgpu::LoadOp::Load,
+ store: wgpu::StoreOp::Store,
+ },
+ })];
+ let mut pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
+ label: Some("Screen tints over the kept world"),
+ timestamp_writes: None,
+ color_attachments: &attachments,
+ ..Default::default()
+ });
+ pass.set_bind_group(0, &self.entity_group, &[]);
+ pass.set_index_buffer(self.indices.slice(..), wgpu::IndexFormat::Uint32);
+ pass.set_vertex_buffer(0, self.screen_buffer.slice(..));
+ for (i, quad) in frame.screen.iter().enumerate() {
+ if quad.world_tint {
+ pass.set_pipeline(&self.screen_pipelines[8 + (quad.sampling & 3) as usize]);
+ pass.draw_indexed(0..6, (i * 4) as i32, 0..1);
+ }
+ }
+ }
}
// GameRenderer.render3dHud: the debug crosshair after the hand and
// the screen effects.
diff --cc crates/horizon-client-render/src/gfx/hdr.rs
index 851923f32,a5e870d63..283ab8fb7
--- a/crates/horizon-client-render/src/gfx/hdr.rs
+++ b/crates/horizon-client-render/src/gfx/hdr.rs
@@@ -441,8 -441,8 +441,9 @@@ impl Hdr
pass.draw(0..3, 0..1);
}
- /// The world as `keep_world` kept it, for what tints it rather than covering it.
- pub fn kept_world_view(&self) -> Option<wgpu::TextureView> {
- /// Where the hand's marks go: the kept world's alpha, which HDR output reads for it too.
++ /// The world as `keep_world` kept it: where the hand's marks go (its alpha, which HDR output
++ /// reads for it too), and what tints the world rather than covering it.
+ pub fn hand_light_view(&self) -> Option<wgpu::TextureView> {
let t = self.targets.as_ref()?;
Some(t.world.create_view(&Default::default()))
}