From 8bccbbb468cdcfef519c946809fa2be311025c93 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 ::stable-branch::merge=f936277160061d1e8dd37bd1985deae38fad1978 --- model_shared.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/model_shared.c b/model_shared.c index 5fcc15b6..57ecd79c 100644 --- a/model_shared.c +++ b/model_shared.c @@ -2243,8 +2243,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