Catching up with Lindies part 2

This commit is contained in:
Siana Gearz
2012-03-25 09:38:36 +02:00
parent 196e9d6c78
commit 3f0f955a76
113 changed files with 801 additions and 516 deletions

View File

@@ -129,8 +129,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
@@ -144,9 +152,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);
@@ -212,6 +220,13 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
return TRUE;
}
bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete();
if (use_fbo)
{
gPipeline.mWaterDis.bindTarget();
}
LLGLSLShader::bindNoShader();
LLVertexBuffer::unbind();
@@ -245,6 +260,11 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
}
}
if (use_fbo)
{
gPipeline.mWaterDis.flush();
}
return ret;
}