Fix gamma correction adjusting uchar to float when unnecessary

This commit is contained in:
Ryan Huffman 2016-08-08 15:45:05 -07:00
parent 9b137570cf
commit b800aa793d

View file

@ -788,9 +788,9 @@ bool sphericalHarmonicsFromTexture(const gpu::Texture& cubeTexture, std::vector<
uint pixOffsetIndex = (x + y * width) * numComponents; uint pixOffsetIndex = (x + y * width) * numComponents;
// get color from texture and map to range [0, 1] // get color from texture and map to range [0, 1]
glm::vec3 clr(ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex]) * UCHAR_TO_FLOAT, glm::vec3 clr(ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex]),
ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex+1]) * UCHAR_TO_FLOAT, ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex + 1]),
ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex+2]) * UCHAR_TO_FLOAT); ColorUtils::sRGB8ToLinearFloat(data[pixOffsetIndex + 2]));
// scale color and add to previously accumulated coefficients // scale color and add to previously accumulated coefficients
sphericalHarmonicsScale(shBuffB.data(), order, sphericalHarmonicsScale(shBuffB.data(), order,