aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llcubemap.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llrender/llcubemap.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llcubemap.cpp (renamed from linden/indra/newview/llcubemap.cpp)33
1 files changed, 13 insertions, 20 deletions
diff --git a/linden/indra/newview/llcubemap.cpp b/linden/indra/llrender/llcubemap.cpp
index f79fd0f..563d616 100644
--- a/linden/indra/newview/llcubemap.cpp
+++ b/linden/indra/llrender/llcubemap.cpp
@@ -28,22 +28,21 @@
28 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31#include "linden_common.h"
31 32
32#include "llviewerprecompiledheaders.h"
33#include "llfeaturemanager.h"
34#include "llworkerthread.h" 33#include "llworkerthread.h"
35 34
36#include "llcubemap.h" 35#include "llcubemap.h"
37 36
38#include "v4coloru.h" 37#include "v4coloru.h"
39#include "v3math.h" 38#include "v3math.h"
39#include "v3dmath.h"
40#include "m3math.h"
41#include "m4math.h"
42#include "llcamera.h"
40 43
41#include "llrender.h" 44#include "llrender.h"
42 45
43#include "llviewercamera.h"
44#include "llviewerimage.h"
45#include "llviewerimagelist.h"
46
47#include "llglheaders.h" 46#include "llglheaders.h"
48 47
49const F32 epsilon = 1e-7f; 48const F32 epsilon = 1e-7f;
@@ -57,6 +56,8 @@ const BOOL use_cube_mipmaps = FALSE;
57const BOOL use_cube_mipmaps = FALSE; //current build works best without cube mipmaps 56const BOOL use_cube_mipmaps = FALSE; //current build works best without cube mipmaps
58#endif 57#endif
59 58
59bool LLCubeMap::sUseCubeMaps = true;
60
60LLCubeMap::LLCubeMap() 61LLCubeMap::LLCubeMap()
61 : mTextureStage(0), 62 : mTextureStage(0),
62 mTextureCoordStage(0), 63 mTextureCoordStage(0),
@@ -72,8 +73,7 @@ void LLCubeMap::initGL()
72{ 73{
73 llassert(gGLManager.mInited); 74 llassert(gGLManager.mInited);
74 75
75 if (gGLManager.mHasCubeMap 76 if (gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps)
76 && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"))
77 { 77 {
78 mTargets[0] = GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB; 78 mTargets[0] = GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB;
79 mTargets[1] = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB; 79 mTargets[1] = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
@@ -180,9 +180,7 @@ GLuint LLCubeMap::getGLName()
180 180
181void LLCubeMap::bind() 181void LLCubeMap::bind()
182{ 182{
183 if (gGLManager.mHasCubeMap 183 if (gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps)
184 //&& LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")
185 )
186 { 184 {
187 // We assume that if they have cube mapping, they have multitexturing. 185 // We assume that if they have cube mapping, they have multitexturing.
188 if (mTextureStage > 0) 186 if (mTextureStage > 0)
@@ -213,10 +211,7 @@ void LLCubeMap::enable(S32 stage)
213void LLCubeMap::enableTexture(S32 stage) 211void LLCubeMap::enableTexture(S32 stage)
214{ 212{
215 mTextureStage = stage; 213 mTextureStage = stage;
216 if (gGLManager.mHasCubeMap && 214 if (gGLManager.mHasCubeMap && stage >= 0 && LLCubeMap::sUseCubeMaps)
217 stage >= 0
218 //&& LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")
219 )
220 { 215 {
221 if (stage > 0) 216 if (stage > 0)
222 { 217 {
@@ -235,7 +230,7 @@ void LLCubeMap::enableTexture(S32 stage)
235void LLCubeMap::enableTextureCoords(S32 stage) 230void LLCubeMap::enableTextureCoords(S32 stage)
236{ 231{
237 mTextureCoordStage = stage; 232 mTextureCoordStage = stage;
238 if (gGLManager.mHasCubeMap && stage >= 0) 233 if (gGLManager.mHasCubeMap && stage >= 0 && LLCubeMap::sUseCubeMaps)
239 { 234 {
240 if (stage > 0) 235 if (stage > 0)
241 { 236 {
@@ -265,9 +260,7 @@ void LLCubeMap::disable(void)
265 260
266void LLCubeMap::disableTexture(void) 261void LLCubeMap::disableTexture(void)
267{ 262{
268 if (gGLManager.mHasCubeMap && mTextureStage >= 0 263 if (gGLManager.mHasCubeMap && mTextureStage >= 0 && LLCubeMap::sUseCubeMaps)
269 //&& LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")
270 )
271 { 264 {
272 if (mTextureStage > 0) 265 if (mTextureStage > 0)
273 { 266 {
@@ -284,7 +277,7 @@ void LLCubeMap::disableTexture(void)
284 277
285void LLCubeMap::disableTextureCoords(void) 278void LLCubeMap::disableTextureCoords(void)
286{ 279{
287 if (gGLManager.mHasCubeMap && mTextureCoordStage >= 0) 280 if (gGLManager.mHasCubeMap && mTextureCoordStage >= 0 && LLCubeMap::sUseCubeMaps)
288 { 281 {
289 if (mTextureCoordStage > 0) 282 if (mTextureCoordStage > 0)
290 { 283 {