summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolsimple.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-21 19:36:11 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-21 19:36:11 +0000
commitc93c38e047836e31dd34e33391a997d883777ae1 (patch)
treeccb52c02f9a3bfeb76254e128abc250e7fd5a962 /indra/newview/lldrawpoolsimple.cpp
parentfceae96eb171be0396512e251aab311d4e3ef9cc (diff)
svn merge -r 59178:59364 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/newview/lldrawpoolsimple.cpp')
-rw-r--r--indra/newview/lldrawpoolsimple.cpp96
1 files changed, 69 insertions, 27 deletions
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 8fc3b98908..4c09cd4095 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -9,43 +9,91 @@
#include "llviewerprecompiledheaders.h"
#include "lldrawpoolsimple.h"
+#include "lldrawpoolbump.h"
+#include "llviewercamera.h"
#include "llagent.h"
#include "lldrawable.h"
#include "llface.h"
#include "llsky.h"
#include "pipeline.h"
-class LLRenderPassGlow : public LLRenderPass
+class LLRenderShinyGlow : public LLDrawPoolBump
{
public:
- LLRenderPassGlow(): LLRenderPass(LLRenderPass::PASS_GLOW) { }
+ LLRenderShinyGlow() { }
- enum
+ void render(S32 pass = 0)
{
- VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
- LLVertexBuffer::MAP_TEXCOORD
- };
-
- virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
+ LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap();
+ if( cube_map )
+ {
+ cube_map->enable(0);
+ cube_map->setMatrix(0);
+ cube_map->bind();
+ glEnableClientState(GL_NORMAL_ARRAY);
+
+ glColor4f(1,1,1,1);
+
+ U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL;
+ renderStatic(LLRenderPass::PASS_SHINY, mask);
+ renderActive(LLRenderPass::PASS_SHINY, mask);
+
+ glDisableClientState(GL_NORMAL_ARRAY);
+ cube_map->disable();
+ cube_map->restoreMatrix();
+ }
+ }
+};
- virtual void prerender() { }
+void LLDrawPoolGlow::render(S32 pass)
+{
+ LLGLEnable blend(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+ gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
+ renderActive(LLRenderPass::PASS_GLOW, getVertexDataMask());
- void render(S32 pass = 0)
+ if (gSky.mVOSkyp)
{
- LLGLEnable blend(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
- renderActive(LLRenderPass::PASS_GLOW, getVertexDataMask());
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glPushMatrix();
+ LLVector3 origin = gCamera->getOrigin();
+ glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
+
+ LLFace* facep = gSky.mVOSkyp->mFace[LLVOSky::FACE_BLOOM];
+
+ if (facep)
+ {
+ LLGLDisable cull(GL_CULL_FACE);
+ facep->getTexture()->bind();
+ glColor4f(1,1,1,1);
+ facep->renderIndexed(getVertexDataMask());
+ }
+
+ glPopMatrix();
}
- void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE)
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ if (LLPipeline::sDynamicReflections)
{
- glColor4ubv(params.mGlowColor.mV);
- LLRenderPass::pushBatch(params, mask, texture);
+ LLRenderShinyGlow glow;
+ glow.render();
}
-};
+
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+}
+
+void LLDrawPoolGlow::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
+{
+ glColor4ubv(params.mGlowColor.mV);
+ LLRenderPass::pushBatch(params, mask, texture);
+}
+
LLDrawPoolSimple::LLDrawPoolSimple() :
LLRenderPass(POOL_SIMPLE)
@@ -98,20 +146,14 @@ void LLDrawPoolSimple::render(S32 pass)
}
{
- LLFastTimer t(LLFastTimer::FTM_RENDER_GLOW);
- glDisableClientState(GL_COLOR_ARRAY);
- LLRenderPassGlow glow;
- glow.render();
- }
-
- {
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
+ glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
renderInvisible(invisi_mask);
renderActive(LLRenderPass::PASS_INVISIBLE, invisi_mask);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
}
}