mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-29 17:15:40 +00:00
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.
This commit is contained in:
parent
06688de5fc
commit
a5858e635d
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
static const char *vertexShaderR3DQuads = R"glsl(
|
static const char *vertexShaderR3DQuads = R"glsl(
|
||||||
|
|
||||||
#version 410 core
|
#version 450 core
|
||||||
|
|
||||||
// uniforms
|
// uniforms
|
||||||
uniform float modelScale;
|
uniform float modelScale;
|
||||||
|
@ -53,7 +53,7 @@ void main(void)
|
||||||
|
|
||||||
static const char *geometryShaderR3DQuads = R"glsl(
|
static const char *geometryShaderR3DQuads = R"glsl(
|
||||||
|
|
||||||
#version 410 core
|
#version 450 core
|
||||||
|
|
||||||
layout (lines_adjacency) in;
|
layout (lines_adjacency) in;
|
||||||
layout (triangle_strip, max_vertices = 4) out;
|
layout (triangle_strip, max_vertices = 4) out;
|
||||||
|
@ -143,7 +143,7 @@ void main(void)
|
||||||
|
|
||||||
static const char *fragmentShaderR3DQuads = R"glsl(
|
static const char *fragmentShaderR3DQuads = R"glsl(
|
||||||
|
|
||||||
#version 410 core
|
#version 450 core
|
||||||
|
|
||||||
uniform sampler2D tex1; // base tex
|
uniform sampler2D tex1; // base tex
|
||||||
uniform sampler2D tex2; // micro tex (optional)
|
uniform sampler2D tex2; // micro tex (optional)
|
||||||
|
@ -277,7 +277,9 @@ void QuadraticInterpolation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (abs(lambdaSignCount) != 4) {
|
if (abs(lambdaSignCount) != 4) {
|
||||||
discard; // need to revisit this
|
if(!gl_HelperInvocation) {
|
||||||
|
discard; // need to revisit this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float interp_oneOverW = 0;
|
float interp_oneOverW = 0;
|
||||||
|
|
Loading…
Reference in a new issue