aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/pipeline.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/pipeline.h')
-rw-r--r--linden/indra/newview/pipeline.h98
1 files changed, 90 insertions, 8 deletions
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index 3f3309a..7c56375 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -129,6 +129,8 @@ public:
129 void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); 129 void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE);
130 void markShift(LLDrawable *drawablep); 130 void markShift(LLDrawable *drawablep);
131 void markTextured(LLDrawable *drawablep); 131 void markTextured(LLDrawable *drawablep);
132 void markGLRebuild(LLGLUpdate* glu);
133 void markRebuild(LLSpatialGroup* group, BOOL priority = FALSE);
132 void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); 134 void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE);
133 135
134 //get the object between start and end that's closest to start. 136 //get the object between start and end that's closest to start.
@@ -179,10 +181,14 @@ public:
179 void updateMove(); 181 void updateMove();
180 BOOL visibleObjectsInFrustum(LLCamera& camera); 182 BOOL visibleObjectsInFrustum(LLCamera& camera);
181 BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); 183 BOOL getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max);
184 BOOL getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir = LLVector3(0,0,0));
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 185 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); 186 void createObjects(F32 max_dtime);
184 void createObject(LLViewerObject* vobj); 187 void createObject(LLViewerObject* vobj);
185 void updateGeom(F32 max_dtime); 188 void updateGeom(F32 max_dtime);
189 void updateGL();
190 void rebuildPriorityGroups();
191 void rebuildGroups();
186 192
187 //calculate pixel area of given box from vantage point of given camera 193 //calculate pixel area of given box from vantage point of given camera
188 static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); 194 static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
@@ -203,12 +209,21 @@ public:
203 void renderGeomDeferred(LLCamera& camera); 209 void renderGeomDeferred(LLCamera& camera);
204 void renderGeomPostDeferred(LLCamera& camera); 210 void renderGeomPostDeferred(LLCamera& camera);
205 void renderGeomShadow(LLCamera& camera); 211 void renderGeomShadow(LLCamera& camera);
206 void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0); 212 void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, LLRenderTarget* gi_source = NULL, LLRenderTarget* last_gi_post = NULL);
213 void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep);
214
207 void unbindDeferredShader(LLGLSLShader& shader); 215 void unbindDeferredShader(LLGLSLShader& shader);
208 void renderDeferredLighting(); 216 void renderDeferredLighting();
209 217
210 void generateWaterReflection(LLCamera& camera); 218 void generateWaterReflection(LLCamera& camera);
211 void generateSunShadow(LLCamera& camera); 219 void generateSunShadow(LLCamera& camera);
220 void generateHighlight(LLCamera& camera);
221 void renderHighlight(const LLViewerObject* obj, F32 fade);
222 void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; }
223
224
225 void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, BOOL use_shader = TRUE);
226 void generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<LLVector3>& vpc); // KL sd
212 void renderHighlights(); 227 void renderHighlights();
213 void renderDebug(); 228 void renderDebug();
214 229
@@ -318,13 +333,25 @@ public:
318 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, 333 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
319 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, 334 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
320 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, 335 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW,
321 336 RENDER_TYPE_PASS_SIMPLE = LLRenderPass::PASS_SIMPLE,
337 RENDER_TYPE_PASS_GRASS = LLRenderPass::PASS_GRASS,
338 RENDER_TYPE_PASS_FULLBRIGHT = LLRenderPass::PASS_FULLBRIGHT,
339 RENDER_TYPE_PASS_INVISIBLE = LLRenderPass::PASS_INVISIBLE,
340 RENDER_TYPE_PASS_INVISI_SHINY = LLRenderPass::PASS_INVISI_SHINY,
341 RENDER_TYPE_PASS_FULLBRIGHT_SHINY = LLRenderPass::PASS_FULLBRIGHT_SHINY,
342 RENDER_TYPE_PASS_SHINY = LLRenderPass::PASS_SHINY,
343 RENDER_TYPE_PASS_BUMP = LLRenderPass::PASS_BUMP,
344 RENDER_TYPE_PASS_GLOW = LLRenderPass::PASS_GLOW,
345 RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA,
346 RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK,
347 RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK,
348 RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW,
322 // Following are object types (only used in drawable mRenderType) 349 // Following are object types (only used in drawable mRenderType)
323 RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES, 350 RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES,
324 RENDER_TYPE_VOLUME, 351 RENDER_TYPE_VOLUME,
325 RENDER_TYPE_PARTICLES, 352 RENDER_TYPE_PARTICLES,
326 RENDER_TYPE_CLOUDS, 353 RENDER_TYPE_CLOUDS,
327 RENDER_TYPE_HUD_PARTICLES 354 RENDER_TYPE_HUD_PARTICLES // KL S19?
328 }; 355 };
329 356
330 enum LLRenderDebugFeatureMask 357 enum LLRenderDebugFeatureMask
@@ -362,8 +389,7 @@ public:
362 RENDER_DEBUG_SHAME = 0x0020000, 389 RENDER_DEBUG_SHAME = 0x0020000,
363 RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000, 390 RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000,
364 RENDER_DEBUG_SCULPTED = 0x0080000, 391 RENDER_DEBUG_SCULPTED = 0x0080000,
365 RENDER_DEBUG_AVATAR_VOLUME = 0x0100000, 392 RENDER_DEBUG_BUILD_QUEUE = 0x0100000,
366 RENDER_DEBUG_AGENT_TARGET = 0x0200000,
367 }; 393 };
368 394
369public: 395public:
@@ -422,15 +448,36 @@ public:
422 //screen texture 448 //screen texture
423 LLRenderTarget mScreen; 449 LLRenderTarget mScreen;
424 LLRenderTarget mDeferredScreen; 450 LLRenderTarget mDeferredScreen;
425 LLRenderTarget mDeferredLight[2]; 451 LLRenderTarget mDeferredDepth;
452 LLRenderTarget mDeferredLight[3];
426 LLMultisampleBuffer mSampleBuffer; 453 LLMultisampleBuffer mSampleBuffer;
454 LLRenderTarget mGIMap;
455 LLRenderTarget mGIMapPost[2];
456 LLRenderTarget mLuminanceMap;
457 LLRenderTarget mHighlight;
427 458
428 //sun shadow map 459 //sun shadow map
429 LLRenderTarget mSunShadow[4]; 460 LLRenderTarget mShadow[6];
461 std::vector<LLVector3> mShadowFrustPoints[4];
462 LLVector4 mShadowError;
463 LLVector4 mShadowFOV;
464 LLVector3 mShadowFrustOrigin[4];
430 LLCamera mShadowCamera[8]; 465 LLCamera mShadowCamera[8];
431 LLVector3 mShadowExtents[4][2]; 466 LLVector3 mShadowExtents[4][2];
432 glh::matrix4f mSunShadowMatrix[4]; 467 glh::matrix4f mSunShadowMatrix[6];
468 glh::matrix4f mGIMatrix;
469 glh::matrix4f mGIMatrixProj;
470 glh::matrix4f mGINormalMatrix;
471 glh::matrix4f mGIInvProj;
472 LLVector2 mGIRange;
473 F32 mGILightRadius;
474
475 LLPointer<LLDrawable> mShadowSpotLight[2];
476 F32 mSpotLightFade[2];
477 LLPointer<LLDrawable> mTargetShadowSpotLight[2];
478
433 LLVector4 mSunClipPlanes; 479 LLVector4 mSunClipPlanes;
480 LLVector4 mSunOrthoClipPlanes;
434 481
435 LLVector2 mScreenScale; 482 LLVector2 mScreenScale;
436 483
@@ -445,6 +492,8 @@ public:
445 492
446 //noise map 493 //noise map
447 U32 mNoiseMap; 494 U32 mNoiseMap;
495 U32 mTrueNoiseMap;
496 U32 mLightFunc;
448 497
449 LLColor4 mSunDiffuse; 498 LLColor4 mSunDiffuse;
450 LLVector3 mSunDir; 499 LLVector3 mSunDir;
@@ -505,12 +554,45 @@ protected:
505 // 554 //
506 LLDrawable::drawable_list_t mBuildQ1; // priority 555 LLDrawable::drawable_list_t mBuildQ1; // priority
507 LLDrawable::drawable_list_t mBuildQ2; // non-priority 556 LLDrawable::drawable_list_t mBuildQ2; // non-priority
557 LLSpatialGroup::sg_list_t mGroupQ1; //priority
558 LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority
559
508 LLViewerObject::vobj_list_t mCreateQ; 560 LLViewerObject::vobj_list_t mCreateQ;
509 561
510 LLDrawable::drawable_set_t mActiveQ; 562 LLDrawable::drawable_set_t mActiveQ;
511 563
512 LLDrawable::drawable_set_t mRetexturedList; 564 LLDrawable::drawable_set_t mRetexturedList;
513 565
566 class HighlightItem
567 {
568 public:
569 const LLPointer<LLDrawable> mItem;
570 mutable F32 mFade;
571
572 HighlightItem(LLDrawable* item)
573 : mItem(item), mFade(0)
574 {
575 }
576
577 bool operator<(const HighlightItem& rhs) const
578 {
579 return mItem < rhs.mItem;
580 }
581
582 bool operator==(const HighlightItem& rhs) const
583 {
584 return mItem == rhs.mItem;
585 }
586
587 void incrFade(F32 val) const
588 {
589 mFade = llclamp(mFade+val, 0.f, 1.f);
590 }
591 };
592
593 std::set<HighlightItem> mHighlightSet;
594 LLPointer<LLDrawable> mHighlightObject;
595
514 ////////////////////////////////////////////////// 596 //////////////////////////////////////////////////
515 // 597 //
516 // Draw pools are responsible for storing all rendered data, 598 // Draw pools are responsible for storing all rendered data,