From c1c0a861b8e37cb64f9bcfd2bc081c23441978da Mon Sep 17 00:00:00 2001 From: Eukara Date: Thu, 28 Mar 2019 04:12:47 +0000 Subject: [PATCH] Added support for multipliers to the polygonOffset directive git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5439 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_shader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 50814a37d..3a677744c 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -1120,10 +1120,20 @@ static void Shader_Portal (parsestate_t *ps, char **ptr) static void Shader_PolygonOffset (parsestate_t *ps, char **ptr) { + int m; + char *token; shader_t *shader = ps->s; - /*the q3 defaults*/ + + token = Shader_ParseString(ptr); + m = atoi(token); + + if (m) { + shader->polyoffset.unit = -25 * m; + } else { + shader->polyoffset.unit = -25; + } + shader->polyoffset.factor = -0.05; - shader->polyoffset.unit = -25; shader->flags |= SHADER_POLYGONOFFSET; //some backends might be lazy and only allow simple values. }