]> git.rm.cloudns.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)
committerRudolf Polzer <divVerent@xonotic.org>
Thu, 1 Sep 2011 08:17:10 +0000 (10:17 +0200)
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

index 5fcc15b6a829dbe65d1f559c435170194d0c578b..57ecd79c4f8fce5cd75af5f1e52cdd8f1e31c65c 100644 (file)
@@ -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)
                                {