summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/pipeline.h')
-rw-r--r--indra/newview/pipeline.h134
1 files changed, 112 insertions, 22 deletions
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 8f6867aa01..ce50a37405 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -150,6 +150,8 @@ public:
void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE);
void markShift(LLDrawable *drawablep);
void markTextured(LLDrawable *drawablep);
+ void markGLRebuild(LLGLUpdate* glu);
+ void markRebuild(LLSpatialGroup* group, BOOL priority = FALSE);
void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE);
//get the object between start and end that's closest to start.
@@ -200,10 +202,14 @@ public:
void updateMove();
BOOL visibleObjectsInFrustum(LLCamera& camera);
BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max);
+ BOOL getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir = LLVector3(0,0,0));
void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0); //if water_clip is 0, ignore water plane, 1, cull to above plane, -1, cull to below plane
void createObjects(F32 max_dtime);
void createObject(LLViewerObject* vobj);
void updateGeom(F32 max_dtime);
+ void updateGL();
+ void rebuildPriorityGroups();
+ void rebuildGroups();
//calculate pixel area of given box from vantage point of given camera
static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
@@ -224,12 +230,21 @@ public:
void renderGeomDeferred(LLCamera& camera);
void renderGeomPostDeferred(LLCamera& camera);
void renderGeomShadow(LLCamera& camera);
- void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0);
+ void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, LLRenderTarget* gi_source = NULL, LLRenderTarget* last_gi_post = NULL, U32 noise_map = 0xFFFFFFFF);
+ void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep);
+
void unbindDeferredShader(LLGLSLShader& shader);
void renderDeferredLighting();
void generateWaterReflection(LLCamera& camera);
void generateSunShadow(LLCamera& camera);
+ void generateHighlight(LLCamera& camera);
+ void renderHighlight(const LLViewerObject* obj, F32 fade);
+ void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; }
+
+
+ void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, BOOL use_shader = TRUE, BOOL use_occlusion = TRUE);
+ void generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc);
void renderHighlights();
void renderDebug();
@@ -324,23 +339,35 @@ public:
enum LLRenderTypeMask
{
// Following are pool types (some are also object types)
- RENDER_TYPE_SKY = LLDrawPool::POOL_SKY,
- RENDER_TYPE_WL_SKY = LLDrawPool::POOL_WL_SKY,
- RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND,
- RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN,
- RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE,
- RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS,
- RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT,
- RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP,
- RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
- RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
- RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE,
- RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
- RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
- RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW,
-
+ RENDER_TYPE_SKY = LLDrawPool::POOL_SKY,
+ RENDER_TYPE_WL_SKY = LLDrawPool::POOL_WL_SKY,
+ RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND,
+ RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN,
+ RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE,
+ RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS,
+ RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT,
+ RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP,
+ RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
+ RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
+ RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE,
+ RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
+ RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
+ RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW,
+ RENDER_TYPE_PASS_SIMPLE = LLRenderPass::PASS_SIMPLE,
+ RENDER_TYPE_PASS_GRASS = LLRenderPass::PASS_GRASS,
+ RENDER_TYPE_PASS_FULLBRIGHT = LLRenderPass::PASS_FULLBRIGHT,
+ RENDER_TYPE_PASS_INVISIBLE = LLRenderPass::PASS_INVISIBLE,
+ RENDER_TYPE_PASS_INVISI_SHINY = LLRenderPass::PASS_INVISI_SHINY,
+ RENDER_TYPE_PASS_FULLBRIGHT_SHINY = LLRenderPass::PASS_FULLBRIGHT_SHINY,
+ RENDER_TYPE_PASS_SHINY = LLRenderPass::PASS_SHINY,
+ RENDER_TYPE_PASS_BUMP = LLRenderPass::PASS_BUMP,
+ RENDER_TYPE_PASS_GLOW = LLRenderPass::PASS_GLOW,
+ RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA,
+ RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK,
+ RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK,
+ RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW,
// Following are object types (only used in drawable mRenderType)
- RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES,
+ RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES,
RENDER_TYPE_VOLUME,
RENDER_TYPE_PARTICLES,
RENDER_TYPE_CLOUDS,
@@ -383,7 +410,8 @@ public:
RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000,
RENDER_DEBUG_SCULPTED = 0x0080000,
RENDER_DEBUG_AVATAR_VOLUME = 0x0100000,
- RENDER_DEBUG_AGENT_TARGET = 0x0200000,
+ RENDER_DEBUG_BUILD_QUEUE = 0x0200000,
+ RENDER_DEBUG_AGENT_TARGET = 0x0400000,
};
public:
@@ -423,7 +451,6 @@ public:
static BOOL sUseFBO;
static BOOL sUseFarClip;
static BOOL sShadowRender;
- static BOOL sSkipUpdate; //skip lod updates
static BOOL sWaterReflections;
static BOOL sDynamicLOD;
static BOOL sPickAvatar;
@@ -437,19 +464,47 @@ public:
static BOOL sRenderAttachedParticles;
static BOOL sRenderDeferred;
static S32 sVisibleLightCount;
+ static F32 sMinRenderSize;
//screen texture
LLRenderTarget mScreen;
+ LLRenderTarget mUIScreen;
LLRenderTarget mDeferredScreen;
- LLRenderTarget mDeferredLight[2];
+ LLRenderTarget mEdgeMap;
+ LLRenderTarget mDeferredDepth;
+ LLRenderTarget mDeferredLight[3];
LLMultisampleBuffer mSampleBuffer;
+ LLRenderTarget mGIMap;
+ LLRenderTarget mGIMapPost[2];
+ LLRenderTarget mLuminanceMap;
+ LLRenderTarget mHighlight;
//sun shadow map
- LLRenderTarget mSunShadow[4];
+ LLRenderTarget mShadow[6];
+ std::vector<LLVector3> mShadowFrustPoints[4];
+ LLVector4 mShadowError;
+ LLVector4 mShadowFOV;
+ LLVector3 mShadowFrustOrigin[4];
LLCamera mShadowCamera[8];
LLVector3 mShadowExtents[4][2];
- glh::matrix4f mSunShadowMatrix[4];
+ glh::matrix4f mSunShadowMatrix[6];
+ glh::matrix4f mShadowModelview[6];
+ glh::matrix4f mShadowProjection[6];
+ glh::matrix4f mGIMatrix;
+ glh::matrix4f mGIMatrixProj;
+ glh::matrix4f mGIModelview;
+ glh::matrix4f mGIProjection;
+ glh::matrix4f mGINormalMatrix;
+ glh::matrix4f mGIInvProj;
+ LLVector2 mGIRange;
+ F32 mGILightRadius;
+
+ LLPointer<LLDrawable> mShadowSpotLight[2];
+ F32 mSpotLightFade[2];
+ LLPointer<LLDrawable> mTargetShadowSpotLight[2];
+
LLVector4 mSunClipPlanes;
+ LLVector4 mSunOrthoClipPlanes;
LLVector2 mScreenScale;
@@ -464,6 +519,8 @@ public:
//noise map
U32 mNoiseMap;
+ U32 mTrueNoiseMap;
+ U32 mLightFunc;
LLColor4 mSunDiffuse;
LLVector3 mSunDir;
@@ -524,12 +581,45 @@ protected:
//
LLDrawable::drawable_list_t mBuildQ1; // priority
LLDrawable::drawable_list_t mBuildQ2; // non-priority
+ LLSpatialGroup::sg_list_t mGroupQ1; //priority
+ LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority
+
LLViewerObject::vobj_list_t mCreateQ;
LLDrawable::drawable_set_t mActiveQ;
LLDrawable::drawable_set_t mRetexturedList;
+ class HighlightItem
+ {
+ public:
+ const LLPointer<LLDrawable> mItem;
+ mutable F32 mFade;
+
+ HighlightItem(LLDrawable* item)
+ : mItem(item), mFade(0)
+ {
+ }
+
+ bool operator<(const HighlightItem& rhs) const
+ {
+ return mItem < rhs.mItem;
+ }
+
+ bool operator==(const HighlightItem& rhs) const
+ {
+ return mItem == rhs.mItem;
+ }
+
+ void incrFade(F32 val) const
+ {
+ mFade = llclamp(mFade+val, 0.f, 1.f);
+ }
+ };
+
+ std::set<HighlightItem> mHighlightSet;
+ LLPointer<LLDrawable> mHighlightObject;
+
//////////////////////////////////////////////////
//
// Draw pools are responsible for storing all rendered data,