From f6dfa3320140e1144de5dd0cd5fffc5f601c38f9 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Sun, 8 Oct 2023 14:47:26 +0200 Subject: [PATCH] Always obtain sky color if reflection hit nothing --- src/refresh/vkpt/shader/reflect_refract.rgen | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/refresh/vkpt/shader/reflect_refract.rgen b/src/refresh/vkpt/shader/reflect_refract.rgen index f92158f59..59cace9e5 100644 --- a/src/refresh/vkpt/shader/reflect_refract.rgen +++ b/src/refresh/vkpt/shader/reflect_refract.rgen @@ -521,13 +521,10 @@ main() // Reflection ray hit the sky - store an empty surface into the G-buffer, // blend the environment under the transparency. - if(found_intersection(ray_payload_geometry)) - { - vec3 env = env_map(direction, false); - env *= global_ubo.pt_env_scale; - - transparent = alpha_blend(transparent, vec4(env * throughput, 1)); - } + vec3 env = env_map(direction, false); + env *= global_ubo.pt_env_scale; + + transparent = alpha_blend(transparent, vec4(env * throughput, 1)); material_id = (primary_medium << MATERIAL_LIGHT_STYLE_SHIFT) & MATERIAL_LIGHT_STYLE_MASK;