From 99b82d944937ce321f64aa91fb18ab2aedd3992a Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Sun, 18 Feb 2018 15:52:23 +0000 Subject: Atmospherics WIP libatmosphere integrated in indra/llrender/llatmosphere.cpp Still working on runtime shaders to use libatmosphere precomputed atmospherics textures --- indra/newview/pipeline.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c9670a60f2..6023a41ca2 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -168,6 +168,9 @@ public: // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. + void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); void doOcclusion(LLCamera& camera); void markNotCulled(LLSpatialGroup* group, LLCamera &camera); @@ -541,6 +544,8 @@ public: void updateCamera(bool reset = false); + bool useAdvancedAtmospherics() const; + LLVector3 mFlyCamPosition; LLQuaternion mFlyCamRotation; @@ -568,6 +573,7 @@ public: static bool sBakeSunlight; static bool sNoAlpha; static bool sUseTriStrips; + static bool sUseAdvancedAtmospherics; static bool sUseFarClip; static bool sShadowRender; static bool sWaterReflections; @@ -614,12 +620,13 @@ public: //sun shadow map LLRenderTarget mShadow[6]; LLRenderTarget mShadowOcclusion[6]; - std::vector mShadowFrustPoints[4]; - LLVector4 mShadowError; - LLVector4 mShadowFOV; - LLVector3 mShadowFrustOrigin[4]; - LLCamera mShadowCamera[8]; - LLVector3 mShadowExtents[4][2]; + LLRenderTarget mInscatter; + std::vector mShadowFrustPoints[4]; + LLVector4 mShadowError; + LLVector4 mShadowFOV; + LLVector3 mShadowFrustOrigin[4]; + LLCamera mShadowCamera[8]; + LLVector3 mShadowExtents[4][2]; glh::matrix4f mSunShadowMatrix[6]; glh::matrix4f mShadowModelview[6]; glh::matrix4f mShadowProjection[6]; -- cgit v1.2.3 From 3116416fcb8dfd54ef2807e9e75959429c946d79 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Tue, 1 May 2018 00:10:11 +0100 Subject: Le Merge --- indra/newview/pipeline.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 6023a41ca2..75fed7dd39 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -61,14 +61,7 @@ bool compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); bool setup_hud_matrices(); // use whole screen to render hud bool setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking) -glh::matrix4f glh_copy_matrix(F32* src); -glh::matrix4f glh_get_current_modelview(); -void glh_set_current_modelview(const glh::matrix4f& mat); -glh::matrix4f glh_get_current_projection(); -void glh_set_current_projection(glh::matrix4f& mat); -glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar); -glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar); -glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up); + extern LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY; extern LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS; -- cgit v1.2.3 From 64302d3000b69b31e72eb6a3bd8a981c80cb88de Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 00:18:36 +0100 Subject: Modify use of sky settings, reduce complexity, and name funcs to indicate coord systems in use. Fix class2 softenLightF shader. --- indra/newview/pipeline.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 75fed7dd39..d3fe5b4fdd 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -655,9 +655,9 @@ public: U32 mTrueNoiseMap; U32 mLightFunc; - LLColor4 mSunDiffuse; - LLVector3 mSunDir; - LLVector3 mTransformedSunDir; + LLColor4 mSunDiffuse; + LLVector4 mSunDir; + LLVector4 mTransformedSunDir; bool mInitialized; bool mVertexShadersEnabled; -- cgit v1.2.3 From 67ab0084f87c40bf31d7fadded55cc9ea6299ca2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 12 Jun 2018 18:42:07 +0100 Subject: Fix env panel forward action. Make env panel update environment when jumping frame to frame. Add separate funcs for sun/moon vectors in various coord systems. Make haze glow only pay attention to sun (i.e. fix sun glow when moon is near horizon in daytime). --- indra/newview/pipeline.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 43aa7d891e..d17bab775d 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -657,7 +657,10 @@ public: LLColor4 mSunDiffuse; LLVector4 mSunDir; + LLVector4 mMoonDir; + LLVector4 mTransformedSunDir; + LLVector4 mTransformedMoonDir; bool mInitialized; bool mVertexShadersEnabled; -- cgit v1.2.3 From c9b2759469cb090b76a7d602eb876659c305c7f3 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 18 Sep 2018 21:54:38 +0100 Subject: SL-1475 Make stars use higher alpha and brighten reflected color before mixing to get stars to show up in reflections on water. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index d17bab775d..b292ac9358 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -582,6 +582,7 @@ public: static bool sRenderAttachedLights; static bool sRenderAttachedParticles; static bool sRenderDeferred; + static bool sRenderingWaterReflection; static bool sMemAllocationThrottled; static S32 sVisibleLightCount; static F32 sMinRenderSize; -- cgit v1.2.3 From 2929998982f37221a58b9fa8037748a2e905f4b1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 6 Nov 2018 19:33:04 +0000 Subject: Move to using a shared deferredUtil object for getting pos/norm from gbuffer. Eliminate 20+ callsites with copy-paste of getPosition and/or getNorm code. Make pipeline use getShadowTarget/releaseShadowTarget consistently. --- indra/newview/pipeline.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b292ac9358..3646aaaf45 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -209,6 +209,8 @@ public: U32 addObject(LLViewerObject *obj); void enableShadows(const bool enable_shadows); + void releaseShadowTargets(); + void releaseShadowTarget(U32 index); // void setLocalLighting(const bool local_lighting); // bool isLocalLightingEnabled() const; @@ -283,6 +285,8 @@ public: void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); + LLRenderTarget* getShadowTarget(U32 i); + void generateHighlight(LLCamera& camera); void renderHighlight(const LLViewerObject* obj, F32 fade); void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; } -- cgit v1.2.3 From b6fa72d3c4d02527f6d118eadc9ba1ac48a297f5 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 3 Dec 2018 15:33:15 -0800 Subject: SL-10055 Modify handling of directional light to prefer sun when it is up but use moon dir/color when it is alone in the sky. Modify handling of shader in shaders to get some shadowing of ambient and nighttime shadowing. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 57d2331222..9977781065 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -663,6 +663,7 @@ public: U32 mLightFunc; LLColor4 mSunDiffuse; + LLColor4 mMoonDiffuse; LLVector4 mSunDir; LLVector4 mMoonDir; -- cgit v1.2.3 From 8c128f5b635b4ae8f36b37fde8702aedc2fad1cc Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 10 Dec 2018 15:02:34 -0800 Subject: Mods to allow using ALM rendering in water reflections so the reflections will better match what they're reflecting when ALM is enabled. --- indra/newview/pipeline.h | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9977781065..b631d5bf6c 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -276,12 +276,11 @@ public: void renderGeomDeferred(LLCamera& camera); void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF); + void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); void unbindDeferredShader(LLGLSLShader& shader); - void renderDeferredLighting(); - void renderDeferredLightingToRT(LLRenderTarget* target); + void renderDeferredLighting(LLRenderTarget* light_target); void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); @@ -588,7 +587,6 @@ public: static bool sRenderAttachedLights; static bool sRenderAttachedParticles; static bool sRenderDeferred; - static bool sRenderingWaterReflection; static bool sMemAllocationThrottled; static S32 sVisibleLightCount; static F32 sMinRenderSize; @@ -620,37 +618,32 @@ public: //sun shadow map LLRenderTarget mShadow[6]; LLRenderTarget mShadowOcclusion[6]; - LLRenderTarget mInscatter; - std::vector mShadowFrustPoints[4]; - LLVector4 mShadowError; - LLVector4 mShadowFOV; - LLVector3 mShadowFrustOrigin[4]; - LLCamera mShadowCamera[8]; - LLVector3 mShadowExtents[4][2]; + + std::vector mShadowFrustPoints[4]; + LLVector4 mShadowError; + LLVector4 mShadowFOV; + LLVector3 mShadowFrustOrigin[4]; + LLCamera mShadowCamera[8]; + LLVector3 mShadowExtents[4][2]; 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 mShadowSpotLight[2]; - F32 mSpotLightFade[2]; - LLPointer mTargetShadowSpotLight[2]; + glh::matrix4f mReflectionModelView; + + LLPointer mShadowSpotLight[2]; + F32 mSpotLightFade[2]; + LLPointer mTargetShadowSpotLight[2]; LLVector4 mSunClipPlanes; LLVector4 mSunOrthoClipPlanes; - LLVector2 mScreenScale; //water reflection texture LLRenderTarget mWaterRef; - + LLRenderTarget mWaterDeferredScreen; + LLRenderTarget mWaterDeferredDepth; + LLRenderTarget mWaterOcclusionDepth; + LLRenderTarget mWaterDeferredLight; //water distortion texture (refraction) LLRenderTarget mWaterDis; -- cgit v1.2.3 From 07bff3129adaabb90f09b71fa65c8be0c3ecef5d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 19 Dec 2018 14:59:19 -0800 Subject: Add new shaders for advanced atmo SH env lighting calcs. --- indra/newview/pipeline.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b631d5bf6c..66cae8bf72 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -286,6 +286,7 @@ public: void generateSunShadow(LLCamera& camera); LLRenderTarget* getShadowTarget(U32 i); + void generateSkyIndirect(); void generateHighlight(LLCamera& camera); void renderHighlight(const LLViewerObject* obj, F32 fade); void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; } @@ -533,7 +534,8 @@ public: RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, - RENDER_DEBUG_IMPOSTORS = 0x100000000 + RENDER_DEBUG_IMPOSTORS = 0x100000000, + RENDER_DEBUG_SH = 0x200000000, }; public: @@ -650,6 +652,9 @@ public: //texture for making the glow LLRenderTarget mGlow[3]; + // texture for SH indirect sky contribution + LLRenderTarget mSkySH; + //noise map U32 mNoiseMap; U32 mTrueNoiseMap; -- cgit v1.2.3 From b865fc88e575e39111418a329362eada368445cd Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 8 Jan 2019 17:20:56 -0800 Subject: Fix broken distortion map rendering (was culling everything). Clean up deferred\alpha shader to allow re-entrant graphics switching (link error on 2nd compile/link of deferred shaders). Clean up some uses of pragma(optimize,...). --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 66cae8bf72..c76b91266e 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -580,6 +580,7 @@ public: static bool sDynamicLOD; static bool sPickAvatar; static bool sReflectionRender; + static bool sDistortionRender; static bool sImpostorRender; static bool sImpostorRenderAlphaDepthPass; static bool sUnderWaterRender; -- cgit v1.2.3 From d070c56f640768bb73933f9cbd31bab67d26b6e9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 18 Jan 2019 13:56:12 -0800 Subject: SL-10384 Fix issue with clip plane used in distortion map rendering including objects/avatars above water near surface. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c76b91266e..5be6b73cc4 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -594,6 +594,7 @@ public: static S32 sVisibleLightCount; static F32 sMinRenderSize; static bool sRenderingHUDs; + static F32 sDistortionWaterClipPlaneMargin; static LLTrace::EventStatHandle sStatBatchSize; -- cgit v1.2.3 From 7989df1c3623f9402248aa74bdec20dff6d78fd1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 21 Feb 2019 17:20:53 -0800 Subject: Merge --- indra/newview/pipeline.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 5be6b73cc4..b3aa48e39f 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -281,7 +281,8 @@ public: void unbindDeferredShader(LLGLSLShader& shader); void renderDeferredLighting(LLRenderTarget* light_target); - + void postDeferredGammaCorrect(LLRenderTarget* screen_target); + void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); LLRenderTarget* getShadowTarget(U32 i); -- cgit v1.2.3 From d7ad30a2d4dfd83f93b0150464214f2df776eb9c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 27 Feb 2019 17:07:31 -0800 Subject: SL-10566 part the fourth Fix water rendering causing distortion map update very frame. Reduce binds in alpha draw pool for HUD atmo suppression (may regress HUD lighting weirdness). Add ability to retrieve current user clip plane so it can be saved/restored around water map gen. Leave render type masks as is after reflection map render to get detail filtering applied to distortion map again. Re-enable occlusion in distortion map rendering. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b3aa48e39f..8a6ae1bc4f 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -75,6 +75,7 @@ extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI; extern LLTrace::BlockTimerStatHandle FTM_RENDER_WATER; extern LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY; extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_DEFERRED; extern LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS; extern LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP; extern LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS; -- cgit v1.2.3 From c1d2416826406631807f153e7de9d2b790b0caa5 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 28 Feb 2019 14:06:19 -0800 Subject: EEP performance WIP Mods to improve alpha obj render performance. Removes hacky fix for HUD elements getting atmospherics. Re-orders rendering of glow to remove ~10ms/frame of shader re-re-rebinding. Fix up default classes and basic shader loading (remove unused shared modules). --- indra/newview/pipeline.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 8a6ae1bc4f..c94a69eaf0 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -75,7 +75,6 @@ extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI; extern LLTrace::BlockTimerStatHandle FTM_RENDER_WATER; extern LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY; extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA; -extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_DEFERRED; extern LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS; extern LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP; extern LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS; @@ -615,6 +614,10 @@ public: LLRenderTarget mHighlight; LLRenderTarget mPhysicsDisplay; + LLCullResult mSky; + LLCullResult mReflectedObjects; + LLCullResult mRefractedObjects; + //utility buffer for rendering post effects, gets abused by renderDeferredLighting LLPointer mDeferredVB; -- cgit v1.2.3 From d8eff424a5fb340b828802351e2b7f6b63bfa30f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 2 Mar 2019 07:17:46 -0800 Subject: SL-10664 --- indra/newview/pipeline.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c94a69eaf0..c41fd0189c 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -287,7 +287,6 @@ public: void generateSunShadow(LLCamera& camera); LLRenderTarget* getShadowTarget(U32 i); - void generateSkyIndirect(); void generateHighlight(LLCamera& camera); void renderHighlight(const LLViewerObject* obj, F32 fade); void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; } @@ -545,8 +544,6 @@ public: void updateCamera(bool reset = false); - bool useAdvancedAtmospherics() const; - LLVector3 mFlyCamPosition; LLQuaternion mFlyCamRotation; @@ -574,7 +571,6 @@ public: static bool sBakeSunlight; static bool sNoAlpha; static bool sUseTriStrips; - static bool sUseAdvancedAtmospherics; static bool sUseFarClip; static bool sShadowRender; static bool sWaterReflections; @@ -659,9 +655,6 @@ public: //texture for making the glow LLRenderTarget mGlow[3]; - // texture for SH indirect sky contribution - LLRenderTarget mSkySH; - //noise map U32 mNoiseMap; U32 mTrueNoiseMap; -- cgit v1.2.3 From 4c3050a3953153aa8753fc10706ad2ef464f3e3d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sun, 3 Mar 2019 10:42:19 -0800 Subject: SL-10664, SL-10666 Fix up culling issues from perf work and fix Depth of Field rendering to get depth values properly. Baseline for performance work. --- indra/newview/pipeline.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c41fd0189c..e38655f44d 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -645,10 +645,7 @@ public: //water reflection texture LLRenderTarget mWaterRef; - LLRenderTarget mWaterDeferredScreen; - LLRenderTarget mWaterDeferredDepth; - LLRenderTarget mWaterOcclusionDepth; - LLRenderTarget mWaterDeferredLight; + //water distortion texture (refraction) LLRenderTarget mWaterDis; -- cgit v1.2.3 From 3f48633b7df7bff19bae217527b92ec2be5e36e6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 6 Mar 2019 10:09:59 -0800 Subject: Make octree walk stop thrashing the caches with tex work. Add many more fast timer blocks to differentiate where time goes in UI and Shadow rendering. --- indra/newview/pipeline.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index e38655f44d..1c39fb13b6 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -84,6 +84,11 @@ extern LLTrace::BlockTimerStatHandle FTM_STATESORT; extern LLTrace::BlockTimerStatHandle FTM_PIPELINE; extern LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_HUD; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_3D; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_2D; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_DEBUG_TEXT; +extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON; class LLPipeline { -- cgit v1.2.3 From 423fa1ac297e39c9395f45490278b8751188b6db Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Mar 2019 10:56:26 -0800 Subject: SL-10618, SL-10698 Fix reflection/distortion map culling planes again. Fix broken handling of shadow disables in ALM forward shaders. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 1c39fb13b6..a31f880fbf 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -666,6 +666,7 @@ public: LLColor4 mMoonDiffuse; LLVector4 mSunDir; LLVector4 mMoonDir; + bool mNeedsShadowTargetClear; LLVector4 mTransformedSunDir; LLVector4 mTransformedMoonDir; -- cgit v1.2.3 From 53f3755a4629206754a5695de233d88062a54d3d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Mar 2019 15:09:34 -0800 Subject: Fix tabs. --- indra/newview/pipeline.h | 1638 +++++++++++++++++++++++----------------------- 1 file changed, 819 insertions(+), 819 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index a31f880fbf..38fb26d811 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -53,8 +53,8 @@ class LLDrawPoolAlpha; typedef enum e_avatar_skinning_method { - SKIN_METHOD_SOFTWARE, - SKIN_METHOD_VERTEX_PROGRAM + SKIN_METHOD_SOFTWARE, + SKIN_METHOD_VERTEX_PROGRAM } EAvatarSkinningMethod; bool compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! @@ -93,861 +93,861 @@ extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON; class LLPipeline { public: - LLPipeline(); - ~LLPipeline(); - - void destroyGL(); - void restoreGL(); - void resetVertexBuffers(); - void doResetVertexBuffers(bool forced = false); - void resizeScreenTexture(); - void releaseGLBuffers(); - void releaseLUTBuffers(); - void releaseScreenBuffers(); - void createGLBuffers(); - void createLUTBuffers(); - - //allocate the largest screen buffer possible up to resX, resY - //returns true if full size buffer allocated, false if some other size is allocated - bool allocateScreenBuffer(U32 resX, U32 resY); - - typedef enum { - FBO_SUCCESS_FULLRES = 0, - FBO_SUCCESS_LOWRES, - FBO_FAILURE - } eFBOStatus; + LLPipeline(); + ~LLPipeline(); + + void destroyGL(); + void restoreGL(); + void resetVertexBuffers(); + void doResetVertexBuffers(bool forced = false); + void resizeScreenTexture(); + void releaseGLBuffers(); + void releaseLUTBuffers(); + void releaseScreenBuffers(); + void createGLBuffers(); + void createLUTBuffers(); + + //allocate the largest screen buffer possible up to resX, resY + //returns true if full size buffer allocated, false if some other size is allocated + bool allocateScreenBuffer(U32 resX, U32 resY); + + typedef enum { + FBO_SUCCESS_FULLRES = 0, + FBO_SUCCESS_LOWRES, + FBO_FAILURE + } eFBOStatus; private: - //implementation of above, wrapped for easy error handling - eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY); + //implementation of above, wrapped for easy error handling + eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY); public: - //attempt to allocate screen buffers at resX, resY - //returns true if allocation successful, false otherwise - bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); - - void allocatePhysicsBuffer(); - - void resetVertexBuffers(LLDrawable* drawable); - void generateImpostor(LLVOAvatar* avatar); - void bindScreenToTexture(); - void renderBloom(bool for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); - - void init(); - void cleanup(); - bool isInit() { return mInitialized; }; - - /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. - /// @return Draw pool, or NULL if not found. - LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); - - /// @brief Get a draw pool for faces of the appropriate type and texture. Create if necessary. - /// @return Always returns a draw pool. - LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); - - /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. - static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerTexture* te_image); - static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* imagep); - - void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! - void removePool( LLDrawPool* poolp ); - - void allocDrawable(LLViewerObject *obj); - - void unlinkDrawable(LLDrawable*); - - static void removeMutedAVsLights(LLVOAvatar*); - - // Object related methods - void markVisible(LLDrawable *drawablep, LLCamera& camera); - void markOccluder(LLSpatialGroup* group); - - //downsample source to dest, taking the maximum depth value per pixel in source and writing to dest - // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided - void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - - // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. - void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - - void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - void doOcclusion(LLCamera& camera); - void markNotCulled(LLSpatialGroup* group, LLCamera &camera); - 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); - void markPartitionMove(LLDrawable* drawablep); - void markMeshDirty(LLSpatialGroup* group); - - //get the object between start and end that's closest to start. - LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, - bool pick_transparent, - bool pick_rigged, - S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); - - //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index - LLVOPartGroup* lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, - S32* face_hit); - - - LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, - bool pick_transparent, - S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); - - // Something about these textures has changed. Dirty them. - void dirtyPoolObjectTextures(const std::set& textures); - - void resetDrawOrders(); - - U32 addObject(LLViewerObject *obj); - - void enableShadows(const bool enable_shadows); + //attempt to allocate screen buffers at resX, resY + //returns true if allocation successful, false otherwise + bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); + + void allocatePhysicsBuffer(); + + void resetVertexBuffers(LLDrawable* drawable); + void generateImpostor(LLVOAvatar* avatar); + void bindScreenToTexture(); + void renderBloom(bool for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); + + void init(); + void cleanup(); + bool isInit() { return mInitialized; }; + + /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. + /// @return Draw pool, or NULL if not found. + LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + + /// @brief Get a draw pool for faces of the appropriate type and texture. Create if necessary. + /// @return Always returns a draw pool. + LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + + /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. + static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerTexture* te_image); + static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* imagep); + + void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! + void removePool( LLDrawPool* poolp ); + + void allocDrawable(LLViewerObject *obj); + + void unlinkDrawable(LLDrawable*); + + static void removeMutedAVsLights(LLVOAvatar*); + + // Object related methods + void markVisible(LLDrawable *drawablep, LLCamera& camera); + void markOccluder(LLSpatialGroup* group); + + //downsample source to dest, taking the maximum depth value per pixel in source and writing to dest + // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided + void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + + // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. + void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + + void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + void doOcclusion(LLCamera& camera); + void markNotCulled(LLSpatialGroup* group, LLCamera &camera); + 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); + void markPartitionMove(LLDrawable* drawablep); + void markMeshDirty(LLSpatialGroup* group); + + //get the object between start and end that's closest to start. + LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, + bool pick_transparent, + bool pick_rigged, + S32* face_hit, // return the face hit + LLVector4a* intersection = NULL, // return the intersection point + LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point + LLVector4a* normal = NULL, // return the surface normal at the intersection point + LLVector4a* tangent = NULL // return the surface tangent at the intersection point + ); + + //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index + LLVOPartGroup* lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, + S32* face_hit); + + + LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, + bool pick_transparent, + S32* face_hit, // return the face hit + LLVector4a* intersection = NULL, // return the intersection point + LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point + LLVector4a* normal = NULL, // return the surface normal at the intersection point + LLVector4a* tangent = NULL // return the surface tangent at the intersection point + ); + + // Something about these textures has changed. Dirty them. + void dirtyPoolObjectTextures(const std::set& textures); + + void resetDrawOrders(); + + U32 addObject(LLViewerObject *obj); + + void enableShadows(const bool enable_shadows); void releaseShadowTargets(); void releaseShadowTarget(U32 index); -// void setLocalLighting(const bool local_lighting); -// bool isLocalLightingEnabled() const; - S32 setLightingDetail(S32 level); - S32 getLightingDetail() const { return mLightingDetail; } - S32 getMaxLightingDetail() const; - - void setUseVertexShaders(bool use_shaders); - bool getUseVertexShaders() const { return mVertexShadersEnabled; } - bool canUseVertexShaders(); - bool canUseWindLightShaders() const; - bool canUseWindLightShadersOnObjects() const; - bool canUseAntiAliasing() const; - - // phases - void resetFrameStats(); - - void updateMoveDampedAsync(LLDrawable* drawablep); - void updateMoveNormalAsync(LLDrawable* drawablep); - void updateMovedList(LLDrawable::drawable_vector_t& move_list); - void updateMove(); - bool visibleObjectsInFrustum(LLCamera& camera); - bool getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); - bool getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector& fp, LLVector3 light_dir = LLVector3(0,0,0)); - void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //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 processPartitionQ(); - void updateGeom(F32 max_dtime); - void updateGL(); - void rebuildPriorityGroups(); - void rebuildGroups(); - void clearRebuildGroups(); - void clearRebuildDrawables(); - - //calculate pixel area of given box from vantage point of given camera - static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); - static F32 calcPixelArea(const LLVector4a& center, const LLVector4a& size, LLCamera &camera); - - void stateSort(LLCamera& camera, LLCullResult& result); - void stateSort(LLSpatialGroup* group, LLCamera& camera); - void stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_changed = FALSE); - void stateSort(LLDrawable* drawablep, LLCamera& camera); - void postSort(LLCamera& camera); - void forAllVisibleDrawables(void (*func)(LLDrawable*)); - - void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); - void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); - - void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); - - void grabReferences(LLCullResult& result); - void clearReferences(); - - //check references will assert that there are no references in sCullResult to the provided data - void checkReferences(LLFace* face); - void checkReferences(LLDrawable* drawable); - void checkReferences(LLDrawInfo* draw_info); - void checkReferences(LLSpatialGroup* group); - - - void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); - void renderGeomDeferred(LLCamera& camera); - void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); - void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); - void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); - - void unbindDeferredShader(LLGLSLShader& shader); - void renderDeferredLighting(LLRenderTarget* light_target); - void postDeferredGammaCorrect(LLRenderTarget* screen_target); - - void generateWaterReflection(LLCamera& camera); - void generateSunShadow(LLCamera& camera); +// void setLocalLighting(const bool local_lighting); +// bool isLocalLightingEnabled() const; + S32 setLightingDetail(S32 level); + S32 getLightingDetail() const { return mLightingDetail; } + S32 getMaxLightingDetail() const; + + void setUseVertexShaders(bool use_shaders); + bool getUseVertexShaders() const { return mVertexShadersEnabled; } + bool canUseVertexShaders(); + bool canUseWindLightShaders() const; + bool canUseWindLightShadersOnObjects() const; + bool canUseAntiAliasing() const; + + // phases + void resetFrameStats(); + + void updateMoveDampedAsync(LLDrawable* drawablep); + void updateMoveNormalAsync(LLDrawable* drawablep); + void updateMovedList(LLDrawable::drawable_vector_t& move_list); + void updateMove(); + bool visibleObjectsInFrustum(LLCamera& camera); + bool getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); + bool getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector& fp, LLVector3 light_dir = LLVector3(0,0,0)); + void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //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 processPartitionQ(); + void updateGeom(F32 max_dtime); + void updateGL(); + void rebuildPriorityGroups(); + void rebuildGroups(); + void clearRebuildGroups(); + void clearRebuildDrawables(); + + //calculate pixel area of given box from vantage point of given camera + static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); + static F32 calcPixelArea(const LLVector4a& center, const LLVector4a& size, LLCamera &camera); + + void stateSort(LLCamera& camera, LLCullResult& result); + void stateSort(LLSpatialGroup* group, LLCamera& camera); + void stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_changed = FALSE); + void stateSort(LLDrawable* drawablep, LLCamera& camera); + void postSort(LLCamera& camera); + void forAllVisibleDrawables(void (*func)(LLDrawable*)); + + void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + + void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); + + void grabReferences(LLCullResult& result); + void clearReferences(); + + //check references will assert that there are no references in sCullResult to the provided data + void checkReferences(LLFace* face); + void checkReferences(LLDrawable* drawable); + void checkReferences(LLDrawInfo* draw_info); + void checkReferences(LLSpatialGroup* group); + + + void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); + void renderGeomDeferred(LLCamera& camera); + void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); + void renderGeomShadow(LLCamera& camera); + void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); + void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); + + void unbindDeferredShader(LLGLSLShader& shader); + void renderDeferredLighting(LLRenderTarget* light_target); + void postDeferredGammaCorrect(LLRenderTarget* screen_target); + + void generateWaterReflection(LLCamera& camera); + void generateSunShadow(LLCamera& camera); LLRenderTarget* getShadowTarget(U32 i); - 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, bool use_occlusion, U32 target_width); - void renderHighlights(); - void renderDebug(); - void renderPhysicsDisplay(); - - void rebuildPools(); // Rebuild pools - - void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object - bool verify(); // Verify that all data in the pipeline is "correct" - - S32 getLightCount() const { return mLights.size(); } - - void calcNearbyLights(LLCamera& camera); - void setupHWLights(LLDrawPool* pool); - void setupAvatarLights(bool for_edit = false); - void enableLights(U32 mask); - void enableLightsStatic(); - void enableLightsDynamic(); - void enableLightsAvatar(); - void enableLightsPreview(); - void enableLightsAvatarEdit(const LLColor4& color); - void enableLightsFullbright(const LLColor4& color); - void disableLights(); - - void shiftObjects(const LLVector3 &offset); - - void setLight(LLDrawable *drawablep, bool is_light); - - bool hasRenderBatches(const U32 type) const; - LLCullResult::drawinfo_iterator beginRenderMap(U32 type); - LLCullResult::drawinfo_iterator endRenderMap(U32 type); - LLCullResult::sg_iterator beginAlphaGroups(); - LLCullResult::sg_iterator endAlphaGroups(); - - - void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); - - bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); } - bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); } - void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; } - void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; } - void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; } - void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; } - - bool hasRenderType(const U32 type) const; - bool hasAnyRenderType(const U32 type, ...) const; - - void setRenderTypeMask(U32 type, ...); - // This is equivalent to 'setRenderTypeMask' - //void orRenderTypeMask(U32 type, ...); - void andRenderTypeMask(U32 type, ...); - void clearRenderTypeMask(U32 type, ...); - void setAllRenderTypes(); - void clearAllRenderTypes(); - - void pushRenderTypeMask(); - void popRenderTypeMask(); - - void pushRenderDebugFeatureMask(); - void popRenderDebugFeatureMask(); - - static void toggleRenderType(U32 type); - - // For UI control of render features - static bool hasRenderTypeControl(U32 data); - static void toggleRenderDebug(U64 data); - static void toggleRenderDebugFeature(U32 data); - static void toggleRenderTypeControl(U32 data); - static bool toggleRenderTypeControlNegated(S32 data); - static bool toggleRenderDebugControl(U64 data); - static bool toggleRenderDebugFeatureControl(U32 data); - static void setRenderDebugFeatureControl(U32 bit, bool value); - - static void setRenderParticleBeacons(bool val); - static void toggleRenderParticleBeacons(); - static bool getRenderParticleBeacons(); - - static void setRenderSoundBeacons(bool val); - static void toggleRenderSoundBeacons(); - static bool getRenderSoundBeacons(); - - static void setRenderMOAPBeacons(bool val); - static void toggleRenderMOAPBeacons(); - static bool getRenderMOAPBeacons(); - - static void setRenderPhysicalBeacons(bool val); - static void toggleRenderPhysicalBeacons(); - static bool getRenderPhysicalBeacons(); - - static void setRenderScriptedBeacons(bool val); - static void toggleRenderScriptedBeacons(); - static bool getRenderScriptedBeacons(); - - static void setRenderScriptedTouchBeacons(bool val); - static void toggleRenderScriptedTouchBeacons(); - static bool getRenderScriptedTouchBeacons(); - - static void setRenderBeacons(bool val); - static void toggleRenderBeacons(); - static bool getRenderBeacons(); - - static void setRenderHighlights(bool val); - static void toggleRenderHighlights(); - static bool getRenderHighlights(); - static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay - - static void updateRenderBump(); - static void updateRenderDeferred(); - static void refreshCachedSettings(); - - static void throttleNewMemoryAllocation(bool disable); - - - - void addDebugBlip(const LLVector3& position, const LLColor4& color); - - void hidePermanentObjects( std::vector& restoreList ); - void restorePermanentObjects( const std::vector& restoreList ); - void skipRenderingOfTerrain( bool flag ); - void hideObject( const LLUUID& id ); - void restoreHiddenObject( const LLUUID& id ); + 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, bool use_occlusion, U32 target_width); + void renderHighlights(); + void renderDebug(); + void renderPhysicsDisplay(); + + void rebuildPools(); // Rebuild pools + + void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object + bool verify(); // Verify that all data in the pipeline is "correct" + + S32 getLightCount() const { return mLights.size(); } + + void calcNearbyLights(LLCamera& camera); + void setupHWLights(LLDrawPool* pool); + void setupAvatarLights(bool for_edit = false); + void enableLights(U32 mask); + void enableLightsStatic(); + void enableLightsDynamic(); + void enableLightsAvatar(); + void enableLightsPreview(); + void enableLightsAvatarEdit(const LLColor4& color); + void enableLightsFullbright(const LLColor4& color); + void disableLights(); + + void shiftObjects(const LLVector3 &offset); + + void setLight(LLDrawable *drawablep, bool is_light); + + bool hasRenderBatches(const U32 type) const; + LLCullResult::drawinfo_iterator beginRenderMap(U32 type); + LLCullResult::drawinfo_iterator endRenderMap(U32 type); + LLCullResult::sg_iterator beginAlphaGroups(); + LLCullResult::sg_iterator endAlphaGroups(); + + + void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); + + bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); } + bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); } + void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; } + void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; } + void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; } + void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; } + + bool hasRenderType(const U32 type) const; + bool hasAnyRenderType(const U32 type, ...) const; + + void setRenderTypeMask(U32 type, ...); + // This is equivalent to 'setRenderTypeMask' + //void orRenderTypeMask(U32 type, ...); + void andRenderTypeMask(U32 type, ...); + void clearRenderTypeMask(U32 type, ...); + void setAllRenderTypes(); + void clearAllRenderTypes(); + + void pushRenderTypeMask(); + void popRenderTypeMask(); + + void pushRenderDebugFeatureMask(); + void popRenderDebugFeatureMask(); + + static void toggleRenderType(U32 type); + + // For UI control of render features + static bool hasRenderTypeControl(U32 data); + static void toggleRenderDebug(U64 data); + static void toggleRenderDebugFeature(U32 data); + static void toggleRenderTypeControl(U32 data); + static bool toggleRenderTypeControlNegated(S32 data); + static bool toggleRenderDebugControl(U64 data); + static bool toggleRenderDebugFeatureControl(U32 data); + static void setRenderDebugFeatureControl(U32 bit, bool value); + + static void setRenderParticleBeacons(bool val); + static void toggleRenderParticleBeacons(); + static bool getRenderParticleBeacons(); + + static void setRenderSoundBeacons(bool val); + static void toggleRenderSoundBeacons(); + static bool getRenderSoundBeacons(); + + static void setRenderMOAPBeacons(bool val); + static void toggleRenderMOAPBeacons(); + static bool getRenderMOAPBeacons(); + + static void setRenderPhysicalBeacons(bool val); + static void toggleRenderPhysicalBeacons(); + static bool getRenderPhysicalBeacons(); + + static void setRenderScriptedBeacons(bool val); + static void toggleRenderScriptedBeacons(); + static bool getRenderScriptedBeacons(); + + static void setRenderScriptedTouchBeacons(bool val); + static void toggleRenderScriptedTouchBeacons(); + static bool getRenderScriptedTouchBeacons(); + + static void setRenderBeacons(bool val); + static void toggleRenderBeacons(); + static bool getRenderBeacons(); + + static void setRenderHighlights(bool val); + static void toggleRenderHighlights(); + static bool getRenderHighlights(); + static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay + + static void updateRenderBump(); + static void updateRenderDeferred(); + static void refreshCachedSettings(); + + static void throttleNewMemoryAllocation(bool disable); + + + + void addDebugBlip(const LLVector3& position, const LLColor4& color); + + void hidePermanentObjects( std::vector& restoreList ); + void restorePermanentObjects( const std::vector& restoreList ); + void skipRenderingOfTerrain( bool flag ); + void hideObject( const LLUUID& id ); + void restoreHiddenObject( const LLUUID& id ); private: - void unloadShaders(); - void addToQuickLookup( LLDrawPool* new_poolp ); - void removeFromQuickLookup( LLDrawPool* poolp ); - bool updateDrawableGeom(LLDrawable* drawable, bool priority); - void assertInitializedDoError(); - bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; - void connectRefreshCachedSettingsSafe(const std::string name); - void hideDrawable( LLDrawable *pDrawable ); - void unhideDrawable( LLDrawable *pDrawable ); + void unloadShaders(); + void addToQuickLookup( LLDrawPool* new_poolp ); + void removeFromQuickLookup( LLDrawPool* poolp ); + bool updateDrawableGeom(LLDrawable* drawable, bool priority); + void assertInitializedDoError(); + bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; + void connectRefreshCachedSettingsSafe(const std::string name); + void hideDrawable( LLDrawable *pDrawable ); + void unhideDrawable( LLDrawable *pDrawable ); public: - enum {GPU_CLASS_MAX = 3 }; - - 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_ALPHA_MASK = LLDrawPool::POOL_ALPHA_MASK, - RENDER_TYPE_FULLBRIGHT_ALPHA_MASK = LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK, - RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, - RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, - RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS, - RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, - RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, - RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, - RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, - 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_POST_BUMP = LLRenderPass::PASS_POST_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_MATERIAL = LLRenderPass::PASS_MATERIAL, - RENDER_TYPE_PASS_MATERIAL_ALPHA = LLRenderPass::PASS_MATERIAL_ALPHA, - RENDER_TYPE_PASS_MATERIAL_ALPHA_MASK = LLRenderPass::PASS_MATERIAL_ALPHA_MASK, - RENDER_TYPE_PASS_MATERIAL_ALPHA_EMISSIVE= LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, - RENDER_TYPE_PASS_SPECMAP = LLRenderPass::PASS_SPECMAP, - RENDER_TYPE_PASS_SPECMAP_BLEND = LLRenderPass::PASS_SPECMAP_BLEND, - RENDER_TYPE_PASS_SPECMAP_MASK = LLRenderPass::PASS_SPECMAP_MASK, - RENDER_TYPE_PASS_SPECMAP_EMISSIVE = LLRenderPass::PASS_SPECMAP_EMISSIVE, - RENDER_TYPE_PASS_NORMMAP = LLRenderPass::PASS_NORMMAP, - RENDER_TYPE_PASS_NORMMAP_BLEND = LLRenderPass::PASS_NORMMAP_BLEND, - RENDER_TYPE_PASS_NORMMAP_MASK = LLRenderPass::PASS_NORMMAP_MASK, - RENDER_TYPE_PASS_NORMMAP_EMISSIVE = LLRenderPass::PASS_NORMMAP_EMISSIVE, - RENDER_TYPE_PASS_NORMSPEC = LLRenderPass::PASS_NORMSPEC, - RENDER_TYPE_PASS_NORMSPEC_BLEND = LLRenderPass::PASS_NORMSPEC_BLEND, - RENDER_TYPE_PASS_NORMSPEC_MASK = LLRenderPass::PASS_NORMSPEC_MASK, - RENDER_TYPE_PASS_NORMSPEC_EMISSIVE = LLRenderPass::PASS_NORMSPEC_EMISSIVE, - // Following are object types (only used in drawable mRenderType) - RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, - RENDER_TYPE_VOLUME, - RENDER_TYPE_PARTICLES, - RENDER_TYPE_CLOUDS, - RENDER_TYPE_HUD_PARTICLES, - NUM_RENDER_TYPES, - END_RENDER_TYPES = NUM_RENDER_TYPES - }; - - enum LLRenderDebugFeatureMask - { - RENDER_DEBUG_FEATURE_UI = 0x0001, - RENDER_DEBUG_FEATURE_SELECTED = 0x0002, - RENDER_DEBUG_FEATURE_HIGHLIGHTED = 0x0004, - RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES = 0x0008, -// RENDER_DEBUG_FEATURE_HW_LIGHTING = 0x0010, - RENDER_DEBUG_FEATURE_FLEXIBLE = 0x0010, - RENDER_DEBUG_FEATURE_FOG = 0x0020, - RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, - RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100, - }; - - enum LLRenderDebugMask: U64 - { - RENDER_DEBUG_COMPOSITION = 0x00000001, - RENDER_DEBUG_VERIFY = 0x00000002, - RENDER_DEBUG_BBOXES = 0x00000004, - RENDER_DEBUG_OCTREE = 0x00000008, - RENDER_DEBUG_WIND_VECTORS = 0x00000010, - RENDER_DEBUG_OCCLUSION = 0x00000020, - RENDER_DEBUG_POINTS = 0x00000040, - RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080, - RENDER_DEBUG_TEXTURE_AREA = 0x00000100, - RENDER_DEBUG_FACE_AREA = 0x00000200, - RENDER_DEBUG_PARTICLES = 0x00000400, - RENDER_DEBUG_GLOW = 0x00000800, // not used - RENDER_DEBUG_TEXTURE_ANIM = 0x00001000, - RENDER_DEBUG_LIGHTS = 0x00002000, - RENDER_DEBUG_BATCH_SIZE = 0x00004000, - RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used - RENDER_DEBUG_RAYCAST = 0x00010000, - RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000, - RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000, - RENDER_DEBUG_SCULPTED = 0x00080000, - RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, - RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, - RENDER_DEBUG_BUILD_QUEUE = 0x00400000, - RENDER_DEBUG_AGENT_TARGET = 0x00800000, - RENDER_DEBUG_UPDATE_TYPE = 0x01000000, - RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, - RENDER_DEBUG_NORMALS = 0x04000000, - RENDER_DEBUG_LOD_INFO = 0x08000000, - RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000, - RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used - RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, - RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, - RENDER_DEBUG_IMPOSTORS = 0x100000000, + enum {GPU_CLASS_MAX = 3 }; + + 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_ALPHA_MASK = LLDrawPool::POOL_ALPHA_MASK, + RENDER_TYPE_FULLBRIGHT_ALPHA_MASK = LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK, + RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, + RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, + RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS, + RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, + RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, + RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, + RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, + 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_POST_BUMP = LLRenderPass::PASS_POST_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_MATERIAL = LLRenderPass::PASS_MATERIAL, + RENDER_TYPE_PASS_MATERIAL_ALPHA = LLRenderPass::PASS_MATERIAL_ALPHA, + RENDER_TYPE_PASS_MATERIAL_ALPHA_MASK = LLRenderPass::PASS_MATERIAL_ALPHA_MASK, + RENDER_TYPE_PASS_MATERIAL_ALPHA_EMISSIVE= LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, + RENDER_TYPE_PASS_SPECMAP = LLRenderPass::PASS_SPECMAP, + RENDER_TYPE_PASS_SPECMAP_BLEND = LLRenderPass::PASS_SPECMAP_BLEND, + RENDER_TYPE_PASS_SPECMAP_MASK = LLRenderPass::PASS_SPECMAP_MASK, + RENDER_TYPE_PASS_SPECMAP_EMISSIVE = LLRenderPass::PASS_SPECMAP_EMISSIVE, + RENDER_TYPE_PASS_NORMMAP = LLRenderPass::PASS_NORMMAP, + RENDER_TYPE_PASS_NORMMAP_BLEND = LLRenderPass::PASS_NORMMAP_BLEND, + RENDER_TYPE_PASS_NORMMAP_MASK = LLRenderPass::PASS_NORMMAP_MASK, + RENDER_TYPE_PASS_NORMMAP_EMISSIVE = LLRenderPass::PASS_NORMMAP_EMISSIVE, + RENDER_TYPE_PASS_NORMSPEC = LLRenderPass::PASS_NORMSPEC, + RENDER_TYPE_PASS_NORMSPEC_BLEND = LLRenderPass::PASS_NORMSPEC_BLEND, + RENDER_TYPE_PASS_NORMSPEC_MASK = LLRenderPass::PASS_NORMSPEC_MASK, + RENDER_TYPE_PASS_NORMSPEC_EMISSIVE = LLRenderPass::PASS_NORMSPEC_EMISSIVE, + // Following are object types (only used in drawable mRenderType) + RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, + RENDER_TYPE_VOLUME, + RENDER_TYPE_PARTICLES, + RENDER_TYPE_CLOUDS, + RENDER_TYPE_HUD_PARTICLES, + NUM_RENDER_TYPES, + END_RENDER_TYPES = NUM_RENDER_TYPES + }; + + enum LLRenderDebugFeatureMask + { + RENDER_DEBUG_FEATURE_UI = 0x0001, + RENDER_DEBUG_FEATURE_SELECTED = 0x0002, + RENDER_DEBUG_FEATURE_HIGHLIGHTED = 0x0004, + RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES = 0x0008, +// RENDER_DEBUG_FEATURE_HW_LIGHTING = 0x0010, + RENDER_DEBUG_FEATURE_FLEXIBLE = 0x0010, + RENDER_DEBUG_FEATURE_FOG = 0x0020, + RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, + RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100, + }; + + enum LLRenderDebugMask: U64 + { + RENDER_DEBUG_COMPOSITION = 0x00000001, + RENDER_DEBUG_VERIFY = 0x00000002, + RENDER_DEBUG_BBOXES = 0x00000004, + RENDER_DEBUG_OCTREE = 0x00000008, + RENDER_DEBUG_WIND_VECTORS = 0x00000010, + RENDER_DEBUG_OCCLUSION = 0x00000020, + RENDER_DEBUG_POINTS = 0x00000040, + RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080, + RENDER_DEBUG_TEXTURE_AREA = 0x00000100, + RENDER_DEBUG_FACE_AREA = 0x00000200, + RENDER_DEBUG_PARTICLES = 0x00000400, + RENDER_DEBUG_GLOW = 0x00000800, // not used + RENDER_DEBUG_TEXTURE_ANIM = 0x00001000, + RENDER_DEBUG_LIGHTS = 0x00002000, + RENDER_DEBUG_BATCH_SIZE = 0x00004000, + RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used + RENDER_DEBUG_RAYCAST = 0x00010000, + RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000, + RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000, + RENDER_DEBUG_SCULPTED = 0x00080000, + RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, + RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, + RENDER_DEBUG_BUILD_QUEUE = 0x00400000, + RENDER_DEBUG_AGENT_TARGET = 0x00800000, + RENDER_DEBUG_UPDATE_TYPE = 0x01000000, + RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, + RENDER_DEBUG_NORMALS = 0x04000000, + RENDER_DEBUG_LOD_INFO = 0x08000000, + RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000, + RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used + RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, + RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, + RENDER_DEBUG_IMPOSTORS = 0x100000000, RENDER_DEBUG_SH = 0x200000000, - }; + }; public: - - LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); - - void updateCamera(bool reset = false); - - LLVector3 mFlyCamPosition; - LLQuaternion mFlyCamRotation; - - bool mBackfaceCull; - S32 mMatrixOpCount; - S32 mTextureMatrixOps; - S32 mNumVisibleNodes; - - S32 mDebugTextureUploadCost; - S32 mDebugSculptUploadCost; - S32 mDebugMeshUploadCost; - - S32 mNumVisibleFaces; - - static S32 sCompiles; - - static bool sShowHUDAttachments; - static bool sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. - static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write - static bool sDelayVBUpdate; - static bool sAutoMaskAlphaDeferred; - static bool sAutoMaskAlphaNonDeferred; - static bool sDisableShaders; // if true, rendering will be done without shaders - static bool sRenderBump; - static bool sBakeSunlight; - static bool sNoAlpha; - static bool sUseTriStrips; - static bool sUseFarClip; - static bool sShadowRender; - static bool sWaterReflections; - static bool sDynamicLOD; - static bool sPickAvatar; - static bool sReflectionRender; - static bool sDistortionRender; - static bool sImpostorRender; - static bool sImpostorRenderAlphaDepthPass; - static bool sUnderWaterRender; - static bool sRenderGlow; - static bool sTextureBindTest; - static bool sRenderFrameTest; - static bool sRenderAttachedLights; - static bool sRenderAttachedParticles; - static bool sRenderDeferred; - static bool sMemAllocationThrottled; - static S32 sVisibleLightCount; - static F32 sMinRenderSize; - static bool sRenderingHUDs; + + LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); + + void updateCamera(bool reset = false); + + LLVector3 mFlyCamPosition; + LLQuaternion mFlyCamRotation; + + bool mBackfaceCull; + S32 mMatrixOpCount; + S32 mTextureMatrixOps; + S32 mNumVisibleNodes; + + S32 mDebugTextureUploadCost; + S32 mDebugSculptUploadCost; + S32 mDebugMeshUploadCost; + + S32 mNumVisibleFaces; + + static S32 sCompiles; + + static bool sShowHUDAttachments; + static bool sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. + static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write + static bool sDelayVBUpdate; + static bool sAutoMaskAlphaDeferred; + static bool sAutoMaskAlphaNonDeferred; + static bool sDisableShaders; // if true, rendering will be done without shaders + static bool sRenderBump; + static bool sBakeSunlight; + static bool sNoAlpha; + static bool sUseTriStrips; + static bool sUseFarClip; + static bool sShadowRender; + static bool sWaterReflections; + static bool sDynamicLOD; + static bool sPickAvatar; + static bool sReflectionRender; + static bool sDistortionRender; + static bool sImpostorRender; + static bool sImpostorRenderAlphaDepthPass; + static bool sUnderWaterRender; + static bool sRenderGlow; + static bool sTextureBindTest; + static bool sRenderFrameTest; + static bool sRenderAttachedLights; + static bool sRenderAttachedParticles; + static bool sRenderDeferred; + static bool sMemAllocationThrottled; + static S32 sVisibleLightCount; + static F32 sMinRenderSize; + static bool sRenderingHUDs; static F32 sDistortionWaterClipPlaneMargin; - static LLTrace::EventStatHandle sStatBatchSize; - - //screen texture - U32 mScreenWidth; - U32 mScreenHeight; - - LLRenderTarget mScreen; - LLRenderTarget mUIScreen; - LLRenderTarget mDeferredScreen; - LLRenderTarget mFXAABuffer; - LLRenderTarget mEdgeMap; - LLRenderTarget mDeferredDepth; - LLRenderTarget mOcclusionDepth; - LLRenderTarget mDeferredLight; - LLRenderTarget mHighlight; - LLRenderTarget mPhysicsDisplay; + static LLTrace::EventStatHandle sStatBatchSize; + + //screen texture + U32 mScreenWidth; + U32 mScreenHeight; + + LLRenderTarget mScreen; + LLRenderTarget mUIScreen; + LLRenderTarget mDeferredScreen; + LLRenderTarget mFXAABuffer; + LLRenderTarget mEdgeMap; + LLRenderTarget mDeferredDepth; + LLRenderTarget mOcclusionDepth; + LLRenderTarget mDeferredLight; + LLRenderTarget mHighlight; + LLRenderTarget mPhysicsDisplay; LLCullResult mSky; LLCullResult mReflectedObjects; LLCullResult mRefractedObjects; - //utility buffer for rendering post effects, gets abused by renderDeferredLighting - LLPointer mDeferredVB; - - //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] - LLPointer mCubeVB; - - //sun shadow map - LLRenderTarget mShadow[6]; - LLRenderTarget mShadowOcclusion[6]; - - std::vector mShadowFrustPoints[4]; - LLVector4 mShadowError; - LLVector4 mShadowFOV; - LLVector3 mShadowFrustOrigin[4]; - LLCamera mShadowCamera[8]; - LLVector3 mShadowExtents[4][2]; - glh::matrix4f mSunShadowMatrix[6]; - glh::matrix4f mShadowModelview[6]; - glh::matrix4f mShadowProjection[6]; + //utility buffer for rendering post effects, gets abused by renderDeferredLighting + LLPointer mDeferredVB; + + //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] + LLPointer mCubeVB; + + //sun shadow map + LLRenderTarget mShadow[6]; + LLRenderTarget mShadowOcclusion[6]; + + std::vector mShadowFrustPoints[4]; + LLVector4 mShadowError; + LLVector4 mShadowFOV; + LLVector3 mShadowFrustOrigin[4]; + LLCamera mShadowCamera[8]; + LLVector3 mShadowExtents[4][2]; + glh::matrix4f mSunShadowMatrix[6]; + glh::matrix4f mShadowModelview[6]; + glh::matrix4f mShadowProjection[6]; glh::matrix4f mReflectionModelView; - LLPointer mShadowSpotLight[2]; - F32 mSpotLightFade[2]; - LLPointer mTargetShadowSpotLight[2]; + LLPointer mShadowSpotLight[2]; + F32 mSpotLightFade[2]; + LLPointer mTargetShadowSpotLight[2]; - LLVector4 mSunClipPlanes; - LLVector4 mSunOrthoClipPlanes; - LLVector2 mScreenScale; + LLVector4 mSunClipPlanes; + LLVector4 mSunOrthoClipPlanes; + LLVector2 mScreenScale; - //water reflection texture - LLRenderTarget mWaterRef; + //water reflection texture + LLRenderTarget mWaterRef; - //water distortion texture (refraction) - LLRenderTarget mWaterDis; + //water distortion texture (refraction) + LLRenderTarget mWaterDis; - //texture for making the glow - LLRenderTarget mGlow[3]; + //texture for making the glow + LLRenderTarget mGlow[3]; - //noise map - U32 mNoiseMap; - U32 mTrueNoiseMap; - U32 mLightFunc; + //noise map + U32 mNoiseMap; + U32 mTrueNoiseMap; + U32 mLightFunc; - LLColor4 mSunDiffuse; - LLColor4 mMoonDiffuse; - LLVector4 mSunDir; - LLVector4 mMoonDir; + LLColor4 mSunDiffuse; + LLColor4 mMoonDiffuse; + LLVector4 mSunDir; + LLVector4 mMoonDir; bool mNeedsShadowTargetClear; - LLVector4 mTransformedSunDir; - LLVector4 mTransformedMoonDir; + LLVector4 mTransformedSunDir; + LLVector4 mTransformedMoonDir; - bool mInitialized; - bool mVertexShadersEnabled; - S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed + bool mInitialized; + bool mVertexShadersEnabled; + S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed - U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback + U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback protected: - bool mRenderTypeEnabled[NUM_RENDER_TYPES]; - std::stack mRenderTypeEnableStack; - - U32 mRenderDebugFeatureMask; - U64 mRenderDebugMask; - U64 mOldRenderDebugMask; - std::stack mRenderDebugFeatureStack; - - - ///////////////////////////////////////////// - // - // - LLDrawable::drawable_vector_t mMovedList; - LLDrawable::drawable_vector_t mMovedBridge; - LLDrawable::drawable_vector_t mShiftList; - - ///////////////////////////////////////////// - // - // - struct Light - { - Light(LLDrawable* ptr, F32 d, F32 f = 0.0f) - : drawable(ptr), - dist(d), - fade(f) - {} - LLPointer drawable; - F32 dist; - F32 fade; - struct compare - { - bool operator()(const Light& a, const Light& b) const - { - if ( a.dist < b.dist ) - return true; - else if ( a.dist > b.dist ) - return false; - else - return a.drawable < b.drawable; - } - }; - }; - typedef std::set< Light, Light::compare > light_set_t; - - LLDrawable::drawable_set_t mLights; - light_set_t mNearbyLights; // lights near camera - LLColor4 mHWLightColors[8]; - - ///////////////////////////////////////////// - // - // Different queues of drawables being processed. - // - LLDrawable::drawable_list_t mBuildQ1; // priority - LLDrawable::drawable_list_t mBuildQ2; // non-priority - LLSpatialGroup::sg_vector_t mGroupQ1; //priority - LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority - - LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref - - LLSpatialGroup::sg_vector_t mMeshDirtyGroup; //groups that need rebuildMesh called - U32 mMeshDirtyQueryObject; - - LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius - - bool mGroupQ2Locked; - bool mGroupQ1Locked; - - bool mResetVertexBuffers; //if true, clear vertex buffers on next update - - LLViewerObject::vobj_list_t mCreateQ; - - LLDrawable::drawable_set_t mRetexturedList; - - class HighlightItem - { - public: - const LLPointer 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 mHighlightSet; - LLPointer mHighlightObject; - - ////////////////////////////////////////////////// - // - // Draw pools are responsible for storing all rendered data, - // and performing the actual rendering of objects. - // - struct compare_pools - { - bool operator()(const LLDrawPool* a, const LLDrawPool* b) const - { - if (!a) - return true; - else if (!b) - return false; - else - { - S32 atype = a->getType(); - S32 btype = b->getType(); - if (atype < btype) - return true; - else if (atype > btype) - return false; - else - return a->getId() < b->getId(); - } - } - }; - typedef std::set pool_set_t; - pool_set_t mPools; - LLDrawPool* mLastRebuildPool; - - // For quick-lookups into mPools (mapped by texture pointer) - std::map mTerrainPools; - std::map mTreePools; - LLDrawPoolAlpha* mAlphaPool; - LLDrawPool* mSkyPool; - LLDrawPool* mTerrainPool; - LLDrawPool* mWaterPool; - LLDrawPool* mGroundPool; - LLRenderPass* mSimplePool; - LLRenderPass* mGrassPool; - LLRenderPass* mAlphaMaskPool; - LLRenderPass* mFullbrightAlphaMaskPool; - LLRenderPass* mFullbrightPool; - LLDrawPool* mInvisiblePool; - LLDrawPool* mGlowPool; - LLDrawPool* mBumpPool; - LLDrawPool* mMaterialsPool; - LLDrawPool* mWLSkyPool; - // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar - + bool mRenderTypeEnabled[NUM_RENDER_TYPES]; + std::stack mRenderTypeEnableStack; + + U32 mRenderDebugFeatureMask; + U64 mRenderDebugMask; + U64 mOldRenderDebugMask; + std::stack mRenderDebugFeatureStack; + + + ///////////////////////////////////////////// + // + // + LLDrawable::drawable_vector_t mMovedList; + LLDrawable::drawable_vector_t mMovedBridge; + LLDrawable::drawable_vector_t mShiftList; + + ///////////////////////////////////////////// + // + // + struct Light + { + Light(LLDrawable* ptr, F32 d, F32 f = 0.0f) + : drawable(ptr), + dist(d), + fade(f) + {} + LLPointer drawable; + F32 dist; + F32 fade; + struct compare + { + bool operator()(const Light& a, const Light& b) const + { + if ( a.dist < b.dist ) + return true; + else if ( a.dist > b.dist ) + return false; + else + return a.drawable < b.drawable; + } + }; + }; + typedef std::set< Light, Light::compare > light_set_t; + + LLDrawable::drawable_set_t mLights; + light_set_t mNearbyLights; // lights near camera + LLColor4 mHWLightColors[8]; + + ///////////////////////////////////////////// + // + // Different queues of drawables being processed. + // + LLDrawable::drawable_list_t mBuildQ1; // priority + LLDrawable::drawable_list_t mBuildQ2; // non-priority + LLSpatialGroup::sg_vector_t mGroupQ1; //priority + LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority + + LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref + + LLSpatialGroup::sg_vector_t mMeshDirtyGroup; //groups that need rebuildMesh called + U32 mMeshDirtyQueryObject; + + LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius + + bool mGroupQ2Locked; + bool mGroupQ1Locked; + + bool mResetVertexBuffers; //if true, clear vertex buffers on next update + + LLViewerObject::vobj_list_t mCreateQ; + + LLDrawable::drawable_set_t mRetexturedList; + + class HighlightItem + { + public: + const LLPointer 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 mHighlightSet; + LLPointer mHighlightObject; + + ////////////////////////////////////////////////// + // + // Draw pools are responsible for storing all rendered data, + // and performing the actual rendering of objects. + // + struct compare_pools + { + bool operator()(const LLDrawPool* a, const LLDrawPool* b) const + { + if (!a) + return true; + else if (!b) + return false; + else + { + S32 atype = a->getType(); + S32 btype = b->getType(); + if (atype < btype) + return true; + else if (atype > btype) + return false; + else + return a->getId() < b->getId(); + } + } + }; + typedef std::set pool_set_t; + pool_set_t mPools; + LLDrawPool* mLastRebuildPool; + + // For quick-lookups into mPools (mapped by texture pointer) + std::map mTerrainPools; + std::map mTreePools; + LLDrawPoolAlpha* mAlphaPool; + LLDrawPool* mSkyPool; + LLDrawPool* mTerrainPool; + LLDrawPool* mWaterPool; + LLDrawPool* mGroundPool; + LLRenderPass* mSimplePool; + LLRenderPass* mGrassPool; + LLRenderPass* mAlphaMaskPool; + LLRenderPass* mFullbrightAlphaMaskPool; + LLRenderPass* mFullbrightPool; + LLDrawPool* mInvisiblePool; + LLDrawPool* mGlowPool; + LLDrawPool* mBumpPool; + LLDrawPool* mMaterialsPool; + LLDrawPool* mWLSkyPool; + // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar + public: - std::vector mHighlightFaces; // highlight faces on physical objects + std::vector mHighlightFaces; // highlight faces on physical objects protected: - std::vector mSelectedFaces; - - class DebugBlip - { - public: - LLColor4 mColor; - LLVector3 mPosition; - F32 mAge; - - DebugBlip(const LLVector3& position, const LLColor4& color) - : mColor(color), mPosition(position), mAge(0.f) - { } - }; - - std::list mDebugBlips; - - LLPointer mFaceSelectImagep; - - U32 mLightMask; - U32 mLightMovingMask; - S32 mLightingDetail; - - static bool sRenderPhysicalBeacons; - static bool sRenderMOAPBeacons; - static bool sRenderScriptedTouchBeacons; - static bool sRenderScriptedBeacons; - static bool sRenderParticleBeacons; - static bool sRenderSoundBeacons; + std::vector mSelectedFaces; + + class DebugBlip + { + public: + LLColor4 mColor; + LLVector3 mPosition; + F32 mAge; + + DebugBlip(const LLVector3& position, const LLColor4& color) + : mColor(color), mPosition(position), mAge(0.f) + { } + }; + + std::list mDebugBlips; + + LLPointer mFaceSelectImagep; + + U32 mLightMask; + U32 mLightMovingMask; + S32 mLightingDetail; + + static bool sRenderPhysicalBeacons; + static bool sRenderMOAPBeacons; + static bool sRenderScriptedTouchBeacons; + static bool sRenderScriptedBeacons; + static bool sRenderParticleBeacons; + static bool sRenderSoundBeacons; public: - static bool sRenderBeacons; - static bool sRenderHighlight; - - // Determines which set of UVs to use in highlight display - // - static LLRender::eTexIndex sRenderHighlightTextureChannel; - - //debug use - static U32 sCurRenderPoolType ; - - //cached settings - static bool WindLightUseAtmosShaders; - static bool VertexShaderEnable; - static bool RenderAvatarVP; - static bool RenderDeferred; - static F32 RenderDeferredSunWash; - static U32 RenderFSAASamples; - static U32 RenderResolutionDivisor; - static bool RenderUIBuffer; - static S32 RenderShadowDetail; - static bool RenderDeferredSSAO; - static F32 RenderShadowResolutionScale; - static bool RenderLocalLights; - static bool RenderDelayCreation; - static bool RenderAnimateRes; - static bool FreezeTime; - static S32 DebugBeaconLineWidth; - static F32 RenderHighlightBrightness; - static LLColor4 RenderHighlightColor; - static F32 RenderHighlightThickness; - static bool RenderSpotLightsInNondeferred; - static LLColor4 PreviewAmbientColor; - static LLColor4 PreviewDiffuse0; - static LLColor4 PreviewSpecular0; - static LLColor4 PreviewDiffuse1; - static LLColor4 PreviewSpecular1; - static LLColor4 PreviewDiffuse2; - static LLColor4 PreviewSpecular2; - static LLVector3 PreviewDirection0; - static LLVector3 PreviewDirection1; - static LLVector3 PreviewDirection2; - static F32 RenderGlowMinLuminance; - static F32 RenderGlowMaxExtractAlpha; - static F32 RenderGlowWarmthAmount; - static LLVector3 RenderGlowLumWeights; - static LLVector3 RenderGlowWarmthWeights; - static S32 RenderGlowResolutionPow; - static S32 RenderGlowIterations; - static F32 RenderGlowWidth; - static F32 RenderGlowStrength; - static bool RenderDepthOfField; - static bool RenderDepthOfFieldInEditMode; - static F32 CameraFocusTransitionTime; - static F32 CameraFNumber; - static F32 CameraFocalLength; - static F32 CameraFieldOfView; - static F32 RenderShadowNoise; - static F32 RenderShadowBlurSize; - static F32 RenderSSAOScale; - static U32 RenderSSAOMaxScale; - static F32 RenderSSAOFactor; - static LLVector3 RenderSSAOEffect; - static F32 RenderShadowOffsetError; - static F32 RenderShadowBiasError; - static F32 RenderShadowOffset; - static F32 RenderShadowBias; - static F32 RenderSpotShadowOffset; - static F32 RenderSpotShadowBias; - static F32 RenderEdgeDepthCutoff; - static F32 RenderEdgeNormCutoff; - static LLVector3 RenderShadowGaussian; - static F32 RenderShadowBlurDistFactor; - static bool RenderDeferredAtmospheric; - static S32 RenderReflectionDetail; - static F32 RenderHighlightFadeTime; - static LLVector3 RenderShadowClipPlanes; - static LLVector3 RenderShadowOrthoClipPlanes; - static LLVector3 RenderShadowNearDist; - static F32 RenderFarClip; - static LLVector3 RenderShadowSplitExponent; - static F32 RenderShadowErrorCutoff; - static F32 RenderShadowFOVCutoff; - static bool CameraOffset; - static F32 CameraMaxCoF; - static F32 CameraDoFResScale; - static F32 RenderAutoHideSurfaceAreaLimit; + static bool sRenderBeacons; + static bool sRenderHighlight; + + // Determines which set of UVs to use in highlight display + // + static LLRender::eTexIndex sRenderHighlightTextureChannel; + + //debug use + static U32 sCurRenderPoolType ; + + //cached settings + static bool WindLightUseAtmosShaders; + static bool VertexShaderEnable; + static bool RenderAvatarVP; + static bool RenderDeferred; + static F32 RenderDeferredSunWash; + static U32 RenderFSAASamples; + static U32 RenderResolutionDivisor; + static bool RenderUIBuffer; + static S32 RenderShadowDetail; + static bool RenderDeferredSSAO; + static F32 RenderShadowResolutionScale; + static bool RenderLocalLights; + static bool RenderDelayCreation; + static bool RenderAnimateRes; + static bool FreezeTime; + static S32 DebugBeaconLineWidth; + static F32 RenderHighlightBrightness; + static LLColor4 RenderHighlightColor; + static F32 RenderHighlightThickness; + static bool RenderSpotLightsInNondeferred; + static LLColor4 PreviewAmbientColor; + static LLColor4 PreviewDiffuse0; + static LLColor4 PreviewSpecular0; + static LLColor4 PreviewDiffuse1; + static LLColor4 PreviewSpecular1; + static LLColor4 PreviewDiffuse2; + static LLColor4 PreviewSpecular2; + static LLVector3 PreviewDirection0; + static LLVector3 PreviewDirection1; + static LLVector3 PreviewDirection2; + static F32 RenderGlowMinLuminance; + static F32 RenderGlowMaxExtractAlpha; + static F32 RenderGlowWarmthAmount; + static LLVector3 RenderGlowLumWeights; + static LLVector3 RenderGlowWarmthWeights; + static S32 RenderGlowResolutionPow; + static S32 RenderGlowIterations; + static F32 RenderGlowWidth; + static F32 RenderGlowStrength; + static bool RenderDepthOfField; + static bool RenderDepthOfFieldInEditMode; + static F32 CameraFocusTransitionTime; + static F32 CameraFNumber; + static F32 CameraFocalLength; + static F32 CameraFieldOfView; + static F32 RenderShadowNoise; + static F32 RenderShadowBlurSize; + static F32 RenderSSAOScale; + static U32 RenderSSAOMaxScale; + static F32 RenderSSAOFactor; + static LLVector3 RenderSSAOEffect; + static F32 RenderShadowOffsetError; + static F32 RenderShadowBiasError; + static F32 RenderShadowOffset; + static F32 RenderShadowBias; + static F32 RenderSpotShadowOffset; + static F32 RenderSpotShadowBias; + static F32 RenderEdgeDepthCutoff; + static F32 RenderEdgeNormCutoff; + static LLVector3 RenderShadowGaussian; + static F32 RenderShadowBlurDistFactor; + static bool RenderDeferredAtmospheric; + static S32 RenderReflectionDetail; + static F32 RenderHighlightFadeTime; + static LLVector3 RenderShadowClipPlanes; + static LLVector3 RenderShadowOrthoClipPlanes; + static LLVector3 RenderShadowNearDist; + static F32 RenderFarClip; + static LLVector3 RenderShadowSplitExponent; + static F32 RenderShadowErrorCutoff; + static F32 RenderShadowFOVCutoff; + static bool CameraOffset; + static F32 CameraMaxCoF; + static F32 CameraDoFResScale; + static F32 RenderAutoHideSurfaceAreaLimit; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); -- cgit v1.2.3 From 15270f697a0e6a4f14944ac20382f8bbcc8ea86b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 12 Mar 2019 10:52:00 -0700 Subject: Tab restoration project. 'warn-on-failure:no-tabs' --- indra/newview/pipeline.h | 1638 +++++++++++++++++++++++----------------------- 1 file changed, 819 insertions(+), 819 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 38fb26d811..a31f880fbf 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -53,8 +53,8 @@ class LLDrawPoolAlpha; typedef enum e_avatar_skinning_method { - SKIN_METHOD_SOFTWARE, - SKIN_METHOD_VERTEX_PROGRAM + SKIN_METHOD_SOFTWARE, + SKIN_METHOD_VERTEX_PROGRAM } EAvatarSkinningMethod; bool compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn't be defined here! @@ -93,861 +93,861 @@ extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON; class LLPipeline { public: - LLPipeline(); - ~LLPipeline(); - - void destroyGL(); - void restoreGL(); - void resetVertexBuffers(); - void doResetVertexBuffers(bool forced = false); - void resizeScreenTexture(); - void releaseGLBuffers(); - void releaseLUTBuffers(); - void releaseScreenBuffers(); - void createGLBuffers(); - void createLUTBuffers(); - - //allocate the largest screen buffer possible up to resX, resY - //returns true if full size buffer allocated, false if some other size is allocated - bool allocateScreenBuffer(U32 resX, U32 resY); - - typedef enum { - FBO_SUCCESS_FULLRES = 0, - FBO_SUCCESS_LOWRES, - FBO_FAILURE - } eFBOStatus; + LLPipeline(); + ~LLPipeline(); + + void destroyGL(); + void restoreGL(); + void resetVertexBuffers(); + void doResetVertexBuffers(bool forced = false); + void resizeScreenTexture(); + void releaseGLBuffers(); + void releaseLUTBuffers(); + void releaseScreenBuffers(); + void createGLBuffers(); + void createLUTBuffers(); + + //allocate the largest screen buffer possible up to resX, resY + //returns true if full size buffer allocated, false if some other size is allocated + bool allocateScreenBuffer(U32 resX, U32 resY); + + typedef enum { + FBO_SUCCESS_FULLRES = 0, + FBO_SUCCESS_LOWRES, + FBO_FAILURE + } eFBOStatus; private: - //implementation of above, wrapped for easy error handling - eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY); + //implementation of above, wrapped for easy error handling + eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY); public: - //attempt to allocate screen buffers at resX, resY - //returns true if allocation successful, false otherwise - bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); - - void allocatePhysicsBuffer(); - - void resetVertexBuffers(LLDrawable* drawable); - void generateImpostor(LLVOAvatar* avatar); - void bindScreenToTexture(); - void renderBloom(bool for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); - - void init(); - void cleanup(); - bool isInit() { return mInitialized; }; - - /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. - /// @return Draw pool, or NULL if not found. - LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); - - /// @brief Get a draw pool for faces of the appropriate type and texture. Create if necessary. - /// @return Always returns a draw pool. - LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); - - /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. - static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerTexture* te_image); - static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* imagep); - - void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! - void removePool( LLDrawPool* poolp ); - - void allocDrawable(LLViewerObject *obj); - - void unlinkDrawable(LLDrawable*); - - static void removeMutedAVsLights(LLVOAvatar*); - - // Object related methods - void markVisible(LLDrawable *drawablep, LLCamera& camera); - void markOccluder(LLSpatialGroup* group); - - //downsample source to dest, taking the maximum depth value per pixel in source and writing to dest - // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided - void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - - // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. - void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - - void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - void doOcclusion(LLCamera& camera); - void markNotCulled(LLSpatialGroup* group, LLCamera &camera); - 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); - void markPartitionMove(LLDrawable* drawablep); - void markMeshDirty(LLSpatialGroup* group); - - //get the object between start and end that's closest to start. - LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, - bool pick_transparent, - bool pick_rigged, - S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); - - //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index - LLVOPartGroup* lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, - S32* face_hit); - - - LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, - bool pick_transparent, - S32* face_hit, // return the face hit - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point - ); - - // Something about these textures has changed. Dirty them. - void dirtyPoolObjectTextures(const std::set& textures); - - void resetDrawOrders(); - - U32 addObject(LLViewerObject *obj); - - void enableShadows(const bool enable_shadows); + //attempt to allocate screen buffers at resX, resY + //returns true if allocation successful, false otherwise + bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); + + void allocatePhysicsBuffer(); + + void resetVertexBuffers(LLDrawable* drawable); + void generateImpostor(LLVOAvatar* avatar); + void bindScreenToTexture(); + void renderBloom(bool for_snapshot, F32 zoom_factor = 1.f, int subfield = 0); + + void init(); + void cleanup(); + bool isInit() { return mInitialized; }; + + /// @brief Get a draw pool from pool type (POOL_SIMPLE, POOL_MEDIA) and texture. + /// @return Draw pool, or NULL if not found. + LLDrawPool *findPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + + /// @brief Get a draw pool for faces of the appropriate type and texture. Create if necessary. + /// @return Always returns a draw pool. + LLDrawPool *getPool(const U32 pool_type, LLViewerTexture *tex0 = NULL); + + /// @brief Figures out draw pool type from texture entry. Creates pool if necessary. + static LLDrawPool* getPoolFromTE(const LLTextureEntry* te, LLViewerTexture* te_image); + static U32 getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* imagep); + + void addPool(LLDrawPool *poolp); // Only to be used by LLDrawPool classes for splitting pools! + void removePool( LLDrawPool* poolp ); + + void allocDrawable(LLViewerObject *obj); + + void unlinkDrawable(LLDrawable*); + + static void removeMutedAVsLights(LLVOAvatar*); + + // Object related methods + void markVisible(LLDrawable *drawablep, LLCamera& camera); + void markOccluder(LLSpatialGroup* group); + + //downsample source to dest, taking the maximum depth value per pixel in source and writing to dest + // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided + void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + + // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. + void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + + void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + void doOcclusion(LLCamera& camera); + void markNotCulled(LLSpatialGroup* group, LLCamera &camera); + 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); + void markPartitionMove(LLDrawable* drawablep); + void markMeshDirty(LLSpatialGroup* group); + + //get the object between start and end that's closest to start. + LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, + bool pick_transparent, + bool pick_rigged, + S32* face_hit, // return the face hit + LLVector4a* intersection = NULL, // return the intersection point + LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point + LLVector4a* normal = NULL, // return the surface normal at the intersection point + LLVector4a* tangent = NULL // return the surface tangent at the intersection point + ); + + //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index + LLVOPartGroup* lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, + S32* face_hit); + + + LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, + bool pick_transparent, + S32* face_hit, // return the face hit + LLVector4a* intersection = NULL, // return the intersection point + LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point + LLVector4a* normal = NULL, // return the surface normal at the intersection point + LLVector4a* tangent = NULL // return the surface tangent at the intersection point + ); + + // Something about these textures has changed. Dirty them. + void dirtyPoolObjectTextures(const std::set& textures); + + void resetDrawOrders(); + + U32 addObject(LLViewerObject *obj); + + void enableShadows(const bool enable_shadows); void releaseShadowTargets(); void releaseShadowTarget(U32 index); -// void setLocalLighting(const bool local_lighting); -// bool isLocalLightingEnabled() const; - S32 setLightingDetail(S32 level); - S32 getLightingDetail() const { return mLightingDetail; } - S32 getMaxLightingDetail() const; - - void setUseVertexShaders(bool use_shaders); - bool getUseVertexShaders() const { return mVertexShadersEnabled; } - bool canUseVertexShaders(); - bool canUseWindLightShaders() const; - bool canUseWindLightShadersOnObjects() const; - bool canUseAntiAliasing() const; - - // phases - void resetFrameStats(); - - void updateMoveDampedAsync(LLDrawable* drawablep); - void updateMoveNormalAsync(LLDrawable* drawablep); - void updateMovedList(LLDrawable::drawable_vector_t& move_list); - void updateMove(); - bool visibleObjectsInFrustum(LLCamera& camera); - bool getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); - bool getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector& fp, LLVector3 light_dir = LLVector3(0,0,0)); - void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //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 processPartitionQ(); - void updateGeom(F32 max_dtime); - void updateGL(); - void rebuildPriorityGroups(); - void rebuildGroups(); - void clearRebuildGroups(); - void clearRebuildDrawables(); - - //calculate pixel area of given box from vantage point of given camera - static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); - static F32 calcPixelArea(const LLVector4a& center, const LLVector4a& size, LLCamera &camera); - - void stateSort(LLCamera& camera, LLCullResult& result); - void stateSort(LLSpatialGroup* group, LLCamera& camera); - void stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_changed = FALSE); - void stateSort(LLDrawable* drawablep, LLCamera& camera); - void postSort(LLCamera& camera); - void forAllVisibleDrawables(void (*func)(LLDrawable*)); - - void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); - void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); - - void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); - - void grabReferences(LLCullResult& result); - void clearReferences(); - - //check references will assert that there are no references in sCullResult to the provided data - void checkReferences(LLFace* face); - void checkReferences(LLDrawable* drawable); - void checkReferences(LLDrawInfo* draw_info); - void checkReferences(LLSpatialGroup* group); - - - void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); - void renderGeomDeferred(LLCamera& camera); - void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); - void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); - void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); - - void unbindDeferredShader(LLGLSLShader& shader); - void renderDeferredLighting(LLRenderTarget* light_target); - void postDeferredGammaCorrect(LLRenderTarget* screen_target); - - void generateWaterReflection(LLCamera& camera); - void generateSunShadow(LLCamera& camera); +// void setLocalLighting(const bool local_lighting); +// bool isLocalLightingEnabled() const; + S32 setLightingDetail(S32 level); + S32 getLightingDetail() const { return mLightingDetail; } + S32 getMaxLightingDetail() const; + + void setUseVertexShaders(bool use_shaders); + bool getUseVertexShaders() const { return mVertexShadersEnabled; } + bool canUseVertexShaders(); + bool canUseWindLightShaders() const; + bool canUseWindLightShadersOnObjects() const; + bool canUseAntiAliasing() const; + + // phases + void resetFrameStats(); + + void updateMoveDampedAsync(LLDrawable* drawablep); + void updateMoveNormalAsync(LLDrawable* drawablep); + void updateMovedList(LLDrawable::drawable_vector_t& move_list); + void updateMove(); + bool visibleObjectsInFrustum(LLCamera& camera); + bool getVisibleExtents(LLCamera& camera, LLVector3 &min, LLVector3& max); + bool getVisiblePointCloud(LLCamera& camera, LLVector3 &min, LLVector3& max, std::vector& fp, LLVector3 light_dir = LLVector3(0,0,0)); + void updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip = 0, LLPlane* plane = NULL); //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 processPartitionQ(); + void updateGeom(F32 max_dtime); + void updateGL(); + void rebuildPriorityGroups(); + void rebuildGroups(); + void clearRebuildGroups(); + void clearRebuildDrawables(); + + //calculate pixel area of given box from vantage point of given camera + static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); + static F32 calcPixelArea(const LLVector4a& center, const LLVector4a& size, LLCamera &camera); + + void stateSort(LLCamera& camera, LLCullResult& result); + void stateSort(LLSpatialGroup* group, LLCamera& camera); + void stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_changed = FALSE); + void stateSort(LLDrawable* drawablep, LLCamera& camera); + void postSort(LLCamera& camera); + void forAllVisibleDrawables(void (*func)(LLDrawable*)); + + void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + + void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); + + void grabReferences(LLCullResult& result); + void clearReferences(); + + //check references will assert that there are no references in sCullResult to the provided data + void checkReferences(LLFace* face); + void checkReferences(LLDrawable* drawable); + void checkReferences(LLDrawInfo* draw_info); + void checkReferences(LLSpatialGroup* group); + + + void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); + void renderGeomDeferred(LLCamera& camera); + void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); + void renderGeomShadow(LLCamera& camera); + void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); + void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); + + void unbindDeferredShader(LLGLSLShader& shader); + void renderDeferredLighting(LLRenderTarget* light_target); + void postDeferredGammaCorrect(LLRenderTarget* screen_target); + + void generateWaterReflection(LLCamera& camera); + void generateSunShadow(LLCamera& camera); LLRenderTarget* getShadowTarget(U32 i); - 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, bool use_occlusion, U32 target_width); - void renderHighlights(); - void renderDebug(); - void renderPhysicsDisplay(); - - void rebuildPools(); // Rebuild pools - - void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object - bool verify(); // Verify that all data in the pipeline is "correct" - - S32 getLightCount() const { return mLights.size(); } - - void calcNearbyLights(LLCamera& camera); - void setupHWLights(LLDrawPool* pool); - void setupAvatarLights(bool for_edit = false); - void enableLights(U32 mask); - void enableLightsStatic(); - void enableLightsDynamic(); - void enableLightsAvatar(); - void enableLightsPreview(); - void enableLightsAvatarEdit(const LLColor4& color); - void enableLightsFullbright(const LLColor4& color); - void disableLights(); - - void shiftObjects(const LLVector3 &offset); - - void setLight(LLDrawable *drawablep, bool is_light); - - bool hasRenderBatches(const U32 type) const; - LLCullResult::drawinfo_iterator beginRenderMap(U32 type); - LLCullResult::drawinfo_iterator endRenderMap(U32 type); - LLCullResult::sg_iterator beginAlphaGroups(); - LLCullResult::sg_iterator endAlphaGroups(); - - - void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); - - bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); } - bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); } - void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; } - void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; } - void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; } - void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; } - - bool hasRenderType(const U32 type) const; - bool hasAnyRenderType(const U32 type, ...) const; - - void setRenderTypeMask(U32 type, ...); - // This is equivalent to 'setRenderTypeMask' - //void orRenderTypeMask(U32 type, ...); - void andRenderTypeMask(U32 type, ...); - void clearRenderTypeMask(U32 type, ...); - void setAllRenderTypes(); - void clearAllRenderTypes(); - - void pushRenderTypeMask(); - void popRenderTypeMask(); - - void pushRenderDebugFeatureMask(); - void popRenderDebugFeatureMask(); - - static void toggleRenderType(U32 type); - - // For UI control of render features - static bool hasRenderTypeControl(U32 data); - static void toggleRenderDebug(U64 data); - static void toggleRenderDebugFeature(U32 data); - static void toggleRenderTypeControl(U32 data); - static bool toggleRenderTypeControlNegated(S32 data); - static bool toggleRenderDebugControl(U64 data); - static bool toggleRenderDebugFeatureControl(U32 data); - static void setRenderDebugFeatureControl(U32 bit, bool value); - - static void setRenderParticleBeacons(bool val); - static void toggleRenderParticleBeacons(); - static bool getRenderParticleBeacons(); - - static void setRenderSoundBeacons(bool val); - static void toggleRenderSoundBeacons(); - static bool getRenderSoundBeacons(); - - static void setRenderMOAPBeacons(bool val); - static void toggleRenderMOAPBeacons(); - static bool getRenderMOAPBeacons(); - - static void setRenderPhysicalBeacons(bool val); - static void toggleRenderPhysicalBeacons(); - static bool getRenderPhysicalBeacons(); - - static void setRenderScriptedBeacons(bool val); - static void toggleRenderScriptedBeacons(); - static bool getRenderScriptedBeacons(); - - static void setRenderScriptedTouchBeacons(bool val); - static void toggleRenderScriptedTouchBeacons(); - static bool getRenderScriptedTouchBeacons(); - - static void setRenderBeacons(bool val); - static void toggleRenderBeacons(); - static bool getRenderBeacons(); - - static void setRenderHighlights(bool val); - static void toggleRenderHighlights(); - static bool getRenderHighlights(); - static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay - - static void updateRenderBump(); - static void updateRenderDeferred(); - static void refreshCachedSettings(); - - static void throttleNewMemoryAllocation(bool disable); - - - - void addDebugBlip(const LLVector3& position, const LLColor4& color); - - void hidePermanentObjects( std::vector& restoreList ); - void restorePermanentObjects( const std::vector& restoreList ); - void skipRenderingOfTerrain( bool flag ); - void hideObject( const LLUUID& id ); - void restoreHiddenObject( const LLUUID& id ); + 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, bool use_occlusion, U32 target_width); + void renderHighlights(); + void renderDebug(); + void renderPhysicsDisplay(); + + void rebuildPools(); // Rebuild pools + + void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object + bool verify(); // Verify that all data in the pipeline is "correct" + + S32 getLightCount() const { return mLights.size(); } + + void calcNearbyLights(LLCamera& camera); + void setupHWLights(LLDrawPool* pool); + void setupAvatarLights(bool for_edit = false); + void enableLights(U32 mask); + void enableLightsStatic(); + void enableLightsDynamic(); + void enableLightsAvatar(); + void enableLightsPreview(); + void enableLightsAvatarEdit(const LLColor4& color); + void enableLightsFullbright(const LLColor4& color); + void disableLights(); + + void shiftObjects(const LLVector3 &offset); + + void setLight(LLDrawable *drawablep, bool is_light); + + bool hasRenderBatches(const U32 type) const; + LLCullResult::drawinfo_iterator beginRenderMap(U32 type); + LLCullResult::drawinfo_iterator endRenderMap(U32 type); + LLCullResult::sg_iterator beginAlphaGroups(); + LLCullResult::sg_iterator endAlphaGroups(); + + + void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); + + bool hasRenderDebugFeatureMask(const U32 mask) const { return bool(mRenderDebugFeatureMask & mask); } + bool hasRenderDebugMask(const U64 mask) const { return bool(mRenderDebugMask & mask); } + void setAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0xffffffff; } + void clearAllRenderDebugFeatures() { mRenderDebugFeatureMask = 0x0; } + void setAllRenderDebugDisplays() { mRenderDebugMask = 0xffffffffffffffff; } + void clearAllRenderDebugDisplays() { mRenderDebugMask = 0x0; } + + bool hasRenderType(const U32 type) const; + bool hasAnyRenderType(const U32 type, ...) const; + + void setRenderTypeMask(U32 type, ...); + // This is equivalent to 'setRenderTypeMask' + //void orRenderTypeMask(U32 type, ...); + void andRenderTypeMask(U32 type, ...); + void clearRenderTypeMask(U32 type, ...); + void setAllRenderTypes(); + void clearAllRenderTypes(); + + void pushRenderTypeMask(); + void popRenderTypeMask(); + + void pushRenderDebugFeatureMask(); + void popRenderDebugFeatureMask(); + + static void toggleRenderType(U32 type); + + // For UI control of render features + static bool hasRenderTypeControl(U32 data); + static void toggleRenderDebug(U64 data); + static void toggleRenderDebugFeature(U32 data); + static void toggleRenderTypeControl(U32 data); + static bool toggleRenderTypeControlNegated(S32 data); + static bool toggleRenderDebugControl(U64 data); + static bool toggleRenderDebugFeatureControl(U32 data); + static void setRenderDebugFeatureControl(U32 bit, bool value); + + static void setRenderParticleBeacons(bool val); + static void toggleRenderParticleBeacons(); + static bool getRenderParticleBeacons(); + + static void setRenderSoundBeacons(bool val); + static void toggleRenderSoundBeacons(); + static bool getRenderSoundBeacons(); + + static void setRenderMOAPBeacons(bool val); + static void toggleRenderMOAPBeacons(); + static bool getRenderMOAPBeacons(); + + static void setRenderPhysicalBeacons(bool val); + static void toggleRenderPhysicalBeacons(); + static bool getRenderPhysicalBeacons(); + + static void setRenderScriptedBeacons(bool val); + static void toggleRenderScriptedBeacons(); + static bool getRenderScriptedBeacons(); + + static void setRenderScriptedTouchBeacons(bool val); + static void toggleRenderScriptedTouchBeacons(); + static bool getRenderScriptedTouchBeacons(); + + static void setRenderBeacons(bool val); + static void toggleRenderBeacons(); + static bool getRenderBeacons(); + + static void setRenderHighlights(bool val); + static void toggleRenderHighlights(); + static bool getRenderHighlights(); + static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay + + static void updateRenderBump(); + static void updateRenderDeferred(); + static void refreshCachedSettings(); + + static void throttleNewMemoryAllocation(bool disable); + + + + void addDebugBlip(const LLVector3& position, const LLColor4& color); + + void hidePermanentObjects( std::vector& restoreList ); + void restorePermanentObjects( const std::vector& restoreList ); + void skipRenderingOfTerrain( bool flag ); + void hideObject( const LLUUID& id ); + void restoreHiddenObject( const LLUUID& id ); private: - void unloadShaders(); - void addToQuickLookup( LLDrawPool* new_poolp ); - void removeFromQuickLookup( LLDrawPool* poolp ); - bool updateDrawableGeom(LLDrawable* drawable, bool priority); - void assertInitializedDoError(); - bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; - void connectRefreshCachedSettingsSafe(const std::string name); - void hideDrawable( LLDrawable *pDrawable ); - void unhideDrawable( LLDrawable *pDrawable ); + void unloadShaders(); + void addToQuickLookup( LLDrawPool* new_poolp ); + void removeFromQuickLookup( LLDrawPool* poolp ); + bool updateDrawableGeom(LLDrawable* drawable, bool priority); + void assertInitializedDoError(); + bool assertInitialized() { const bool is_init = isInit(); if (!is_init) assertInitializedDoError(); return is_init; }; + void connectRefreshCachedSettingsSafe(const std::string name); + void hideDrawable( LLDrawable *pDrawable ); + void unhideDrawable( LLDrawable *pDrawable ); public: - enum {GPU_CLASS_MAX = 3 }; - - 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_ALPHA_MASK = LLDrawPool::POOL_ALPHA_MASK, - RENDER_TYPE_FULLBRIGHT_ALPHA_MASK = LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK, - RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, - RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, - RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS, - RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, - RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, - RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, - RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, - 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_POST_BUMP = LLRenderPass::PASS_POST_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_MATERIAL = LLRenderPass::PASS_MATERIAL, - RENDER_TYPE_PASS_MATERIAL_ALPHA = LLRenderPass::PASS_MATERIAL_ALPHA, - RENDER_TYPE_PASS_MATERIAL_ALPHA_MASK = LLRenderPass::PASS_MATERIAL_ALPHA_MASK, - RENDER_TYPE_PASS_MATERIAL_ALPHA_EMISSIVE= LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, - RENDER_TYPE_PASS_SPECMAP = LLRenderPass::PASS_SPECMAP, - RENDER_TYPE_PASS_SPECMAP_BLEND = LLRenderPass::PASS_SPECMAP_BLEND, - RENDER_TYPE_PASS_SPECMAP_MASK = LLRenderPass::PASS_SPECMAP_MASK, - RENDER_TYPE_PASS_SPECMAP_EMISSIVE = LLRenderPass::PASS_SPECMAP_EMISSIVE, - RENDER_TYPE_PASS_NORMMAP = LLRenderPass::PASS_NORMMAP, - RENDER_TYPE_PASS_NORMMAP_BLEND = LLRenderPass::PASS_NORMMAP_BLEND, - RENDER_TYPE_PASS_NORMMAP_MASK = LLRenderPass::PASS_NORMMAP_MASK, - RENDER_TYPE_PASS_NORMMAP_EMISSIVE = LLRenderPass::PASS_NORMMAP_EMISSIVE, - RENDER_TYPE_PASS_NORMSPEC = LLRenderPass::PASS_NORMSPEC, - RENDER_TYPE_PASS_NORMSPEC_BLEND = LLRenderPass::PASS_NORMSPEC_BLEND, - RENDER_TYPE_PASS_NORMSPEC_MASK = LLRenderPass::PASS_NORMSPEC_MASK, - RENDER_TYPE_PASS_NORMSPEC_EMISSIVE = LLRenderPass::PASS_NORMSPEC_EMISSIVE, - // Following are object types (only used in drawable mRenderType) - RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, - RENDER_TYPE_VOLUME, - RENDER_TYPE_PARTICLES, - RENDER_TYPE_CLOUDS, - RENDER_TYPE_HUD_PARTICLES, - NUM_RENDER_TYPES, - END_RENDER_TYPES = NUM_RENDER_TYPES - }; - - enum LLRenderDebugFeatureMask - { - RENDER_DEBUG_FEATURE_UI = 0x0001, - RENDER_DEBUG_FEATURE_SELECTED = 0x0002, - RENDER_DEBUG_FEATURE_HIGHLIGHTED = 0x0004, - RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES = 0x0008, -// RENDER_DEBUG_FEATURE_HW_LIGHTING = 0x0010, - RENDER_DEBUG_FEATURE_FLEXIBLE = 0x0010, - RENDER_DEBUG_FEATURE_FOG = 0x0020, - RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, - RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100, - }; - - enum LLRenderDebugMask: U64 - { - RENDER_DEBUG_COMPOSITION = 0x00000001, - RENDER_DEBUG_VERIFY = 0x00000002, - RENDER_DEBUG_BBOXES = 0x00000004, - RENDER_DEBUG_OCTREE = 0x00000008, - RENDER_DEBUG_WIND_VECTORS = 0x00000010, - RENDER_DEBUG_OCCLUSION = 0x00000020, - RENDER_DEBUG_POINTS = 0x00000040, - RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080, - RENDER_DEBUG_TEXTURE_AREA = 0x00000100, - RENDER_DEBUG_FACE_AREA = 0x00000200, - RENDER_DEBUG_PARTICLES = 0x00000400, - RENDER_DEBUG_GLOW = 0x00000800, // not used - RENDER_DEBUG_TEXTURE_ANIM = 0x00001000, - RENDER_DEBUG_LIGHTS = 0x00002000, - RENDER_DEBUG_BATCH_SIZE = 0x00004000, - RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used - RENDER_DEBUG_RAYCAST = 0x00010000, - RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000, - RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000, - RENDER_DEBUG_SCULPTED = 0x00080000, - RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, - RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, - RENDER_DEBUG_BUILD_QUEUE = 0x00400000, - RENDER_DEBUG_AGENT_TARGET = 0x00800000, - RENDER_DEBUG_UPDATE_TYPE = 0x01000000, - RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, - RENDER_DEBUG_NORMALS = 0x04000000, - RENDER_DEBUG_LOD_INFO = 0x08000000, - RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000, - RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used - RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, - RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, - RENDER_DEBUG_IMPOSTORS = 0x100000000, + enum {GPU_CLASS_MAX = 3 }; + + 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_ALPHA_MASK = LLDrawPool::POOL_ALPHA_MASK, + RENDER_TYPE_FULLBRIGHT_ALPHA_MASK = LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK, + RENDER_TYPE_FULLBRIGHT = LLDrawPool::POOL_FULLBRIGHT, + RENDER_TYPE_BUMP = LLDrawPool::POOL_BUMP, + RENDER_TYPE_MATERIALS = LLDrawPool::POOL_MATERIALS, + RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, + RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, + RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, + RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, + 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_POST_BUMP = LLRenderPass::PASS_POST_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_MATERIAL = LLRenderPass::PASS_MATERIAL, + RENDER_TYPE_PASS_MATERIAL_ALPHA = LLRenderPass::PASS_MATERIAL_ALPHA, + RENDER_TYPE_PASS_MATERIAL_ALPHA_MASK = LLRenderPass::PASS_MATERIAL_ALPHA_MASK, + RENDER_TYPE_PASS_MATERIAL_ALPHA_EMISSIVE= LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, + RENDER_TYPE_PASS_SPECMAP = LLRenderPass::PASS_SPECMAP, + RENDER_TYPE_PASS_SPECMAP_BLEND = LLRenderPass::PASS_SPECMAP_BLEND, + RENDER_TYPE_PASS_SPECMAP_MASK = LLRenderPass::PASS_SPECMAP_MASK, + RENDER_TYPE_PASS_SPECMAP_EMISSIVE = LLRenderPass::PASS_SPECMAP_EMISSIVE, + RENDER_TYPE_PASS_NORMMAP = LLRenderPass::PASS_NORMMAP, + RENDER_TYPE_PASS_NORMMAP_BLEND = LLRenderPass::PASS_NORMMAP_BLEND, + RENDER_TYPE_PASS_NORMMAP_MASK = LLRenderPass::PASS_NORMMAP_MASK, + RENDER_TYPE_PASS_NORMMAP_EMISSIVE = LLRenderPass::PASS_NORMMAP_EMISSIVE, + RENDER_TYPE_PASS_NORMSPEC = LLRenderPass::PASS_NORMSPEC, + RENDER_TYPE_PASS_NORMSPEC_BLEND = LLRenderPass::PASS_NORMSPEC_BLEND, + RENDER_TYPE_PASS_NORMSPEC_MASK = LLRenderPass::PASS_NORMSPEC_MASK, + RENDER_TYPE_PASS_NORMSPEC_EMISSIVE = LLRenderPass::PASS_NORMSPEC_EMISSIVE, + // Following are object types (only used in drawable mRenderType) + RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, + RENDER_TYPE_VOLUME, + RENDER_TYPE_PARTICLES, + RENDER_TYPE_CLOUDS, + RENDER_TYPE_HUD_PARTICLES, + NUM_RENDER_TYPES, + END_RENDER_TYPES = NUM_RENDER_TYPES + }; + + enum LLRenderDebugFeatureMask + { + RENDER_DEBUG_FEATURE_UI = 0x0001, + RENDER_DEBUG_FEATURE_SELECTED = 0x0002, + RENDER_DEBUG_FEATURE_HIGHLIGHTED = 0x0004, + RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES = 0x0008, +// RENDER_DEBUG_FEATURE_HW_LIGHTING = 0x0010, + RENDER_DEBUG_FEATURE_FLEXIBLE = 0x0010, + RENDER_DEBUG_FEATURE_FOG = 0x0020, + RENDER_DEBUG_FEATURE_FR_INFO = 0x0080, + RENDER_DEBUG_FEATURE_FOOT_SHADOWS = 0x0100, + }; + + enum LLRenderDebugMask: U64 + { + RENDER_DEBUG_COMPOSITION = 0x00000001, + RENDER_DEBUG_VERIFY = 0x00000002, + RENDER_DEBUG_BBOXES = 0x00000004, + RENDER_DEBUG_OCTREE = 0x00000008, + RENDER_DEBUG_WIND_VECTORS = 0x00000010, + RENDER_DEBUG_OCCLUSION = 0x00000020, + RENDER_DEBUG_POINTS = 0x00000040, + RENDER_DEBUG_TEXTURE_PRIORITY = 0x00000080, + RENDER_DEBUG_TEXTURE_AREA = 0x00000100, + RENDER_DEBUG_FACE_AREA = 0x00000200, + RENDER_DEBUG_PARTICLES = 0x00000400, + RENDER_DEBUG_GLOW = 0x00000800, // not used + RENDER_DEBUG_TEXTURE_ANIM = 0x00001000, + RENDER_DEBUG_LIGHTS = 0x00002000, + RENDER_DEBUG_BATCH_SIZE = 0x00004000, + RENDER_DEBUG_ALPHA_BINS = 0x00008000, // not used + RENDER_DEBUG_RAYCAST = 0x00010000, + RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000, + RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000, + RENDER_DEBUG_SCULPTED = 0x00080000, + RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, + RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, + RENDER_DEBUG_BUILD_QUEUE = 0x00400000, + RENDER_DEBUG_AGENT_TARGET = 0x00800000, + RENDER_DEBUG_UPDATE_TYPE = 0x01000000, + RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, + RENDER_DEBUG_NORMALS = 0x04000000, + RENDER_DEBUG_LOD_INFO = 0x08000000, + RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000, + RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used + RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, + RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, + RENDER_DEBUG_IMPOSTORS = 0x100000000, RENDER_DEBUG_SH = 0x200000000, - }; + }; public: - - LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); - - void updateCamera(bool reset = false); - - LLVector3 mFlyCamPosition; - LLQuaternion mFlyCamRotation; - - bool mBackfaceCull; - S32 mMatrixOpCount; - S32 mTextureMatrixOps; - S32 mNumVisibleNodes; - - S32 mDebugTextureUploadCost; - S32 mDebugSculptUploadCost; - S32 mDebugMeshUploadCost; - - S32 mNumVisibleFaces; - - static S32 sCompiles; - - static bool sShowHUDAttachments; - static bool sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. - static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write - static bool sDelayVBUpdate; - static bool sAutoMaskAlphaDeferred; - static bool sAutoMaskAlphaNonDeferred; - static bool sDisableShaders; // if true, rendering will be done without shaders - static bool sRenderBump; - static bool sBakeSunlight; - static bool sNoAlpha; - static bool sUseTriStrips; - static bool sUseFarClip; - static bool sShadowRender; - static bool sWaterReflections; - static bool sDynamicLOD; - static bool sPickAvatar; - static bool sReflectionRender; - static bool sDistortionRender; - static bool sImpostorRender; - static bool sImpostorRenderAlphaDepthPass; - static bool sUnderWaterRender; - static bool sRenderGlow; - static bool sTextureBindTest; - static bool sRenderFrameTest; - static bool sRenderAttachedLights; - static bool sRenderAttachedParticles; - static bool sRenderDeferred; - static bool sMemAllocationThrottled; - static S32 sVisibleLightCount; - static F32 sMinRenderSize; - static bool sRenderingHUDs; + + LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); + + void updateCamera(bool reset = false); + + LLVector3 mFlyCamPosition; + LLQuaternion mFlyCamRotation; + + bool mBackfaceCull; + S32 mMatrixOpCount; + S32 mTextureMatrixOps; + S32 mNumVisibleNodes; + + S32 mDebugTextureUploadCost; + S32 mDebugSculptUploadCost; + S32 mDebugMeshUploadCost; + + S32 mNumVisibleFaces; + + static S32 sCompiles; + + static bool sShowHUDAttachments; + static bool sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. + static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write + static bool sDelayVBUpdate; + static bool sAutoMaskAlphaDeferred; + static bool sAutoMaskAlphaNonDeferred; + static bool sDisableShaders; // if true, rendering will be done without shaders + static bool sRenderBump; + static bool sBakeSunlight; + static bool sNoAlpha; + static bool sUseTriStrips; + static bool sUseFarClip; + static bool sShadowRender; + static bool sWaterReflections; + static bool sDynamicLOD; + static bool sPickAvatar; + static bool sReflectionRender; + static bool sDistortionRender; + static bool sImpostorRender; + static bool sImpostorRenderAlphaDepthPass; + static bool sUnderWaterRender; + static bool sRenderGlow; + static bool sTextureBindTest; + static bool sRenderFrameTest; + static bool sRenderAttachedLights; + static bool sRenderAttachedParticles; + static bool sRenderDeferred; + static bool sMemAllocationThrottled; + static S32 sVisibleLightCount; + static F32 sMinRenderSize; + static bool sRenderingHUDs; static F32 sDistortionWaterClipPlaneMargin; - static LLTrace::EventStatHandle sStatBatchSize; - - //screen texture - U32 mScreenWidth; - U32 mScreenHeight; - - LLRenderTarget mScreen; - LLRenderTarget mUIScreen; - LLRenderTarget mDeferredScreen; - LLRenderTarget mFXAABuffer; - LLRenderTarget mEdgeMap; - LLRenderTarget mDeferredDepth; - LLRenderTarget mOcclusionDepth; - LLRenderTarget mDeferredLight; - LLRenderTarget mHighlight; - LLRenderTarget mPhysicsDisplay; + static LLTrace::EventStatHandle sStatBatchSize; + + //screen texture + U32 mScreenWidth; + U32 mScreenHeight; + + LLRenderTarget mScreen; + LLRenderTarget mUIScreen; + LLRenderTarget mDeferredScreen; + LLRenderTarget mFXAABuffer; + LLRenderTarget mEdgeMap; + LLRenderTarget mDeferredDepth; + LLRenderTarget mOcclusionDepth; + LLRenderTarget mDeferredLight; + LLRenderTarget mHighlight; + LLRenderTarget mPhysicsDisplay; LLCullResult mSky; LLCullResult mReflectedObjects; LLCullResult mRefractedObjects; - //utility buffer for rendering post effects, gets abused by renderDeferredLighting - LLPointer mDeferredVB; - - //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] - LLPointer mCubeVB; - - //sun shadow map - LLRenderTarget mShadow[6]; - LLRenderTarget mShadowOcclusion[6]; - - std::vector mShadowFrustPoints[4]; - LLVector4 mShadowError; - LLVector4 mShadowFOV; - LLVector3 mShadowFrustOrigin[4]; - LLCamera mShadowCamera[8]; - LLVector3 mShadowExtents[4][2]; - glh::matrix4f mSunShadowMatrix[6]; - glh::matrix4f mShadowModelview[6]; - glh::matrix4f mShadowProjection[6]; + //utility buffer for rendering post effects, gets abused by renderDeferredLighting + LLPointer mDeferredVB; + + //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] + LLPointer mCubeVB; + + //sun shadow map + LLRenderTarget mShadow[6]; + LLRenderTarget mShadowOcclusion[6]; + + std::vector mShadowFrustPoints[4]; + LLVector4 mShadowError; + LLVector4 mShadowFOV; + LLVector3 mShadowFrustOrigin[4]; + LLCamera mShadowCamera[8]; + LLVector3 mShadowExtents[4][2]; + glh::matrix4f mSunShadowMatrix[6]; + glh::matrix4f mShadowModelview[6]; + glh::matrix4f mShadowProjection[6]; glh::matrix4f mReflectionModelView; - LLPointer mShadowSpotLight[2]; - F32 mSpotLightFade[2]; - LLPointer mTargetShadowSpotLight[2]; + LLPointer mShadowSpotLight[2]; + F32 mSpotLightFade[2]; + LLPointer mTargetShadowSpotLight[2]; - LLVector4 mSunClipPlanes; - LLVector4 mSunOrthoClipPlanes; - LLVector2 mScreenScale; + LLVector4 mSunClipPlanes; + LLVector4 mSunOrthoClipPlanes; + LLVector2 mScreenScale; - //water reflection texture - LLRenderTarget mWaterRef; + //water reflection texture + LLRenderTarget mWaterRef; - //water distortion texture (refraction) - LLRenderTarget mWaterDis; + //water distortion texture (refraction) + LLRenderTarget mWaterDis; - //texture for making the glow - LLRenderTarget mGlow[3]; + //texture for making the glow + LLRenderTarget mGlow[3]; - //noise map - U32 mNoiseMap; - U32 mTrueNoiseMap; - U32 mLightFunc; + //noise map + U32 mNoiseMap; + U32 mTrueNoiseMap; + U32 mLightFunc; - LLColor4 mSunDiffuse; - LLColor4 mMoonDiffuse; - LLVector4 mSunDir; - LLVector4 mMoonDir; + LLColor4 mSunDiffuse; + LLColor4 mMoonDiffuse; + LLVector4 mSunDir; + LLVector4 mMoonDir; bool mNeedsShadowTargetClear; - LLVector4 mTransformedSunDir; - LLVector4 mTransformedMoonDir; + LLVector4 mTransformedSunDir; + LLVector4 mTransformedMoonDir; - bool mInitialized; - bool mVertexShadersEnabled; - S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed + bool mInitialized; + bool mVertexShadersEnabled; + S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed - U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback + U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback protected: - bool mRenderTypeEnabled[NUM_RENDER_TYPES]; - std::stack mRenderTypeEnableStack; - - U32 mRenderDebugFeatureMask; - U64 mRenderDebugMask; - U64 mOldRenderDebugMask; - std::stack mRenderDebugFeatureStack; - - - ///////////////////////////////////////////// - // - // - LLDrawable::drawable_vector_t mMovedList; - LLDrawable::drawable_vector_t mMovedBridge; - LLDrawable::drawable_vector_t mShiftList; - - ///////////////////////////////////////////// - // - // - struct Light - { - Light(LLDrawable* ptr, F32 d, F32 f = 0.0f) - : drawable(ptr), - dist(d), - fade(f) - {} - LLPointer drawable; - F32 dist; - F32 fade; - struct compare - { - bool operator()(const Light& a, const Light& b) const - { - if ( a.dist < b.dist ) - return true; - else if ( a.dist > b.dist ) - return false; - else - return a.drawable < b.drawable; - } - }; - }; - typedef std::set< Light, Light::compare > light_set_t; - - LLDrawable::drawable_set_t mLights; - light_set_t mNearbyLights; // lights near camera - LLColor4 mHWLightColors[8]; - - ///////////////////////////////////////////// - // - // Different queues of drawables being processed. - // - LLDrawable::drawable_list_t mBuildQ1; // priority - LLDrawable::drawable_list_t mBuildQ2; // non-priority - LLSpatialGroup::sg_vector_t mGroupQ1; //priority - LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority - - LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref - - LLSpatialGroup::sg_vector_t mMeshDirtyGroup; //groups that need rebuildMesh called - U32 mMeshDirtyQueryObject; - - LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius - - bool mGroupQ2Locked; - bool mGroupQ1Locked; - - bool mResetVertexBuffers; //if true, clear vertex buffers on next update - - LLViewerObject::vobj_list_t mCreateQ; - - LLDrawable::drawable_set_t mRetexturedList; - - class HighlightItem - { - public: - const LLPointer 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 mHighlightSet; - LLPointer mHighlightObject; - - ////////////////////////////////////////////////// - // - // Draw pools are responsible for storing all rendered data, - // and performing the actual rendering of objects. - // - struct compare_pools - { - bool operator()(const LLDrawPool* a, const LLDrawPool* b) const - { - if (!a) - return true; - else if (!b) - return false; - else - { - S32 atype = a->getType(); - S32 btype = b->getType(); - if (atype < btype) - return true; - else if (atype > btype) - return false; - else - return a->getId() < b->getId(); - } - } - }; - typedef std::set pool_set_t; - pool_set_t mPools; - LLDrawPool* mLastRebuildPool; - - // For quick-lookups into mPools (mapped by texture pointer) - std::map mTerrainPools; - std::map mTreePools; - LLDrawPoolAlpha* mAlphaPool; - LLDrawPool* mSkyPool; - LLDrawPool* mTerrainPool; - LLDrawPool* mWaterPool; - LLDrawPool* mGroundPool; - LLRenderPass* mSimplePool; - LLRenderPass* mGrassPool; - LLRenderPass* mAlphaMaskPool; - LLRenderPass* mFullbrightAlphaMaskPool; - LLRenderPass* mFullbrightPool; - LLDrawPool* mInvisiblePool; - LLDrawPool* mGlowPool; - LLDrawPool* mBumpPool; - LLDrawPool* mMaterialsPool; - LLDrawPool* mWLSkyPool; - // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar - + bool mRenderTypeEnabled[NUM_RENDER_TYPES]; + std::stack mRenderTypeEnableStack; + + U32 mRenderDebugFeatureMask; + U64 mRenderDebugMask; + U64 mOldRenderDebugMask; + std::stack mRenderDebugFeatureStack; + + + ///////////////////////////////////////////// + // + // + LLDrawable::drawable_vector_t mMovedList; + LLDrawable::drawable_vector_t mMovedBridge; + LLDrawable::drawable_vector_t mShiftList; + + ///////////////////////////////////////////// + // + // + struct Light + { + Light(LLDrawable* ptr, F32 d, F32 f = 0.0f) + : drawable(ptr), + dist(d), + fade(f) + {} + LLPointer drawable; + F32 dist; + F32 fade; + struct compare + { + bool operator()(const Light& a, const Light& b) const + { + if ( a.dist < b.dist ) + return true; + else if ( a.dist > b.dist ) + return false; + else + return a.drawable < b.drawable; + } + }; + }; + typedef std::set< Light, Light::compare > light_set_t; + + LLDrawable::drawable_set_t mLights; + light_set_t mNearbyLights; // lights near camera + LLColor4 mHWLightColors[8]; + + ///////////////////////////////////////////// + // + // Different queues of drawables being processed. + // + LLDrawable::drawable_list_t mBuildQ1; // priority + LLDrawable::drawable_list_t mBuildQ2; // non-priority + LLSpatialGroup::sg_vector_t mGroupQ1; //priority + LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority + + LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref + + LLSpatialGroup::sg_vector_t mMeshDirtyGroup; //groups that need rebuildMesh called + U32 mMeshDirtyQueryObject; + + LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius + + bool mGroupQ2Locked; + bool mGroupQ1Locked; + + bool mResetVertexBuffers; //if true, clear vertex buffers on next update + + LLViewerObject::vobj_list_t mCreateQ; + + LLDrawable::drawable_set_t mRetexturedList; + + class HighlightItem + { + public: + const LLPointer 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 mHighlightSet; + LLPointer mHighlightObject; + + ////////////////////////////////////////////////// + // + // Draw pools are responsible for storing all rendered data, + // and performing the actual rendering of objects. + // + struct compare_pools + { + bool operator()(const LLDrawPool* a, const LLDrawPool* b) const + { + if (!a) + return true; + else if (!b) + return false; + else + { + S32 atype = a->getType(); + S32 btype = b->getType(); + if (atype < btype) + return true; + else if (atype > btype) + return false; + else + return a->getId() < b->getId(); + } + } + }; + typedef std::set pool_set_t; + pool_set_t mPools; + LLDrawPool* mLastRebuildPool; + + // For quick-lookups into mPools (mapped by texture pointer) + std::map mTerrainPools; + std::map mTreePools; + LLDrawPoolAlpha* mAlphaPool; + LLDrawPool* mSkyPool; + LLDrawPool* mTerrainPool; + LLDrawPool* mWaterPool; + LLDrawPool* mGroundPool; + LLRenderPass* mSimplePool; + LLRenderPass* mGrassPool; + LLRenderPass* mAlphaMaskPool; + LLRenderPass* mFullbrightAlphaMaskPool; + LLRenderPass* mFullbrightPool; + LLDrawPool* mInvisiblePool; + LLDrawPool* mGlowPool; + LLDrawPool* mBumpPool; + LLDrawPool* mMaterialsPool; + LLDrawPool* mWLSkyPool; + // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar + public: - std::vector mHighlightFaces; // highlight faces on physical objects + std::vector mHighlightFaces; // highlight faces on physical objects protected: - std::vector mSelectedFaces; - - class DebugBlip - { - public: - LLColor4 mColor; - LLVector3 mPosition; - F32 mAge; - - DebugBlip(const LLVector3& position, const LLColor4& color) - : mColor(color), mPosition(position), mAge(0.f) - { } - }; - - std::list mDebugBlips; - - LLPointer mFaceSelectImagep; - - U32 mLightMask; - U32 mLightMovingMask; - S32 mLightingDetail; - - static bool sRenderPhysicalBeacons; - static bool sRenderMOAPBeacons; - static bool sRenderScriptedTouchBeacons; - static bool sRenderScriptedBeacons; - static bool sRenderParticleBeacons; - static bool sRenderSoundBeacons; + std::vector mSelectedFaces; + + class DebugBlip + { + public: + LLColor4 mColor; + LLVector3 mPosition; + F32 mAge; + + DebugBlip(const LLVector3& position, const LLColor4& color) + : mColor(color), mPosition(position), mAge(0.f) + { } + }; + + std::list mDebugBlips; + + LLPointer mFaceSelectImagep; + + U32 mLightMask; + U32 mLightMovingMask; + S32 mLightingDetail; + + static bool sRenderPhysicalBeacons; + static bool sRenderMOAPBeacons; + static bool sRenderScriptedTouchBeacons; + static bool sRenderScriptedBeacons; + static bool sRenderParticleBeacons; + static bool sRenderSoundBeacons; public: - static bool sRenderBeacons; - static bool sRenderHighlight; - - // Determines which set of UVs to use in highlight display - // - static LLRender::eTexIndex sRenderHighlightTextureChannel; - - //debug use - static U32 sCurRenderPoolType ; - - //cached settings - static bool WindLightUseAtmosShaders; - static bool VertexShaderEnable; - static bool RenderAvatarVP; - static bool RenderDeferred; - static F32 RenderDeferredSunWash; - static U32 RenderFSAASamples; - static U32 RenderResolutionDivisor; - static bool RenderUIBuffer; - static S32 RenderShadowDetail; - static bool RenderDeferredSSAO; - static F32 RenderShadowResolutionScale; - static bool RenderLocalLights; - static bool RenderDelayCreation; - static bool RenderAnimateRes; - static bool FreezeTime; - static S32 DebugBeaconLineWidth; - static F32 RenderHighlightBrightness; - static LLColor4 RenderHighlightColor; - static F32 RenderHighlightThickness; - static bool RenderSpotLightsInNondeferred; - static LLColor4 PreviewAmbientColor; - static LLColor4 PreviewDiffuse0; - static LLColor4 PreviewSpecular0; - static LLColor4 PreviewDiffuse1; - static LLColor4 PreviewSpecular1; - static LLColor4 PreviewDiffuse2; - static LLColor4 PreviewSpecular2; - static LLVector3 PreviewDirection0; - static LLVector3 PreviewDirection1; - static LLVector3 PreviewDirection2; - static F32 RenderGlowMinLuminance; - static F32 RenderGlowMaxExtractAlpha; - static F32 RenderGlowWarmthAmount; - static LLVector3 RenderGlowLumWeights; - static LLVector3 RenderGlowWarmthWeights; - static S32 RenderGlowResolutionPow; - static S32 RenderGlowIterations; - static F32 RenderGlowWidth; - static F32 RenderGlowStrength; - static bool RenderDepthOfField; - static bool RenderDepthOfFieldInEditMode; - static F32 CameraFocusTransitionTime; - static F32 CameraFNumber; - static F32 CameraFocalLength; - static F32 CameraFieldOfView; - static F32 RenderShadowNoise; - static F32 RenderShadowBlurSize; - static F32 RenderSSAOScale; - static U32 RenderSSAOMaxScale; - static F32 RenderSSAOFactor; - static LLVector3 RenderSSAOEffect; - static F32 RenderShadowOffsetError; - static F32 RenderShadowBiasError; - static F32 RenderShadowOffset; - static F32 RenderShadowBias; - static F32 RenderSpotShadowOffset; - static F32 RenderSpotShadowBias; - static F32 RenderEdgeDepthCutoff; - static F32 RenderEdgeNormCutoff; - static LLVector3 RenderShadowGaussian; - static F32 RenderShadowBlurDistFactor; - static bool RenderDeferredAtmospheric; - static S32 RenderReflectionDetail; - static F32 RenderHighlightFadeTime; - static LLVector3 RenderShadowClipPlanes; - static LLVector3 RenderShadowOrthoClipPlanes; - static LLVector3 RenderShadowNearDist; - static F32 RenderFarClip; - static LLVector3 RenderShadowSplitExponent; - static F32 RenderShadowErrorCutoff; - static F32 RenderShadowFOVCutoff; - static bool CameraOffset; - static F32 CameraMaxCoF; - static F32 CameraDoFResScale; - static F32 RenderAutoHideSurfaceAreaLimit; + static bool sRenderBeacons; + static bool sRenderHighlight; + + // Determines which set of UVs to use in highlight display + // + static LLRender::eTexIndex sRenderHighlightTextureChannel; + + //debug use + static U32 sCurRenderPoolType ; + + //cached settings + static bool WindLightUseAtmosShaders; + static bool VertexShaderEnable; + static bool RenderAvatarVP; + static bool RenderDeferred; + static F32 RenderDeferredSunWash; + static U32 RenderFSAASamples; + static U32 RenderResolutionDivisor; + static bool RenderUIBuffer; + static S32 RenderShadowDetail; + static bool RenderDeferredSSAO; + static F32 RenderShadowResolutionScale; + static bool RenderLocalLights; + static bool RenderDelayCreation; + static bool RenderAnimateRes; + static bool FreezeTime; + static S32 DebugBeaconLineWidth; + static F32 RenderHighlightBrightness; + static LLColor4 RenderHighlightColor; + static F32 RenderHighlightThickness; + static bool RenderSpotLightsInNondeferred; + static LLColor4 PreviewAmbientColor; + static LLColor4 PreviewDiffuse0; + static LLColor4 PreviewSpecular0; + static LLColor4 PreviewDiffuse1; + static LLColor4 PreviewSpecular1; + static LLColor4 PreviewDiffuse2; + static LLColor4 PreviewSpecular2; + static LLVector3 PreviewDirection0; + static LLVector3 PreviewDirection1; + static LLVector3 PreviewDirection2; + static F32 RenderGlowMinLuminance; + static F32 RenderGlowMaxExtractAlpha; + static F32 RenderGlowWarmthAmount; + static LLVector3 RenderGlowLumWeights; + static LLVector3 RenderGlowWarmthWeights; + static S32 RenderGlowResolutionPow; + static S32 RenderGlowIterations; + static F32 RenderGlowWidth; + static F32 RenderGlowStrength; + static bool RenderDepthOfField; + static bool RenderDepthOfFieldInEditMode; + static F32 CameraFocusTransitionTime; + static F32 CameraFNumber; + static F32 CameraFocalLength; + static F32 CameraFieldOfView; + static F32 RenderShadowNoise; + static F32 RenderShadowBlurSize; + static F32 RenderSSAOScale; + static U32 RenderSSAOMaxScale; + static F32 RenderSSAOFactor; + static LLVector3 RenderSSAOEffect; + static F32 RenderShadowOffsetError; + static F32 RenderShadowBiasError; + static F32 RenderShadowOffset; + static F32 RenderShadowBias; + static F32 RenderSpotShadowOffset; + static F32 RenderSpotShadowBias; + static F32 RenderEdgeDepthCutoff; + static F32 RenderEdgeNormCutoff; + static LLVector3 RenderShadowGaussian; + static F32 RenderShadowBlurDistFactor; + static bool RenderDeferredAtmospheric; + static S32 RenderReflectionDetail; + static F32 RenderHighlightFadeTime; + static LLVector3 RenderShadowClipPlanes; + static LLVector3 RenderShadowOrthoClipPlanes; + static LLVector3 RenderShadowNearDist; + static F32 RenderFarClip; + static LLVector3 RenderShadowSplitExponent; + static F32 RenderShadowErrorCutoff; + static F32 RenderShadowFOVCutoff; + static bool CameraOffset; + static F32 CameraMaxCoF; + static F32 CameraDoFResScale; + static F32 RenderAutoHideSurfaceAreaLimit; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); -- cgit v1.2.3 From 898c9f44218353b3bf71b78ffce02662b4927625 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Mar 2019 13:21:48 -0700 Subject: Mods to make merge with viewer-release have less whitespace-only change and fix diffs between EEP and VR. --- indra/newview/pipeline.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index a31f880fbf..b4a8ca004e 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -166,9 +166,6 @@ public: // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - // Downsample depth buffer with gather and find local min/max depth values. Writes to a 16F RG render target. - void downsampleMinMaxDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); - void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); void doOcclusion(LLCamera& camera); void markNotCulled(LLSpatialGroup* group, LLCamera &camera); @@ -539,8 +536,7 @@ public: RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, - RENDER_DEBUG_IMPOSTORS = 0x100000000, - RENDER_DEBUG_SH = 0x200000000, + RENDER_DEBUG_IMPOSTORS = 0x100000000 }; public: @@ -628,13 +624,12 @@ public: //sun shadow map LLRenderTarget mShadow[6]; LLRenderTarget mShadowOcclusion[6]; - - std::vector mShadowFrustPoints[4]; - LLVector4 mShadowError; - LLVector4 mShadowFOV; - LLVector3 mShadowFrustOrigin[4]; - LLCamera mShadowCamera[8]; - LLVector3 mShadowExtents[4][2]; + std::vector mShadowFrustPoints[4]; + LLVector4 mShadowError; + LLVector4 mShadowFOV; + LLVector3 mShadowFrustOrigin[4]; + LLCamera mShadowCamera[8]; + LLVector3 mShadowExtents[4][2]; glh::matrix4f mSunShadowMatrix[6]; glh::matrix4f mShadowModelview[6]; glh::matrix4f mShadowProjection[6]; -- cgit v1.2.3 From 58f7b981bdb415311f23dfffc39e7a841b3017a0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 31 May 2019 13:47:44 -0700 Subject: SL-11337 Fix handling of ambient (was getting reset to 1,1,1,1 unintentionally). Modify shaders to balance ambient across render modes again. --- indra/newview/pipeline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b4a8ca004e..10412da6c7 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -315,7 +315,7 @@ public: void enableLightsAvatar(); void enableLightsPreview(); void enableLightsAvatarEdit(const LLColor4& color); - void enableLightsFullbright(const LLColor4& color); + void enableLightsFullbright(); void disableLights(); void shiftObjects(const LLVector3 &offset); -- cgit v1.2.3 From a6443ce4928f2ce90630717994943252a585f764 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 4 Jun 2019 14:47:07 -0700 Subject: SL-11353 Make culling ignore the geo from the spotlight rendering a shadowmap. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 10412da6c7..fe81ae91e8 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -925,6 +925,7 @@ public: static F32 RenderShadowBias; static F32 RenderSpotShadowOffset; static F32 RenderSpotShadowBias; + static LLDrawable* RenderSpotLight; static F32 RenderEdgeDepthCutoff; static F32 RenderEdgeNormCutoff; static LLVector3 RenderShadowGaussian; -- cgit v1.2.3 From 11331604767b2dcf50c7a84f24843ce8e531a409 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 12 Jul 2019 13:26:02 -0700 Subject: SL-11109 Make shadowAlphaMask shader ignore vertex alpha before discards iff we're a fullbright object. Keep llappearance from stuffing dangling pointers into the alpha cache (crash iff you're using nSight debugging and disable readbacks). --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index fe81ae91e8..b0c40d145b 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -261,6 +261,7 @@ public: void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); + void renderFullbrightMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false); void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture); -- cgit v1.2.3 From dc7aa170b80bb7d3f7725b5bddce08ff2da5a7a7 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2019 14:12:37 -0700 Subject: SL-11610 Give bake its own RT to avoid issues with sharing the water distortion map. Use glFinish to insure RTs will be complete. --- indra/newview/pipeline.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b0c40d145b..cc9ec06f80 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -650,6 +650,8 @@ public: //water distortion texture (refraction) LLRenderTarget mWaterDis; + LLRenderTarget mBake; + //texture for making the glow LLRenderTarget mGlow[3]; -- cgit v1.2.3 From 1529c16201d332ce7bbff5c3637737ca58277eb9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 24 Jul 2019 10:53:04 -0700 Subject: SL-11610 Revert attempted fix for 10625. --- indra/newview/pipeline.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index cc9ec06f80..b0c40d145b 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -650,8 +650,6 @@ public: //water distortion texture (refraction) LLRenderTarget mWaterDis; - LLRenderTarget mBake; - //texture for making the glow LLRenderTarget mGlow[3]; -- cgit v1.2.3 From 41ede77744489c2a2d32849ea457bcbea516a588 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 24 Jul 2019 12:52:24 -0700 Subject: SL-10625 --- indra/newview/pipeline.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b0c40d145b..cc9ec06f80 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -650,6 +650,8 @@ public: //water distortion texture (refraction) LLRenderTarget mWaterDis; + LLRenderTarget mBake; + //texture for making the glow LLRenderTarget mGlow[3]; -- cgit v1.2.3 From 01e6839f21becca6ade3fe723cebc26a7f10de8e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 22 Aug 2019 10:11:59 -0700 Subject: SL-11779 Make changing shadow res scale not instantly drop/realloc buffers but wait until display gets to it. --- indra/newview/pipeline.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index cc9ec06f80..44aa9d85fa 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -100,6 +100,7 @@ public: void restoreGL(); void resetVertexBuffers(); void doResetVertexBuffers(bool forced = false); + void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks... void resizeScreenTexture(); void releaseGLBuffers(); void releaseLUTBuffers(); -- cgit v1.2.3 From d195a3b08d664a98c17a81ec43aa84707631a234 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 23 Aug 2019 18:36:56 -0700 Subject: SL-11778 Make RenderShadowResolutionScale work again, also decoupling shadow buffer alloc/release/resize from screen buffer resize function. --- indra/newview/pipeline.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 44aa9d85fa..e75a09d753 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -101,10 +101,16 @@ public: void resetVertexBuffers(); void doResetVertexBuffers(bool forced = false); void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks... + void requestResizeShadowTexture(); // set flag only, no work, safer for callbacks... + void resizeScreenTexture(); + void resizeShadowTexture(); + void releaseGLBuffers(); void releaseLUTBuffers(); void releaseScreenBuffers(); + void releaseShadowBuffers(); + void createGLBuffers(); void createLUTBuffers(); @@ -126,6 +132,7 @@ public: //attempt to allocate screen buffers at resX, resY //returns true if allocation successful, false otherwise bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); + bool allocateShadowBuffer(U32 resX, U32 resY); void allocatePhysicsBuffer(); -- cgit v1.2.3 From 49a2b3b5d76f646ab1a2681ed7fe626128aaf101 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Wed, 29 Jan 2020 14:46:47 -0700 Subject: SL-12594, remove conditional checks for VertexShaderEnable settings --- indra/newview/pipeline.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/pipeline.h') diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index e75a09d753..68ce3fe88d 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -880,7 +880,6 @@ public: //cached settings static bool WindLightUseAtmosShaders; - static bool VertexShaderEnable; static bool RenderAvatarVP; static bool RenderDeferred; static F32 RenderDeferredSunWash; -- cgit v1.2.3