From 07ac8fd047793c8808cb4517df154007e7fffbc5 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 3 Aug 2019 18:02:21 +0000 Subject: [PATCH] fix outline quirks. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5505 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_backend.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index 457b333da..f1e7959aa 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -6341,24 +6341,28 @@ void GLBE_DrawWorld (batch_t **worldbatches) #endif } +#ifndef GLSLONLY if (r_outline.ival && !r_wireframe.ival && qglPolygonMode && qglLineWidth) { + int oc = r_refdef.flipcull; shaderstate.identitylighting = 0; shaderstate.identitylightmap = 0; - r_refdef.flipcull = SHADER_CULL_FLIP; - BE_SelectMode(BEM_DEPTHDARK); - shaderstate.polyoffset.unit = -25; - shaderstate.polyoffset.factor = -0.05; + r_refdef.flipcull ^= SHADER_CULL_FLIP; + GLBE_SelectMode(BEM_DEPTHDARK); + shaderstate.polyoffset.unit = 1; + shaderstate.polyoffset.factor = 1; qglEnable(GL_POLYGON_OFFSET_LINE); qglLineWidth (bound(0.1, r_outline_width.value, 3.0)); qglPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - GLBE_SubmitMeshes(NULL, SHADER_SORT_PORTAL, SHADER_SORT_SEETHROUGH+1); - BE_SelectMode(BEM_STANDARD); + GLBE_SubmitMeshes(NULL, SHADER_SORT_PORTAL, SHADER_SORT_OPAQUE+1); + r_refdef.flipcull = oc; + GLBE_SelectMode(BEM_STANDARD); qglDisable(GL_POLYGON_OFFSET_LINE); qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL); qglLineWidth (1); } +#endif shaderstate.identitylighting = 1;