Disable srgb texture compression for Intel
RGB texture compression works fine but it looks like srgb TC isnt properly supported. A later TODO would be to convert rgb to srgb in cpu and use compression again.
This commit is contained in:
@@ -309,10 +309,20 @@ void transformTexturesTosRGB(irr::video::ITexture *tex)
|
||||
memcpy(data, tex->lock(), w * h * 4);
|
||||
tex->unlock();
|
||||
glBindTexture(GL_TEXTURE_2D, getTextureGLuint(tex));
|
||||
if (tex->hasAlpha())
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
if (irr_driver->getGLSLVersion() < 320)
|
||||
{
|
||||
if (tex->hasAlpha())
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB_ALPHA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB, w, h, 0, GL_BGR, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
}
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB, w, h, 0, GL_BGR, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
{
|
||||
if (tex->hasAlpha())
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB, w, h, 0, GL_BGR, GL_UNSIGNED_BYTE, (GLvoid *)data);
|
||||
}
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user