summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-03-07 01:16:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-03-07 01:16:27 +0000
commitc4059553afa289f51f9966b4283b2a62b7103303 (patch)
tree3b1a18de62fc258b847f264ff66d464d8be15034
parent3d17ddd38baa9fd862114e6f90ce3ce809780b4f (diff)
SKIPPED 58849. merge -r 58856:58859 maintenance -> release
-rw-r--r--indra/llcommon/llfasttimer.h1
-rw-r--r--indra/newview/lldrawpool.h1
-rw-r--r--indra/newview/lldrawpoolsimple.cpp41
-rw-r--r--indra/newview/llfasttimerview.cpp1
-rw-r--r--indra/newview/llspatialpartition.h1
-rw-r--r--indra/newview/llviewerobject.cpp12
-rw-r--r--indra/newview/llvovolume.cpp30
7 files changed, 78 insertions, 9 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 1a7e60656c..16af098ed5 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -51,6 +51,7 @@ public:
FTM_RENDER_TERRAIN,
FTM_RENDER_SIMPLE,
FTM_RENDER_FULLBRIGHT,
+ FTM_RENDER_GLOW,
FTM_RENDER_GRASS,
FTM_RENDER_INVISIBLE,
FTM_RENDER_SHINY,
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 007c0a2de3..f7243f369b 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -87,6 +87,7 @@ public:
{
PASS_SIMPLE = NUM_POOL_TYPES,
PASS_FULLBRIGHT,
+ PASS_GLOW,
PASS_INVISIBLE,
PASS_SHINY,
PASS_BUMP,
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index fcd466bfc4..8fc3b98908 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -16,6 +16,37 @@
#include "llsky.h"
#include "pipeline.h"
+class LLRenderPassGlow : public LLRenderPass
+{
+public:
+ LLRenderPassGlow(): LLRenderPass(LLRenderPass::PASS_GLOW) { }
+
+ enum
+ {
+ VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
+ LLVertexBuffer::MAP_TEXCOORD
+ };
+
+ virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
+
+ virtual void prerender() { }
+
+ void render(S32 pass = 0)
+ {
+ 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);
+ }
+
+ void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE)
+ {
+ glColor4ubv(params.mGlowColor.mV);
+ LLRenderPass::pushBatch(params, mask, texture);
+ }
+};
+
LLDrawPoolSimple::LLDrawPoolSimple() :
LLRenderPass(POOL_SIMPLE)
{
@@ -56,7 +87,7 @@ void LLDrawPoolSimple::render(S32 pass)
LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask());
glAlphaFunc(GL_GREATER, 0.01f);
}
-
+
{
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR;
@@ -67,10 +98,16 @@ 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_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
renderInvisible(invisi_mask);
renderActive(LLRenderPass::PASS_INVISIBLE, invisi_mask);
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 77e96fa73b..85b8bbebd4 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -143,6 +143,7 @@ static struct ft_display_info ft_display_table[] =
{ LLFastTimer::FTM_RENDER_CHARACTERS, " Avatars", &LLColor4::yellow1, 0 },
{ LLFastTimer::FTM_RENDER_SIMPLE, " Simple", &LLColor4::yellow2, 0 },
{ LLFastTimer::FTM_RENDER_FULLBRIGHT, " Fullbright", &LLColor4::yellow5, 0 },
+ { LLFastTimer::FTM_RENDER_GLOW, " Glow", &LLColor4::orange1, 0 },
{ LLFastTimer::FTM_RENDER_GRASS, " Grass", &LLColor4::yellow6, 0 },
{ LLFastTimer::FTM_RENDER_INVISIBLE, " Invisible", &LLColor4::red2, 0 },
{ LLFastTimer::FTM_RENDER_SHINY, " Shiny", &LLColor4::yellow3, 0 },
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 10312ba0e6..ea0802985e 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -36,6 +36,7 @@ public:
LLPointer<LLVertexBuffer> mVertexBuffer;
LLPointer<LLViewerImage> mTexture;
LLPointer<LLCubeMap> mReflectionMap;
+ LLColor4U mGlowColor;
const LLMatrix4* mTextureMatrix;
U32 mStart;
U32 mEnd;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 615bc1bf4f..6a20aa4a95 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -61,7 +61,6 @@
#include "llvoground.h"
#include "llvolume.h"
#include "llvolumemessage.h"
-#include "llvopart.h"
#include "llvopartgroup.h"
#include "llvosky.h"
#include "llvostars.h"
@@ -105,13 +104,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
case LL_PCODE_LEGACY_GRASS:
res = new LLVOGrass(id, pcode, regionp); break;
case LL_PCODE_LEGACY_PART_SYS:
- res = new LLVOPart(id, pcode, regionp); break;
+// llwarns << "Creating old part sys!" << llendl;
+// res = new LLVOPart(id, pcode, regionp); break;
+ res = NULL; break;
case LL_PCODE_LEGACY_TREE:
res = new LLVOTree(id, pcode, regionp); break;
case LL_PCODE_TREE_NEW:
- llwarns << "Creating new tree!" << llendl;
-// res = new LLVOTree(id, pcode, regionp); break;
- res = NULL; break;
+// llwarns << "Creating new tree!" << llendl;
+// res = new LLVOTree(id, pcode, regionp); break;
+ res = NULL; break;
case LL_PCODE_LEGACY_TEXT_BUBBLE:
res = new LLVOTextBubble(id, pcode, regionp); break;
case LL_VO_CLOUDS:
@@ -404,7 +405,6 @@ void LLViewerObject::initVOClasses()
}
llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl;
LLVOGrass::initClass();
- LLVOPart::initClass();
LLVOWater::initClass();
LLVOSky::initClass();
LLVOVolume::initClass();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2379605803..2d898a1a5d 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1132,6 +1132,8 @@ void LLVOVolume::setLightColor(const LLColor3& color)
{
param_block->setColor(LLColor4(color, param_block->getColor().mV[3]));
parameterChanged(LLNetworkData::PARAMS_LIGHT, true);
+ gPipeline.markTextured(mDrawable);
+ mFaceMappingChanged = TRUE;
}
}
}
@@ -1892,7 +1894,27 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
//LLViewerImage* tex = facep->mAppAngle < FORCE_SIMPLE_RENDER_ANGLE ? NULL : facep->getTexture();
LLViewerImage* tex = facep->getTexture();
- if (idx >= 0 &&
+ if (type == LLRenderPass::PASS_GLOW)
+ {
+ U32 start = facep->getGeomIndex();
+ U32 end = start + facep->getGeomCount()-1;
+ U32 offset = facep->getIndicesStart();
+ U32 count = facep->getIndicesCount();
+ LLDrawInfo* draw_info = new LLDrawInfo(start,end,count,offset,tex,
+ facep->mVertexBuffer, fullbright, bump);
+ draw_info->mVSize = facep->getVirtualSize();
+ draw_vec.push_back(draw_info);
+ LLVOVolume* volume = (LLVOVolume*) facep->getViewerObject();
+ LLColor3 col = volume->getLightColor();
+ LLColor4 col2 = facep->getRenderColor();
+ draw_info->mGlowColor.setVec((U8) (col.mV[0]*col2.mV[0]*255),
+ (U8) (col.mV[1]*col2.mV[1]*255),
+ (U8) (col.mV[2]*col2.mV[2]*255),
+ 196);
+ draw_info->mTextureMatrix = tex_mat;
+ validate_draw_info(*draw_info);
+ }
+ else if (idx >= 0 &&
draw_vec[idx]->mVertexBuffer == facep->mVertexBuffer &&
draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
draw_vec[idx]->mTexture == tex &&
@@ -2197,7 +2219,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
registerFace(group, facep, LLRenderPass::PASS_BUMP);
}
+
+ if (!force_simple && vobj->getIsLight())
+ {
+ registerFace(group, facep, LLRenderPass::PASS_GLOW);
+ }
+
++face_iter;
}