From a5858e635d5e90b802639f393b997c95cd237e05 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Tue, 10 Dec 2019 11:40:39 +0000 Subject: [PATCH] To calculate the mipmap value the opengl needs to calculate the difference in the texture coordinates between adjacent pixels. If there are no adjacent pixels the hw may need to spawn invisible fragments outside of the visible polygon. Our algorithm was culling these out so the mipamp calculation failed for edge pixels. Anyway this fixes quad rendering looking broken with the latest nvidia drivers. --- Src/Graphics/New3D/R3DShaderQuads.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Src/Graphics/New3D/R3DShaderQuads.h b/Src/Graphics/New3D/R3DShaderQuads.h index bff998c..24f7cb4 100644 --- a/Src/Graphics/New3D/R3DShaderQuads.h +++ b/Src/Graphics/New3D/R3DShaderQuads.h @@ -3,7 +3,7 @@ static const char *vertexShaderR3DQuads = R"glsl( -#version 410 core +#version 450 core // uniforms uniform float modelScale; @@ -53,7 +53,7 @@ void main(void) static const char *geometryShaderR3DQuads = R"glsl( -#version 410 core +#version 450 core layout (lines_adjacency) in; layout (triangle_strip, max_vertices = 4) out; @@ -143,7 +143,7 @@ void main(void) static const char *fragmentShaderR3DQuads = R"glsl( -#version 410 core +#version 450 core uniform sampler2D tex1; // base tex uniform sampler2D tex2; // micro tex (optional) @@ -277,7 +277,9 @@ void QuadraticInterpolation() } } if (abs(lambdaSignCount) != 4) { - discard; // need to revisit this + if(!gl_HelperInvocation) { + discard; // need to revisit this + } } float interp_oneOverW = 0;