Fixed skybox rendering.
The GL_SRGB_ALPHA_EXT and GL_SRGB8_ALPHA8 formats are available in OpenGL ES, but they produce black texture for some reason. The basic GL_RGBA format works fine though.
This commit is contained in:
parent
961428f04c
commit
3ae175e05a
@ -185,22 +185,19 @@ void Skybox::generateCubeMapFromTextures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_cube_map);
|
glBindTexture(GL_TEXTURE_CUBE_MAP, m_cube_map);
|
||||||
#ifndef ANDROID
|
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||||
#if !defined(USE_GLES2)
|
GLint internal_format = CVS->isTextureCompressionEnabled() ?
|
||||||
if (CVS->isTextureCompressionEnabled())
|
GL_COMPRESSED_SRGB_ALPHA : GL_SRGB_ALPHA;
|
||||||
{
|
#else
|
||||||
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0,
|
// The GL_SRGB_ALPHA_EXT and GL_SRGB8_ALPHA8 formats are available in
|
||||||
GL_COMPRESSED_SRGB_ALPHA, size, size, 0, GL_BGRA,
|
// OpenGL ES, but they produce black texture for some reason.
|
||||||
GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]);
|
// The basic GL_RGBA format works fine though.
|
||||||
}
|
GLint internal_format = GL_RGBA;
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0,
|
|
||||||
GL_SRGB_ALPHA, size, size, 0, GL_BGRA,
|
|
||||||
GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0,
|
||||||
|
internal_format, size, size, 0, GL_BGRA,
|
||||||
|
GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]);
|
||||||
}
|
}
|
||||||
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
|
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
|
||||||
for (unsigned i = 0; i < 6; i++)
|
for (unsigned i = 0; i < 6; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user