aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/pipeline.h
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/pipeline.h
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/pipeline.h')
-rw-r--r--linden/indra/newview/pipeline.h108
1 files changed, 67 insertions, 41 deletions
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index e57ad7e..0ec4e43 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -56,6 +57,7 @@ class LLRenderFunc;
56class LLCubeMap; 57class LLCubeMap;
57class LLCullResult; 58class LLCullResult;
58class LLVOAvatar; 59class LLVOAvatar;
60class LLGLSLShader;
59 61
60typedef enum e_avatar_skinning_method 62typedef enum e_avatar_skinning_method
61{ 63{
@@ -74,6 +76,7 @@ glh::matrix4f glh_get_current_projection();
74void glh_set_current_projection(glh::matrix4f& mat); 76void glh_set_current_projection(glh::matrix4f& mat);
75glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar); 77glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar);
76glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar); 78glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
79glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up);
77 80
78class LLPipeline 81class LLPipeline
79{ 82{
@@ -87,14 +90,13 @@ public:
87 void resizeScreenTexture(); 90 void resizeScreenTexture();
88 void releaseGLBuffers(); 91 void releaseGLBuffers();
89 void createGLBuffers(); 92 void createGLBuffers();
93 void allocateScreenBuffer(U32 resX, U32 resY);
90 94
91 void resetVertexBuffers(LLDrawable* drawable); 95 void resetVertexBuffers(LLDrawable* drawable);
92 void setUseVBO(BOOL use_vbo); 96 void setUseVBO(BOOL use_vbo);
93 void generateImpostor(LLVOAvatar* avatar); 97 void generateImpostor(LLVOAvatar* avatar);
94 void generateReflectionMap(LLCubeMap* cube_map, LLCamera& camera);
95 void blurReflectionMap(LLCubeMap* cube_in, LLCubeMap* cube_out);
96 void bindScreenToTexture(); 98 void bindScreenToTexture();
97 void renderBloom(BOOL for_snapshot); 99 void renderBloom(BOOL for_snapshot, F32 zoom_factor = 1.f, int subfield = 0);
98 100
99 void init(); 101 void init();
100 void cleanup(); 102 void cleanup();
@@ -175,7 +177,11 @@ public:
175 void updateMoveNormalAsync(LLDrawable* drawablep); 177 void updateMoveNormalAsync(LLDrawable* drawablep);
176 void updateMovedList(LLDrawable::drawable_vector_t& move_list); 178 void updateMovedList(LLDrawable::drawable_vector_t& move_list);
177 void updateMove(); 179 void updateMove();
180 BOOL visibleObjectsInFrustum(LLCamera& camera);
181 BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max);
178 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 182 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
183 void createObjects(F32 max_dtime);
184 void createObject(LLViewerObject* vobj);
179 void updateGeom(F32 max_dtime); 185 void updateGeom(F32 max_dtime);
180 186
181 //calculate pixel area of given box from vantage point of given camera 187 //calculate pixel area of given box from vantage point of given camera
@@ -194,9 +200,15 @@ public:
194 void grabReferences(LLCullResult& result); 200 void grabReferences(LLCullResult& result);
195 201
196 void renderGeom(LLCamera& camera, BOOL forceVBOUpdate = FALSE); 202 void renderGeom(LLCamera& camera, BOOL forceVBOUpdate = FALSE);
197 void renderGeomDeferred(); 203 void renderGeomDeferred(LLCamera& camera);
198 204 void renderGeomPostDeferred(LLCamera& camera);
205 void renderGeomShadow(LLCamera& camera);
206 void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0);
207 void unbindDeferredShader(LLGLSLShader& shader);
208 void renderDeferredLighting();
209
199 void generateWaterReflection(LLCamera& camera); 210 void generateWaterReflection(LLCamera& camera);
211 void generateSunShadow(LLCamera& camera);
200 void renderHighlights(); 212 void renderHighlights();
201 void renderDebug(); 213 void renderDebug();
202 214
@@ -229,7 +241,7 @@ public:
229 LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type); 241 LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type);
230 LLCullResult::sg_list_t::iterator beginAlphaGroups(); 242 LLCullResult::sg_list_t::iterator beginAlphaGroups();
231 LLCullResult::sg_list_t::iterator endAlphaGroups(); 243 LLCullResult::sg_list_t::iterator endAlphaGroups();
232 244
233 void addTrianglesDrawn(S32 count); 245 void addTrianglesDrawn(S32 count);
234 BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } 246 BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; }
235 BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } 247 BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; }
@@ -275,6 +287,8 @@ public:
275 static void toggleRenderHighlights(void* data); 287 static void toggleRenderHighlights(void* data);
276 static BOOL getRenderHighlights(void* data); 288 static BOOL getRenderHighlights(void* data);
277 289
290 static void updateRenderDeferred();
291
278private: 292private:
279 void unloadShaders(); 293 void unloadShaders();
280 void addToQuickLookup( LLDrawPool* new_poolp ); 294 void addToQuickLookup( LLDrawPool* new_poolp );
@@ -294,6 +308,8 @@ public:
294 RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, 308 RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND,
295 RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, 309 RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN,
296 RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, 310 RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE,
311 RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS,
312 RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT,
297 RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, 313 RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP,
298 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, 314 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
299 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, 315 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
@@ -305,7 +321,6 @@ public:
305 // Following are object types (only used in drawable mRenderType) 321 // Following are object types (only used in drawable mRenderType)
306 RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES, 322 RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES,
307 RENDER_TYPE_VOLUME, 323 RENDER_TYPE_VOLUME,
308 RENDER_TYPE_GRASS,
309 RENDER_TYPE_PARTICLES, 324 RENDER_TYPE_PARTICLES,
310 RENDER_TYPE_CLOUDS, 325 RENDER_TYPE_CLOUDS,
311 }; 326 };
@@ -325,24 +340,28 @@ public:
325 340
326 enum LLRenderDebugMask 341 enum LLRenderDebugMask
327 { 342 {
328 RENDER_DEBUG_COMPOSITION = 0x000020, 343 RENDER_DEBUG_COMPOSITION = 0x0000001,
329 RENDER_DEBUG_VERIFY = 0x000080, 344 RENDER_DEBUG_VERIFY = 0x0000002,
330 RENDER_DEBUG_BBOXES = 0x000200, 345 RENDER_DEBUG_BBOXES = 0x0000004,
331 RENDER_DEBUG_OCTREE = 0x000400, 346 RENDER_DEBUG_OCTREE = 0x0000008,
332 RENDER_DEBUG_PICKING = 0x000800, 347 RENDER_DEBUG_PICKING = 0x0000010,
333 RENDER_DEBUG_OCCLUSION = 0x001000, 348 RENDER_DEBUG_OCCLUSION = 0x0000020,
334 RENDER_DEBUG_POINTS = 0x002000, 349 RENDER_DEBUG_POINTS = 0x0000040,
335 RENDER_DEBUG_TEXTURE_PRIORITY = 0x004000, 350 RENDER_DEBUG_TEXTURE_PRIORITY = 0x0000080,
336 RENDER_DEBUG_TEXTURE_AREA = 0x008000, 351 RENDER_DEBUG_TEXTURE_AREA = 0x0000100,
337 RENDER_DEBUG_FACE_AREA = 0x010000, 352 RENDER_DEBUG_FACE_AREA = 0x0000200,
338 RENDER_DEBUG_PARTICLES = 0x020000, 353 RENDER_DEBUG_PARTICLES = 0x0000400,
339 RENDER_DEBUG_GLOW = 0x040000, 354 RENDER_DEBUG_GLOW = 0x0000800,
340 RENDER_DEBUG_TEXTURE_ANIM = 0x080000, 355 RENDER_DEBUG_TEXTURE_ANIM = 0x0001000,
341 RENDER_DEBUG_LIGHTS = 0x100000, 356 RENDER_DEBUG_LIGHTS = 0x0002000,
342 RENDER_DEBUG_BATCH_SIZE = 0x200000, 357 RENDER_DEBUG_BATCH_SIZE = 0x0004000,
343 RENDER_DEBUG_RAYCAST = 0x400000, 358 RENDER_DEBUG_ALPHA_BINS = 0x0008000,
344 RENDER_DEBUG_SHAME = 0x800000, 359 RENDER_DEBUG_RAYCAST = 0x0010000,
345 RENDER_DEBUG_SCULPTED = 0x1000000 360 RENDER_DEBUG_SHAME = 0x0020000,
361 RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000,
362 RENDER_DEBUG_SCULPTED = 0x0080000,
363 RENDER_DEBUG_AVATAR_VOLUME = 0x0100000,
364 RENDER_DEBUG_AGENT_TARGET = 0x0200000,
346 }; 365 };
347 366
348public: 367public:
@@ -374,12 +393,15 @@ public:
374 static S32 sCompiles; 393 static S32 sCompiles;
375 394
376 static BOOL sShowHUDAttachments; 395 static BOOL sShowHUDAttachments;
396 static BOOL sForceOldBakedUpload; // If true will not use capabilities to upload baked textures.
377 static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write 397 static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write
398 static BOOL sDelayVBUpdate;
378 static BOOL sFastAlpha; 399 static BOOL sFastAlpha;
379 static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders 400 static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders
380 static BOOL sRenderBump; 401 static BOOL sRenderBump;
381 static BOOL sUseFBO; 402 static BOOL sUseFBO;
382 static BOOL sUseFarClip; 403 static BOOL sUseFarClip;
404 static BOOL sShadowRender;
383 static BOOL sSkipUpdate; //skip lod updates 405 static BOOL sSkipUpdate; //skip lod updates
384 static BOOL sWaterReflections; 406 static BOOL sWaterReflections;
385 static BOOL sDynamicLOD; 407 static BOOL sDynamicLOD;
@@ -392,10 +414,22 @@ public:
392 static BOOL sRenderFrameTest; 414 static BOOL sRenderFrameTest;
393 static BOOL sRenderAttachedLights; 415 static BOOL sRenderAttachedLights;
394 static BOOL sRenderAttachedParticles; 416 static BOOL sRenderAttachedParticles;
395 417 static BOOL sRenderDeferred;
418 static S32 sVisibleLightCount;
419
396 //screen texture 420 //screen texture
397 LLRenderTarget mScreen; 421 LLRenderTarget mScreen;
398 422 LLRenderTarget mDeferredScreen;
423 LLRenderTarget mDeferredLight[2];
424 LLMultisampleBuffer mSampleBuffer;
425
426 //sun shadow map
427 LLRenderTarget mSunShadow[4];
428 LLCamera mShadowCamera[8];
429 LLVector3 mShadowExtents[4][2];
430 glh::matrix4f mSunShadowMatrix[4];
431 LLVector4 mSunClipPlanes;
432
399 LLVector2 mScreenScale; 433 LLVector2 mScreenScale;
400 434
401 //water reflection texture 435 //water reflection texture
@@ -407,20 +441,9 @@ public:
407 //texture for making the glow 441 //texture for making the glow
408 LLRenderTarget mGlow[3]; 442 LLRenderTarget mGlow[3];
409 443
410 //dynamic cube map scratch space 444 //noise map
411 LLPointer<LLCubeMap> mCubeBuffer; 445 U32 mNoiseMap;
412
413 //cube map anti-aliasing buffers
414 GLuint mBlurCubeBuffer[3];
415 GLuint mBlurCubeTexture[3];
416 446
417 //frambuffer object for rendering dynamic cube maps
418 GLuint mCubeFrameBuffer;
419
420 //depth buffer object for rendering dynamic cube maps
421 GLuint mCubeDepth;
422
423
424 LLColor4 mSunDiffuse; 447 LLColor4 mSunDiffuse;
425 LLVector3 mSunDir; 448 LLVector3 mSunDir;
426 449
@@ -480,6 +503,7 @@ protected:
480 // 503 //
481 LLDrawable::drawable_list_t mBuildQ1; // priority 504 LLDrawable::drawable_list_t mBuildQ1; // priority
482 LLDrawable::drawable_list_t mBuildQ2; // non-priority 505 LLDrawable::drawable_list_t mBuildQ2; // non-priority
506 LLViewerObject::vobj_list_t mCreateQ;
483 507
484 LLDrawable::drawable_set_t mActiveQ; 508 LLDrawable::drawable_set_t mActiveQ;
485 509
@@ -524,6 +548,8 @@ protected:
524 LLDrawPool* mWaterPool; 548 LLDrawPool* mWaterPool;
525 LLDrawPool* mGroundPool; 549 LLDrawPool* mGroundPool;
526 LLRenderPass* mSimplePool; 550 LLRenderPass* mSimplePool;
551 LLRenderPass* mGrassPool;
552 LLRenderPass* mFullbrightPool;
527 LLDrawPool* mInvisiblePool; 553 LLDrawPool* mInvisiblePool;
528 LLDrawPool* mGlowPool; 554 LLDrawPool* mGlowPool;
529 LLDrawPool* mBumpPool; 555 LLDrawPool* mBumpPool;