From 4f3f6d78e3fc6e8904697db4551dfade3c4a9229 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 23 Feb 2019 09:42:26 +0000 Subject: [PATCH] Use invariant gl_Position whenever its supported, even where ftransform is used, to try to get rid of coplanar depth fighting (eg: viewmodel alpha, volumetric fov, etc). git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5407 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidcommon.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 20395c749..91009654c 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -2251,12 +2251,8 @@ static GLhandleARB GLSlang_CreateShader (program_t *prog, const char *name, int break; case GL_VERTEX_SHADER_ARB: GLSlang_GenerateInternal(&glsl, "#define VERTEX_SHADER\n"); -#ifdef RTLIGHTS - if (!r_shadow_shadowmapping.ival && ver >= 120) - { + if (ver >= 120 || gl_config_gles) //invariant appeared in glsl 120, or glessl 100. rtlights, stencil shadows, multipass materials, fog volumes, blend-depth-masking all need invariant depth. GLSlang_GenerateInternal(&glsl, "invariant gl_Position;\n"); - } -#endif if (gl_config.gles) { GLSlang_GenerateInternal(&glsl,