]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_ydnar.c
Comment ColorToBytesNonZero and fix zero detection in light.c.
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_ydnar.c
index 5653987557017e5db02c49537149233c13b1e880..b86ff4b2f228f66b4a8f7a38b292f0776a6990ef 100644 (file)
@@ -132,6 +132,12 @@ void ColorToBytes( const float *color, byte *colorBytes, float scale ){
        colorBytes[ 2 ] = sample[ 2 ];
 }
 
+/*
+ * Same as ColorToBytes, but if the output color will never contain zero
+ * components. Used to avoid returning 0 0 0 due to an ioq3 issue. Reason
+ * to also map 0 0 1 to 1 1 1 is to ensure monotonicity in the color mapping
+ * to prevent banding-like artifacts on lightmaps.
+ */
 void ColorToBytesNonZero( const float *color, byte *colorBytes, float scale) {
        int i;
        ColorToBytes(color, colorBytes, scale);