add manual clamping to box shaders

This commit is contained in:
hunterk 2018-08-25 13:58:11 -05:00
parent 25b5220847
commit 7bf5101cbc
3 changed files with 24 additions and 3 deletions

View File

@ -93,6 +93,13 @@ COMPAT_VARYING vec4 TEX0;
void main()
{
FragColor = COMPAT_TEXTURE(Source, vTexCoord);
vec3 outColor = COMPAT_TEXTURE(Source, vTexCoord);
/* TODO/FIXME - hacky clamp fix */
vec2 bordertest = gl_FragCoord.xy;
if ( bordertest.x > 0.0001 && bordertest.x < 0.9999 && bordertest.y > 0.0001 && bordertest.y < 0.9999)
outColor.rgb = outColor.rgb;
else
outColor.rgb = vec3(0.0);
FragColor = vec4(outColor, 1.0);
}
#endif

View File

@ -102,6 +102,13 @@ COMPAT_VARYING vec4 TEX0;
void main()
{
FragColor = COMPAT_TEXTURE(Source, vTexCoord);
vec3 outColor = COMPAT_TEXTURE(Source, vTexCoord);
/* TODO/FIXME - hacky clamp fix */
vec2 bordertest = gl_FragCoord.xy;
if ( bordertest.x > 0.0001 && bordertest.x < 0.9999 && bordertest.y > 0.0001 && bordertest.y < 0.9999)
outColor.rgb = outColor.rgb;
else
outColor.rgb = vec3(0.0);
FragColor = vec4(outColor, 1.0);
}
#endif

View File

@ -104,6 +104,13 @@ COMPAT_VARYING vec4 TEX0;
void main()
{
FragColor = COMPAT_TEXTURE(Source, vTexCoord);
vec3 outColor = COMPAT_TEXTURE(Source, vTexCoord);
/* TODO/FIXME - hacky clamp fix */
vec2 bordertest = gl_FragCoord.xy;
if ( bordertest.x > 0.0001 && bordertest.x < 0.9999 && bordertest.y > 0.0001 && bordertest.y < 0.9999)
outColor.rgb = outColor.rgb;
else
outColor.rgb = vec3(0.0);
FragColor = vec4(outColor, 1.0);
}
#endif