summaryrefslogtreecommitdiff
path: root/indra/llrender/llcubemap.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-05-05 00:37:16 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-05-05 00:37:16 +0300
commitec9b9898635e90dcdc3579e2121ef11f8ca2a0a8 (patch)
tree859eb8101847d3c8be18adc6bf9aa0e775a792e7 /indra/llrender/llcubemap.cpp
parent80447f5e6bfd9843413c7a79074d11373e6c4061 (diff)
parent7c0f3db180e50aad3866a8ac1b1c88cccf74c68d (diff)
Merge branch 'DRTVWR-501-maint' into DRTVWR-503-maint
# Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp # indra/newview/lltexturectrl.cpp # indra/newview/skins/default/xui/de/floater_texture_ctrl.xml # indra/newview/skins/default/xui/es/floater_texture_ctrl.xml # indra/newview/skins/default/xui/fr/floater_texture_ctrl.xml # indra/newview/skins/default/xui/it/floater_texture_ctrl.xml # indra/newview/skins/default/xui/ja/floater_texture_ctrl.xml # indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml # indra/newview/skins/default/xui/ru/floater_texture_ctrl.xml # indra/newview/skins/default/xui/tr/floater_texture_ctrl.xml # indra/newview/skins/default/xui/zh/floater_texture_ctrl.xml
Diffstat (limited to 'indra/llrender/llcubemap.cpp')
-rw-r--r--indra/llrender/llcubemap.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index af4e3fdda0..5947bca670 100644
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -43,20 +43,13 @@
const F32 epsilon = 1e-7f;
const U16 RESOLUTION = 64;
-#if LL_DARWIN
-// mipmap generation on cubemap textures seems to be broken on the Mac for at least some cards.
-// Since the cubemap is small (64x64 per face) and doesn't have any fine detail, turning off mipmaps is a usable workaround.
-const BOOL use_cube_mipmaps = FALSE;
-#else
-const BOOL use_cube_mipmaps = FALSE; //current build works best without cube mipmaps
-#endif
-
bool LLCubeMap::sUseCubeMaps = true;
-LLCubeMap::LLCubeMap()
+LLCubeMap::LLCubeMap(bool init_as_srgb)
: mTextureStage(0),
mTextureCoordStage(0),
- mMatrixStage(0)
+ mMatrixStage(0),
+ mIssRGB(init_as_srgb)
{
mTargets[0] = GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB;
mTargets[1] = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
@@ -82,12 +75,17 @@ void LLCubeMap::initGL()
U32 texname = 0;
LLImageGL::generateTextures(1, &texname);
-
+
for (int i = 0; i < 6; i++)
{
- mImages[i] = new LLImageGL(64, 64, 4, (use_cube_mipmaps? TRUE : FALSE));
+ mImages[i] = new LLImageGL(RESOLUTION, RESOLUTION, 4, FALSE);
+ #if USE_SRGB_DECODE
+ if (mIssRGB) {
+ mImages[i]->setExplicitFormat(GL_SRGB8_ALPHA8, GL_RGBA);
+ }
+ #endif
mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);
- mRawImages[i] = new LLImageRaw(64, 64, 4);
+ mRawImages[i] = new LLImageRaw(RESOLUTION, RESOLUTION, 4);
mImages[i]->createGLTexture(0, mRawImages[i], texname);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname);
@@ -154,7 +152,7 @@ void LLCubeMap::initGLData()
{
for (int i = 0; i < 6; i++)
{
- mImages[i]->setSubImage(mRawImages[i], 0, 0, 64, 64);
+ mImages[i]->setSubImage(mRawImages[i], 0, 0, RESOLUTION, RESOLUTION);
}
}
@@ -484,7 +482,7 @@ void LLCubeMap::paintIn(LLVector3 dir[4], const LLColor4U& col)
td[offset + cc] = U8((td[offset + cc] + col.mV[cc]) * 0.5);
}
}
- mImages[side]->setSubImage(mRawImages[side], 0, 0, 64, 64);
+ mImages[side]->setSubImage(mRawImages[side], 0, 0, RESOLUTION, RESOLUTION);
}
}