From 946da4e507dd00e6e7a9e465d38494bcafe4f652 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2019 15:04:48 -0700 Subject: SL-10761 Add work-around for broken intel drivers which can't use glReadPixels from RGBA FBOs to get alpha without locking up. --- indra/newview/lldynamictexture.cpp | 3 ++- indra/newview/lldynamictexture.h | 5 +++++ indra/newview/llviewertexlayer.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 5e283f7cd0..e1f41a9bd7 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -240,6 +240,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() gDepthDirty = TRUE; gGL.color4f(1,1,1,1); + dynamicTexture->setBoundTarget(use_fbo ? &gPipeline.mWaterDis : nullptr); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; if (dynamicTexture->render()) @@ -250,7 +251,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() } //gGL.flush(); LLVertexBuffer::unbind(); - + dynamicTexture->setBoundTarget(nullptr); dynamicTexture->postRender(result); } } diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index f3f57c9a6b..4bd74a8425 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -88,6 +88,9 @@ public: static BOOL updateAllInstances(); static void destroyGL() ; static void restoreGL() ; + + void setBoundTarget(LLRenderTarget* target) { mBoundTarget = target; } + protected: void generateGLTexture(); void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE); @@ -97,6 +100,8 @@ protected: LLCoordGL mOrigin; LL_ALIGN_16(LLCamera mCamera); + LLRenderTarget* mBoundTarget; + typedef std::set instance_list_t; static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ]; static S32 sNumRenders; diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index 027ae255ec..dec7f0ddfc 100644 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -111,7 +111,7 @@ protected: // Pass these along for tex layer rendering. virtual void preRender(BOOL clear_depth) { preRenderTexLayerSet(); } virtual void postRender(BOOL success) { postRenderTexLayerSet(success); } - virtual BOOL render() { return renderTexLayerSet(); } + virtual BOOL render() { return renderTexLayerSet(mBoundTarget); } //-------------------------------------------------------------------- // Updates -- cgit v1.2.3 From 2fa2da33022e0d64d02e0690f0345c5cc9dfca04 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2019 15:59:45 -0700 Subject: SL-11590 Modified windlight shader to remove adjustment to glow.z --- .../app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 3fe3b7afd3..0607ea8bc5 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -115,7 +115,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) temp2.x *= glow.x; //higher glow.x gives dimmer glow (because next step is 1 / "angle") - temp2.x = pow(temp2.x, glow.z * 0.2); + temp2.x = pow(temp2.x, glow.z); //glow.z should be negative, so we're doing a sort of (1 / "angle") function //add "minimum anti-solar illumination" -- cgit v1.2.3