diff options
author | Armin Weatherwax | 2010-09-07 13:41:02 +0200 |
---|---|---|
committer | Armin Weatherwax | 2010-09-23 15:42:40 +0200 |
commit | 087e15e89930d51c3964329befb273ae3b2d330d (patch) | |
tree | 684c49a772b0097ed88a25660e1fd3dd10b264cc /linden/indra/newview/pipeline.h | |
parent | Robin Cornelius: fixes for building plugins on Linux 64bit (diff) | |
download | meta-impy-087e15e89930d51c3964329befb273ae3b2d330d.zip meta-impy-087e15e89930d51c3964329befb273ae3b2d330d.tar.gz meta-impy-087e15e89930d51c3964329befb273ae3b2d330d.tar.bz2 meta-impy-087e15e89930d51c3964329befb273ae3b2d330d.tar.xz |
port of LL renderpipeline/Kirstens S19 pipeline for bridging to Viewer 2 texture system
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/pipeline.h | 128 |
1 files changed, 105 insertions, 23 deletions
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h index 1a32b30..a85877d 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 | ||
@@ -303,27 +318,39 @@ public: | |||
303 | enum LLRenderTypeMask | 318 | enum LLRenderTypeMask |
304 | { | 319 | { |
305 | // Following are pool types (some are also object types) | 320 | // Following are pool types (some are also object types) |
306 | RENDER_TYPE_SKY = LLDrawPool::POOL_SKY, | 321 | RENDER_TYPE_SKY = LLDrawPool::POOL_SKY, |
307 | RENDER_TYPE_WL_SKY = LLDrawPool::POOL_WL_SKY, | 322 | RENDER_TYPE_WL_SKY = LLDrawPool::POOL_WL_SKY, |
308 | RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, | 323 | RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, |
309 | RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, | 324 | RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, |
310 | RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, | 325 | RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, |
311 | RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS, | 326 | RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS, |
312 | RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, | 327 | RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, |
313 | RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, | 328 | RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, |
314 | RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, | 329 | RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, |
315 | RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, | 330 | RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, |
316 | RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, | 331 | RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, |
317 | RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, | 332 | RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, |
318 | RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, | 333 | RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, |
319 | RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, | 334 | RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, |
320 | 335 | RENDER_TYPE_PASS_SIMPLE = LLRenderPass::PASS_SIMPLE, | |
336 | RENDER_TYPE_PASS_GRASS = LLRenderPass::PASS_GRASS, | ||
337 | RENDER_TYPE_PASS_FULLBRIGHT = LLRenderPass::PASS_FULLBRIGHT, | ||
338 | RENDER_TYPE_PASS_INVISIBLE = LLRenderPass::PASS_INVISIBLE, | ||
339 | RENDER_TYPE_PASS_INVISI_SHINY = LLRenderPass::PASS_INVISI_SHINY, | ||
340 | RENDER_TYPE_PASS_FULLBRIGHT_SHINY = LLRenderPass::PASS_FULLBRIGHT_SHINY, | ||
341 | RENDER_TYPE_PASS_SHINY = LLRenderPass::PASS_SHINY, | ||
342 | RENDER_TYPE_PASS_BUMP = LLRenderPass::PASS_BUMP, | ||
343 | RENDER_TYPE_PASS_GLOW = LLRenderPass::PASS_GLOW, | ||
344 | RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA, | ||
345 | RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK, | ||
346 | RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK = LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, | ||
347 | RENDER_TYPE_PASS_ALPHA_SHADOW = LLRenderPass::PASS_ALPHA_SHADOW, | ||
321 | // Following are object types (only used in drawable mRenderType) | 348 | // Following are object types (only used in drawable mRenderType) |
322 | RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES, | 349 | RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, |
323 | RENDER_TYPE_VOLUME, | 350 | RENDER_TYPE_VOLUME, |
324 | RENDER_TYPE_PARTICLES, | 351 | RENDER_TYPE_PARTICLES, |
325 | RENDER_TYPE_CLOUDS, | 352 | RENDER_TYPE_CLOUDS, |
326 | RENDER_TYPE_HUD_PARTICLES | 353 | RENDER_TYPE_HUD_PARTICLES // KL S19? |
327 | }; | 354 | }; |
328 | 355 | ||
329 | enum LLRenderDebugFeatureMask | 356 | enum LLRenderDebugFeatureMask |
@@ -361,8 +388,7 @@ public: | |||
361 | RENDER_DEBUG_SHAME = 0x0020000, | 388 | RENDER_DEBUG_SHAME = 0x0020000, |
362 | RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000, | 389 | RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000, |
363 | RENDER_DEBUG_SCULPTED = 0x0080000, | 390 | RENDER_DEBUG_SCULPTED = 0x0080000, |
364 | RENDER_DEBUG_AVATAR_VOLUME = 0x0100000, | 391 | RENDER_DEBUG_BUILD_QUEUE = 0x0100000, |
365 | RENDER_DEBUG_AGENT_TARGET = 0x0200000, | ||
366 | }; | 392 | }; |
367 | 393 | ||
368 | public: | 394 | public: |
@@ -421,15 +447,36 @@ public: | |||
421 | //screen texture | 447 | //screen texture |
422 | LLRenderTarget mScreen; | 448 | LLRenderTarget mScreen; |
423 | LLRenderTarget mDeferredScreen; | 449 | LLRenderTarget mDeferredScreen; |
424 | LLRenderTarget mDeferredLight[2]; | 450 | LLRenderTarget mDeferredDepth; |
451 | LLRenderTarget mDeferredLight[3]; | ||
425 | LLMultisampleBuffer mSampleBuffer; | 452 | LLMultisampleBuffer mSampleBuffer; |
453 | LLRenderTarget mGIMap; | ||
454 | LLRenderTarget mGIMapPost[2]; | ||
455 | LLRenderTarget mLuminanceMap; | ||
456 | LLRenderTarget mHighlight; | ||
426 | 457 | ||
427 | //sun shadow map | 458 | //sun shadow map |
428 | LLRenderTarget mSunShadow[4]; | 459 | LLRenderTarget mShadow[6]; |
460 | std::vector<LLVector3> mShadowFrustPoints[4]; | ||
461 | LLVector4 mShadowError; | ||
462 | LLVector4 mShadowFOV; | ||
463 | LLVector3 mShadowFrustOrigin[4]; | ||
429 | LLCamera mShadowCamera[8]; | 464 | LLCamera mShadowCamera[8]; |
430 | LLVector3 mShadowExtents[4][2]; | 465 | LLVector3 mShadowExtents[4][2]; |
431 | glh::matrix4f mSunShadowMatrix[4]; | 466 | glh::matrix4f mSunShadowMatrix[6]; |
467 | glh::matrix4f mGIMatrix; | ||
468 | glh::matrix4f mGIMatrixProj; | ||
469 | glh::matrix4f mGINormalMatrix; | ||
470 | glh::matrix4f mGIInvProj; | ||
471 | LLVector2 mGIRange; | ||
472 | F32 mGILightRadius; | ||
473 | |||
474 | LLPointer<LLDrawable> mShadowSpotLight[2]; | ||
475 | F32 mSpotLightFade[2]; | ||
476 | LLPointer<LLDrawable> mTargetShadowSpotLight[2]; | ||
477 | |||
432 | LLVector4 mSunClipPlanes; | 478 | LLVector4 mSunClipPlanes; |
479 | LLVector4 mSunOrthoClipPlanes; | ||
433 | 480 | ||
434 | LLVector2 mScreenScale; | 481 | LLVector2 mScreenScale; |
435 | 482 | ||
@@ -444,6 +491,8 @@ public: | |||
444 | 491 | ||
445 | //noise map | 492 | //noise map |
446 | U32 mNoiseMap; | 493 | U32 mNoiseMap; |
494 | U32 mTrueNoiseMap; | ||
495 | U32 mLightFunc; | ||
447 | 496 | ||
448 | LLColor4 mSunDiffuse; | 497 | LLColor4 mSunDiffuse; |
449 | LLVector3 mSunDir; | 498 | LLVector3 mSunDir; |
@@ -504,12 +553,45 @@ protected: | |||
504 | // | 553 | // |
505 | LLDrawable::drawable_list_t mBuildQ1; // priority | 554 | LLDrawable::drawable_list_t mBuildQ1; // priority |
506 | LLDrawable::drawable_list_t mBuildQ2; // non-priority | 555 | LLDrawable::drawable_list_t mBuildQ2; // non-priority |
556 | LLSpatialGroup::sg_list_t mGroupQ1; //priority | ||
557 | LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority | ||
558 | |||
507 | LLViewerObject::vobj_list_t mCreateQ; | 559 | LLViewerObject::vobj_list_t mCreateQ; |
508 | 560 | ||
509 | LLDrawable::drawable_set_t mActiveQ; | 561 | LLDrawable::drawable_set_t mActiveQ; |
510 | 562 | ||
511 | LLDrawable::drawable_set_t mRetexturedList; | 563 | LLDrawable::drawable_set_t mRetexturedList; |
512 | 564 | ||
565 | class HighlightItem | ||
566 | { | ||
567 | public: | ||
568 | const LLPointer<LLDrawable> mItem; | ||
569 | mutable F32 mFade; | ||
570 | |||
571 | HighlightItem(LLDrawable* item) | ||
572 | : mItem(item), mFade(0) | ||
573 | { | ||
574 | } | ||
575 | |||
576 | bool operator<(const HighlightItem& rhs) const | ||
577 | { | ||
578 | return mItem < rhs.mItem; | ||
579 | } | ||
580 | |||
581 | bool operator==(const HighlightItem& rhs) const | ||
582 | { | ||
583 | return mItem == rhs.mItem; | ||
584 | } | ||
585 | |||
586 | void incrFade(F32 val) const | ||
587 | { | ||
588 | mFade = llclamp(mFade+val, 0.f, 1.f); | ||
589 | } | ||
590 | }; | ||
591 | |||
592 | std::set<HighlightItem> mHighlightSet; | ||
593 | LLPointer<LLDrawable> mHighlightObject; | ||
594 | |||
513 | ////////////////////////////////////////////////// | 595 | ////////////////////////////////////////////////// |
514 | // | 596 | // |
515 | // Draw pools are responsible for storing all rendered data, | 597 | // Draw pools are responsible for storing all rendered data, |