From 9264850a1c4f1689111187f901cb2ede489ab374 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Sat, 6 Apr 2024 04:08:55 -0400 Subject: [PATCH] Fix skybox wrong alpha (#12888) Fix https://github.com/bevyengine/bevy/issues/12740 --- crates/bevy_core_pipeline/src/skybox/skybox.wgsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_core_pipeline/src/skybox/skybox.wgsl b/crates/bevy_core_pipeline/src/skybox/skybox.wgsl index 593b440ee4680..0534c57854f41 100644 --- a/crates/bevy_core_pipeline/src/skybox/skybox.wgsl +++ b/crates/bevy_core_pipeline/src/skybox/skybox.wgsl @@ -72,5 +72,6 @@ fn skybox_fragment(in: VertexOutput) -> @location(0) vec4 { let ray_direction = coords_to_ray_direction(in.position.xy, view.viewport); // Cube maps are left-handed so we negate the z coordinate. - return textureSample(skybox, skybox_sampler, ray_direction * vec3(1.0, 1.0, -1.0)) * uniforms.brightness; + let out = textureSample(skybox, skybox_sampler, ray_direction * vec3(1.0, 1.0, -1.0)); + return vec4(out.rgb * uniforms.brightness, out.a); }