]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
change to offsetmapping syntax:
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 1 Sep 2011 07:09:19 +0000 (07:09 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 1 Sep 2011 07:09:19 +0000 (07:09 +0000)
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

index 523461cde870cea69d71aca95495bd9cab16f8ca..1dbb18316e7c861373899dba01181ed5d7d181aa 100644 (file)
@@ -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)
                                {