diff options
author | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 |
commit | d3ec35fc6c2b8b47336650fe0570995201854a78 (patch) | |
tree | f2113a1fa374fab76509f4462b2253b315584f65 /indra/newview/lldynamictexture.cpp | |
parent | 4c3377a45abe3c8b2a0e376c62045a8f1260da08 (diff) | |
parent | 19e0cc93a8af661dbac47552474a704ade600c74 (diff) |
merge changes for latest viewer-development
Diffstat (limited to 'indra/newview/lldynamictexture.cpp')
-rw-r--r-- | indra/newview/lldynamictexture.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 5d6081a35c..a93b2b71de 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,8 +125,16 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { - { - // force rendering to on-screen portion of frame buffer + //only images up to 512x512 are supported + llassert(mFullHeight <= 512); + llassert(mFullWidth <= 512); + + if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete()) + { //using offscreen render target, just use the bottom left corner + mOrigin.set(0, 0); + } + else + { // force rendering to on-screen portion of frame buffer LLCoordScreen window_pos; gViewerWindow->getWindow()->getPosition( &window_pos ); mOrigin.set(0, gViewerWindow->getWindowHeightRaw() - mFullHeight); // top left corner @@ -140,9 +148,9 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) mOrigin.mY += window_pos.mY; mOrigin.mY = llmax(mOrigin.mY, 0) ; } - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Set up camera LLViewerCamera* camera = LLViewerCamera::getInstance(); mCamera.setOrigin(*camera); @@ -208,6 +216,13 @@ BOOL LLViewerDynamicTexture::updateAllInstances() return TRUE; } + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete(); + + if (use_fbo) + { + gPipeline.mWaterDis.bindTarget(); + } + LLGLSLShader::bindNoShader(); LLVertexBuffer::unbind(); @@ -241,6 +256,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances() } } + if (use_fbo) + { + gPipeline.mWaterDis.flush(); + } + return ret; } |