From ced2bd5ed4386d50231edfd1ebec01561f9b4465 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 12 Apr 2021 16:58:18 -0700 Subject: SL-14113 Fix moon haze --- indra/newview/lldrawpoolsky.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index b6f55e800a..96b4a91b0f 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -130,13 +130,32 @@ void LLDrawPoolSky::renderSkyFace(U8 index) face->renderIndexed(); } + else // Moon + if (index == LLVOSky::FACE_MOON) + { + LLGLSPipelineDepthTestSkyBox gls_skybox(true, true); // SL-14113 Write depth for moon so stars can test if behind it + + LLGLEnable blend(GL_BLEND); + + // if (LLGLSLShader::sNoFixedFunction) // TODO: Necessary? is this always true? We already bailed on gPipeline.canUseWindLightShaders ... above + LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); + if (tex) + { + gMoonProgram.bind(); // SL-14113 was gOneTextureNoColorProgram + gGL.getTexUnit(0)->bind(tex, true); + face->renderIndexed(); + } + } else // heavenly body faces, no interp... { + LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); // reset to previous + LLGLEnable blend(GL_BLEND); LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); if (tex) { + gOneTextureNoColorProgram.bind(); gGL.getTexUnit(0)->bind(tex, true); face->renderIndexed(); } -- cgit v1.2.3 From 1ef70ff1d3379fd2362f453dedff78c8aeda24ea Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 13 Apr 2021 11:35:36 -0700 Subject: SL-14113 Cleanup face magic number --- indra/newview/lldrawpoolsky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 96b4a91b0f..77b8a1fc32 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -123,7 +123,7 @@ void LLDrawPoolSky::renderSkyFace(U8 index) return; } - if (index < 6) // sky tex...interp + if (index < LLVOSky::FACE_SUN) // sky tex...interp { llassert(mSkyTex); mSkyTex[index].bindTexture(true); // bind the current tex -- cgit v1.2.3 From eb1e2a231410f8d2fefa4b4903b46b24f4259b04 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 13 Apr 2021 11:36:33 -0700 Subject: SL-14113 Cleanup indentation --- indra/newview/lldrawpoolsky.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 77b8a1fc32..178564b0d4 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -116,17 +116,17 @@ void LLDrawPoolSky::render(S32 pass) void LLDrawPoolSky::renderSkyFace(U8 index) { - LLFace* face = mDrawFace[index]; + LLFace* face = mDrawFace[index]; - if (!face || !face->getGeomCount()) - { - return; - } + if (!face || !face->getGeomCount()) + { + return; + } if (index < LLVOSky::FACE_SUN) // sky tex...interp { llassert(mSkyTex); - mSkyTex[index].bindTexture(true); // bind the current tex + mSkyTex[index].bindTexture(true); // bind the current tex face->renderIndexed(); } -- cgit v1.2.3 From 20dc30450cb50d08e6c7d23613a6a59aae1a6a16 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 Aug 2022 19:45:23 +0300 Subject: SL-17999 PBR material in tool's texture tab --- indra/newview/lldrawpoolsky.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 3a1efec91b..55ebf03adc 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -51,7 +51,10 @@ LLDrawPoolSky::LLDrawPoolSky() void LLDrawPoolSky::prerender() { mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); - gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); + if (gSky.mVOSkyp->mDrawable) + { + gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); + } } void LLDrawPoolSky::render(S32 pass) -- cgit v1.2.3 From 9f7967fcdc5ccb60bd72e8e9e1b7652dc2058524 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 29 Nov 2022 23:35:18 +0200 Subject: SL-18727 Save material to Inventoryshould prioritize picked face --- indra/newview/lldrawpoolsky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 55ebf03adc..5b614a2ce0 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -51,7 +51,7 @@ LLDrawPoolSky::LLDrawPoolSky() void LLDrawPoolSky::prerender() { mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); - if (gSky.mVOSkyp->mDrawable) + if (gSky.mVOSkyp && gSky.mVOSkyp->mDrawable) { gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); } -- cgit v1.2.3 From 6f136d403b6bbccae80661c6585f29e1caed3a7c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 1 Feb 2023 17:09:34 -0600 Subject: SL-19000 Fix various 3D UI components not respecting depth buffer. Incidental decruft. Do I get a prize for 1000th jira? --- indra/newview/lldrawpoolsky.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index a7b5ec5fc8..c39d728c95 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -84,8 +84,6 @@ void LLDrawPoolSky::render(S32 pass) LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); - LLGLEnable fog_enable( (mShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); - gGL.pushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); -- cgit v1.2.3 From 1c2410b8af62254e96d60b2ae2e411d4756215e4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 3 Feb 2023 19:45:31 -0600 Subject: SL-19148 Decruft followthrough -- decruft shader tree and some remaining forward rendering code. --- indra/newview/lldrawpoolsky.cpp | 100 +--------------------------------------- 1 file changed, 1 insertion(+), 99 deletions(-) (limited to 'indra/newview/lldrawpoolsky.cpp') diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index c39d728c95..3c5bfe4a1c 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -28,21 +28,10 @@ #include "lldrawpoolsky.h" -#include "llagent.h" -#include "lldrawable.h" -#include "llface.h" -#include "llsky.h" -#include "llviewercamera.h" -#include "llviewertexturelist.h" -#include "llviewerregion.h" -#include "llvosky.h" -#include "llworld.h" // To get water height -#include "pipeline.h" -#include "llviewershadermgr.h" +// DEPRECATED LLDrawPoolSky::LLDrawPoolSky() : LLFacePool(POOL_SKY), - mSkyTex(NULL), mShader(NULL) { @@ -50,103 +39,16 @@ LLDrawPoolSky::LLDrawPoolSky() void LLDrawPoolSky::prerender() { - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); - if (gSky.mVOSkyp && gSky.mVOSkyp->mDrawable) - { - gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); - } } void LLDrawPoolSky::render(S32 pass) { - gGL.flush(); - if (mDrawFace.empty()) - { - return; - } - - // Don't draw the sky box if we can and are rendering the WL sky dome. - if (gPipeline.canUseWindLightShaders()) - { - return; - } - - // don't render sky under water (background just gets cleared to fog color) - if(mShaderLevel > 0 && LLPipeline::sUnderWaterRender) - { - return; - } - - - //just use the UI shader (generic single texture no lighting) - gOneTextureNoColorProgram.bind(); - - LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); - - gGL.pushMatrix(); - LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); - gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]); - - S32 face_count = (S32)mDrawFace.size(); - - LLVertexBuffer::unbind(); - gGL.diffuseColor4f(1,1,1,1); - - for (S32 i = 0; i < face_count; ++i) - { - renderSkyFace(i); - } - - gGL.popMatrix(); } void LLDrawPoolSky::renderSkyFace(U8 index) { - LLFace* face = mDrawFace[index]; - - if (!face || !face->getGeomCount()) - { - return; - } - - if (index < LLVOSky::FACE_SUN) // sky tex...interp - { - llassert(mSkyTex); - mSkyTex[index].bindTexture(true); // bind the current tex - - face->renderIndexed(); - } - else // Moon - if (index == LLVOSky::FACE_MOON) - { - LLGLSPipelineDepthTestSkyBox gls_skybox(true, true); // SL-14113 Write depth for moon so stars can test if behind it - - LLGLEnable blend(GL_BLEND); - - // if (LLGLSLShader::sNoFixedFunction) // TODO: Necessary? is this always true? We already bailed on gPipeline.canUseWindLightShaders ... above - LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); - if (tex) - { - gMoonProgram.bind(); // SL-14113 was gOneTextureNoColorProgram - gGL.getTexUnit(0)->bind(tex, true); - face->renderIndexed(); - } - } - else // heavenly body faces, no interp... - { - LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); // reset to previous - - LLGLEnable blend(GL_BLEND); - LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); - if (tex) - { - gOneTextureNoColorProgram.bind(); - gGL.getTexUnit(0)->bind(tex, true); - face->renderIndexed(); - } - } } void LLDrawPoolSky::endRenderPass( S32 pass ) -- cgit v1.2.3