From Eric Sokolowsky, "There was a problem with the PNG plugin when it encounters an image that is
less than 8 bits per pixel (this can happen with greyscale or paletted images). It was a pretty simple problem to fix."
This commit is contained in:
@@ -152,7 +152,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
png_read_end(png, endinfo);
|
||||
|
||||
GLenum pixelFormat = 0;
|
||||
GLenum dataType = depth==8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT;
|
||||
GLenum dataType = depth<=8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT;
|
||||
switch(color)
|
||||
{
|
||||
case(PNG_SOLID): pixelFormat = GL_LUMINANCE; break;
|
||||
|
||||
Reference in New Issue
Block a user