rt: oops color clamping bug
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 8 May 2022 15:14:59 +0000 (18:14 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 8 May 2022 15:16:02 +0000 (18:16 +0300)
src/scr/raytrace.c

index 3d8465f..bc9d654 100644 (file)
@@ -84,9 +84,9 @@ static void draw(void)
                        cgm_vcons(&ray.origin, 0, 0, -5);
 
                        if(ray_trace(&ray, &scn, 0, &col)) {
-                               r = cround64(col.x * 255.0f) & 0xff;
-                               g = cround64(col.y * 255.0f) & 0xff;
-                               b = cround64(col.z * 255.0f) & 0xff;
+                               r = cround64(col.x * 255.0f);
+                               g = cround64(col.y * 255.0f);
+                               b = cround64(col.z * 255.0f);
                                if(r > 255) r = 255;
                                if(g > 255) g = 255;
                                if(b > 255) b = 255;