From 3935a609141623e7cfb3fa339da1a166e3917018 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 20 Dec 2020 14:49:20 +0100 Subject: Ray tracer renderer Use ray for rendering Setup basic rendering stuff camera / viewport --- src/color.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/color.cpp') diff --git a/src/color.cpp b/src/color.cpp index 2777d39..53a79f9 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -1,7 +1,7 @@ #include "color.hpp" -void write_color(std::ostream& out, color pixel_color) { - out << pixel_color.x << ' ' - << pixel_color.y << ' ' - << pixel_color.z << ' '; +void write_color(std::ostream& out, const color& pixel_color) { + out << static_cast(255.0 * pixel_color.x) << ' ' + << static_cast(255.0 * pixel_color.y) << ' ' + << static_cast(255.0 * pixel_color.z) << std::endl; } -- cgit v1.3