From: divverent Date: Thu, 1 Sep 2011 07:09:19 +0000 (+0000) Subject: change to offsetmapping syntax: X-Git-Tag: xonotic-v0.6.0~163^2~236 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f936277160061d1e8dd37bd1985deae38fad1978;p=xonotic%2Fdarkplaces.git 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 --- 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) {