Merge branch 'master' of https://github.com/supertuxkart/stk-code into devel
This commit is contained in:
commit
b9bf1e678a
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user