Merge branch 'master' of https://github.com/supertuxkart/stk-code into devel

This commit is contained in:
konstin 2014-05-17 22:12:30 +02:00
commit b9bf1e678a
3 changed files with 15 additions and 2 deletions

View File

@ -154,7 +154,7 @@ private:
RES_CHANGE_CANCEL} m_resolution_changing;
public:
GLuint SkyboxCubeMap;
GLuint SkyboxCubeMap, FakeSkybox;
/** A simple class to store video resolutions. */
class VideoMode
{

View File

@ -1362,7 +1362,19 @@ void IrrDriver::generateSkyboxCubemap()
void IrrDriver::renderSkybox(const scene::ICameraSceneNode *camera)
{
if (SkyboxTextures.empty()) return;
if (SkyboxTextures.empty() && FakeSkybox)
{
glGenTextures(1, &FakeSkybox);
unsigned w = 1, h = 1;
char *rgba[6];
for (unsigned i = 0; i < 6; i++)
rgba[i] = new char[w * h * 4];
for (unsigned i = 0; i < 6; i++)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_COMPRESSED_SRGB_ALPHA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
return;
}
if (!SkyboxCubeMap)
generateSkyboxCubemap();

View File

@ -312,6 +312,7 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelMatrix, const c
glActiveTexture(GL_TEXTURE0 + MeshShader::SphereMapShader::TU_tex);
if (!irr_driver->SkyboxCubeMap)
{
glBindTexture(GL_TEXTURE_CUBE_MAP, irr_driver->FakeSkybox);
GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ONE };
glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
}