From 08949f94ea2763a439fd847e9a6b9a1d9ed4c73a Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Sat, 13 Jul 2024 17:07:27 +0200 Subject: [PATCH] Fix backfacing AO --- .../NPR_Pipeline/Shaders/NPR_Pipeline/NPR_Filters.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_Pipeline/NPR_Filters.glsl b/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_Pipeline/NPR_Filters.glsl index 01af7d8d..4f8694ff 100644 --- a/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_Pipeline/NPR_Filters.glsl +++ b/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_Pipeline/NPR_Filters.glsl @@ -29,7 +29,7 @@ float ao(int samples, float radius, float distribution_exponent, float contrast, vec3 normal = NORMAL; #ifdef IS_MESH_SHADER { - normal = IO_NORMAL; + normal = is_front_facing() ? IO_NORMAL : -IO_NORMAL; } #endif float ao = ao(IN_NORMAL_DEPTH, 3, POSITION, normal, samples, radius, distribution_exponent, bias);