From 04d8aabc925f580a79bb7880b1373b9f7c8c0178 Mon Sep 17 00:00:00 2001 From: RaveYard Date: Thu, 30 Jun 2022 15:55:13 +0200 Subject: [PATCH] Fix ambient occlusion pass not considering sky as a miss --- src/lightmap/glsl_rchit_ambient.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lightmap/glsl_rchit_ambient.h b/src/lightmap/glsl_rchit_ambient.h index 2b04b8d..e9c6585 100644 --- a/src/lightmap/glsl_rchit_ambient.h +++ b/src/lightmap/glsl_rchit_ambient.h @@ -28,7 +28,16 @@ layout(set = 0, binding = 6) buffer SurfaceBuffer { SurfaceInfo surfaces[]; }; void main() { - payload.hitAttenuation = gl_HitTEXT; + SurfaceInfo surface = surfaces[surfaceIndices[gl_PrimitiveID]]; + + if(surface.Sky > 0.0) + { + payload.hitAttenuation = 100000.0; + } + else + { + payload.hitAttenuation = gl_HitTEXT; + } } )glsl";