]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.h
sRGB: also convert vertex colors
[xonotic/darkplaces.git] / image.h
diff --git a/image.h b/image.h
index 823ca397e783f5187a09710752a09ef17d9c4db2..8c501c0dafd30c1f69e89a7efed10e04c3fc69ef 100644 (file)
--- a/image.h
+++ b/image.h
@@ -51,6 +51,7 @@ extern cvar_t r_fixtrans_auto;
 
 #define Image_LinearFloatFromsRGB(c) (((c) < 11) ? (c) * 0.000302341331f : (float)pow(((c)*(1.0f/256.0f) + 0.055f)*(1.0f/1.0555f), 2.4f))
 #define Image_sRGBFloatFromLinear(c) (((c) < 1) ? (c) * 0.05046875f : 1.055f * (float)pow((c)*(1.0f/256.0f), 1.0f/2.4f) - 0.055f)
+#define Image_sRGBFloatFromLinear_Lightmap(c) (Image_sRGBFloatFromLinear(c*2.0f)*0.5f)
 
 void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pin, int numpixels);
 void Image_MakesRGBColorsFromLinear_Lightmap(unsigned char *pout, const unsigned char *pin, int numpixels);