From 536e38ad51b89808f26d8e3cd107fe093862d22a Mon Sep 17 00:00:00 2001 From: David Parks Date: Tue, 22 Sep 2009 11:11:45 +0000 Subject: Merging render-pipeline-6-qa-2 into viewer-2 Self reviewed. --- indra/newview/llsurface.cpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'indra/newview/llsurface.cpp') diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index de3d80f044..39f6a6c396 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -214,7 +214,7 @@ void LLSurface::create(const S32 grids_per_edge, LLViewerTexture* LLSurface::getSTexture() { - if (mSTexturep.notNull() && !mSTexturep->hasValidGLTexture()) + if (mSTexturep.notNull() && !mSTexturep->hasGLTexture()) { createSTexture(); } @@ -223,7 +223,7 @@ LLViewerTexture* LLSurface::getSTexture() LLViewerTexture* LLSurface::getWaterTexture() { - if (mWaterTexturep.notNull() && !mWaterTexturep->hasValidGLTexture()) + if (mWaterTexturep.notNull() && !mWaterTexturep->hasGLTexture()) { createWaterTexture(); } @@ -235,8 +235,13 @@ void LLSurface::createSTexture() if (!mSTexturep) { // Fill with dummy gray data. - LLPointer raw = new LLImageRaw(sTextureSize, sTextureSize, 3); - U8 *default_texture = raw->getData(); + + mSTexturep = LLViewerTextureManager::getLocalTexture(sTextureSize, sTextureSize, 3, FALSE); + mSTexturep->dontDiscard(); + mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + + // GL NOT ACTIVE HERE + /*U8 *default_texture = raw->getData(); for (S32 i = 0; i < sTextureSize; i++) { for (S32 j = 0; j < sTextureSize; j++) @@ -250,7 +255,8 @@ void LLSurface::createSTexture() mSTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mSTexturep->dontDiscard(); gGL.getTexUnit(0)->bind(mSTexturep); - mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);*/ + } } @@ -259,7 +265,7 @@ void LLSurface::createWaterTexture() if (!mWaterTexturep) { // Create the water texture - LLPointer raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); + /*LLPointer raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); U8 *default_texture = raw->getData(); for (S32 i = 0; i < sTextureSize/2; i++) { @@ -270,10 +276,11 @@ void LLSurface::createWaterTexture() *(default_texture + (i*sTextureSize/2 + j)*4 + 2) = MAX_WATER_COLOR.mV[2]; *(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3]; } - } - mWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); + }*/ + + + mWaterTexturep = LLViewerTextureManager::getLocalTexture(sTextureSize/2, sTextureSize/2, 4, FALSE); mWaterTexturep->dontDiscard(); - gGL.getTexUnit(0)->bind(mWaterTexturep); mWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); } } @@ -1189,7 +1196,7 @@ F32 LLSurface::getWaterHeight() const BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, const F32 width, const F32 height) { - if (!getWaterTexture() || !mWaterTexturep->hasGLTexture()) + if (!getWaterTexture()) { return FALSE; } @@ -1273,6 +1280,11 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, } } + if (!mWaterTexturep->hasGLTexture()) + { + mWaterTexturep->createGLTexture(0, raw); + } + mWaterTexturep->setSubImage(raw, x_begin, y_begin, x_end - x_begin, y_end - y_begin); return TRUE; } -- cgit v1.2.3 From 5ea4952ca547d63c22402cc793dc81e63c52c6bd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Sep 2009 01:27:21 +0000 Subject: fix for EXT-1108: Green terrain rendering on login on Windows nVidia 9600 GT. to be reviewed by davep. --- indra/newview/llsurface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llsurface.cpp') diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 39f6a6c396..eadb311919 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -236,12 +236,13 @@ void LLSurface::createSTexture() { // Fill with dummy gray data. - mSTexturep = LLViewerTextureManager::getLocalTexture(sTextureSize, sTextureSize, 3, FALSE); - mSTexturep->dontDiscard(); - mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); + //mSTexturep = LLViewerTextureManager::getLocalTexture(sTextureSize, sTextureSize, 3, FALSE); + //mSTexturep->dontDiscard(); + //mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); // GL NOT ACTIVE HERE - /*U8 *default_texture = raw->getData(); + LLPointer raw = new LLImageRaw(sTextureSize, sTextureSize, 3); + U8 *default_texture = raw->getData(); for (S32 i = 0; i < sTextureSize; i++) { for (S32 j = 0; j < sTextureSize; j++) @@ -255,8 +256,7 @@ void LLSurface::createSTexture() mSTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mSTexturep->dontDiscard(); gGL.getTexUnit(0)->bind(mSTexturep); - mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);*/ - + mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); } } -- cgit v1.2.3 From 5433dbee39988fdbe3f2f99510d1a136d5cd61c8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Sep 2009 21:04:57 +0000 Subject: fix for EXT-1125: Mini-map terrain appears green on login with Low graphics settings. --- indra/newview/llsurface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llsurface.cpp') diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index eadb311919..5440b2c9ad 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -265,7 +265,7 @@ void LLSurface::createWaterTexture() if (!mWaterTexturep) { // Create the water texture - /*LLPointer raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); + LLPointer raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4); U8 *default_texture = raw->getData(); for (S32 i = 0; i < sTextureSize/2; i++) { @@ -276,11 +276,11 @@ void LLSurface::createWaterTexture() *(default_texture + (i*sTextureSize/2 + j)*4 + 2) = MAX_WATER_COLOR.mV[2]; *(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3]; } - }*/ + } - - mWaterTexturep = LLViewerTextureManager::getLocalTexture(sTextureSize/2, sTextureSize/2, 4, FALSE); + mWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mWaterTexturep->dontDiscard(); + gGL.getTexUnit(0)->bind(mWaterTexturep); mWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); } } -- cgit v1.2.3