From 9e58b02252944ea128da186c056c4f46c482fbd0 Mon Sep 17 00:00:00 2001 From: William Deurwaarder Date: Fri, 1 Oct 2021 23:20:20 +0200 Subject: GPULightmapper: skip smoothen positions for flat triangles Smoothening positions for flat, non-smoothened, triangles is unnecessary and caused positions to move outside their triangle which caused side-effects as rays from those positions intersected with triangles which could not be reached from the original triangle. This is solved by skipping smoothening of positions for flat triangles. A triangle is determined to be flas as its vertex normals are equal. --- modules/lightmapper_rd/lm_common_inc.glsl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/lightmapper_rd/lm_common_inc.glsl') diff --git a/modules/lightmapper_rd/lm_common_inc.glsl b/modules/lightmapper_rd/lm_common_inc.glsl index 22172d50e4..58523dc1f8 100644 --- a/modules/lightmapper_rd/lm_common_inc.glsl +++ b/modules/lightmapper_rd/lm_common_inc.glsl @@ -81,3 +81,7 @@ layout(set = 0, binding = 8) uniform texture2DArray albedo_tex; layout(set = 0, binding = 9) uniform texture2DArray emission_tex; layout(set = 0, binding = 10) uniform sampler linear_sampler; + +// Fragment action constants +const uint FA_NONE = 0; +const uint FA_SMOOTHEN_POSITION = 1; -- cgit v1.2.3