If the intensity is greater than one, then we're treating it as a float value, so when packing it into a pixel, just pack the value instead of scaling it to 255...

This commit is contained in:
Pavel Krajcevski 2013-10-11 21:38:28 -04:00
parent d3fd98c8fa
commit 68f2f4a8b3

View file

@ -62,7 +62,11 @@ namespace FasTC {
uint32 IPixel::Pack() const { uint32 IPixel::Pack() const {
uint32 ret = 0xFF << 24; uint32 ret = 0xFF << 24;
for(uint32 i = 0; i < 3; i++) { for(uint32 i = 0; i < 3; i++) {
ret |= static_cast<uint32>((255.0 * vec[0]) + 0.5f) << i*8; if(vec[0] > 1.0) {
ret |= static_cast<uint32>(vec[0]) << i*8;
} else {
ret |= static_cast<uint32>((255.0 * vec[0]) + 0.5f) << i*8;
}
} }
return ret; return ret;
} }