Commit ed155d8a authored by Janis Born's avatar Janis Born

fix wrong color conversions between RGB and RGBA

parent baed658e
......@@ -324,7 +324,7 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to)
else if (_from == 2) {
switch (_to) {
case 1: return glm::vec4( _texel.r, 0.0, 0.0, 0.0 );
case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, _texel.g );
case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, 0.0 );
case 4: return glm::vec4( _texel.r, _texel.r, _texel.r, _texel.g );
}
}
......@@ -332,14 +332,14 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to)
switch (_to) {
case 1: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0 );
case 2: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0 );
case 4: return glm::vec4( _texel.r, _texel.r, _texel.r, 1.0 );
case 4: return glm::vec4( _texel.r, _texel.g, _texel.b, 1.0 );
}
}
else if (_from == 4) {
switch (_to) {
case 1: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 0.0, 0.0, 0.0 );
case 2: return glm::vec4( grayscaleMixdown(_texel.r, _texel.g, _texel.b), 1.0, 0.0, 0.0 );
case 3: return glm::vec4( _texel.r, _texel.r, _texel.r, 0.0 );
case 3: return glm::vec4( _texel.r, _texel.g, _texel.b, 0.0 );
}
}
return _texel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment