From f936277160061d1e8dd37bd1985deae38fad1978 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 1 Sep 2011 07:09:19 +0000 Subject: [PATCH] change to offsetmapping syntax: dpoffsetmapping - SCALE bias BIASVALUE dpoffsetmapping - SCALE match FLOAT_PIXEL_VALUE_THAT_IS_BASE_LEVEL dpoffsetmapping - SCALE match8 8BIT_PIXEL_VALUE_THAT_IS_BASE_LEVEL dpoffsetmapping - SCALE match16 16BIT_PIXEL_VALUE_THAT_IS_BASE_LEVEL git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11316 d7cf8633-e32d-0410-b094-e92efae38249 --- model_shared.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/model_shared.c b/model_shared.c index 523461cd..1dbb1831 100644 --- a/model_shared.c +++ b/model_shared.c @@ -2259,8 +2259,17 @@ void Mod_LoadQ3Shaders(void) shader.offsetmapping = OFFSETMAPPING_RELIEF; if (numparameters >= 3) shader.offsetscale = atof(parameter[2]); - if (numparameters >= 4) - shader.offsetbias = atof(parameter[3]); + if (numparameters >= 5) + { + if(!strcasecmp(parameter[3], "bias")) + shader.offsetbias = atof(parameter[3]); + else if(!strcasecmp(parameter[3], "match")) + shader.offsetbias = 1.0f - atof(parameter[3]); + else if(!strcasecmp(parameter[3], "match8")) + shader.offsetbias = 1.0f - atof(parameter[3]) / 255.0f; + else if(!strcasecmp(parameter[3], "match16")) + shader.offsetbias = 1.0f - atof(parameter[3]) / 65535.0f; + } } else if (!strcasecmp(parameter[0], "deformvertexes") && numparameters >= 2) { -- 2.39.2