From e045d212d35354d679c2d2e05c6d4689f9f8ac95 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 27 Sep 2010 22:56:08 -0400 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: first pass at merging in windlight estate settings to viewer-dev codebase. not built, not tested. Probably needs a bunch of fixes to be able to be integrated. (resubmitted by Vadim ProductEngine) --- indra/newview/lldrawpoolwlsky.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/lldrawpoolwlsky.cpp') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 41a299151e..0910d920f2 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -34,6 +34,8 @@ #include "llviewercamera.h" #include "llimage.h" #include "llwlparammanager.h" +#include "llviewershadermgr.h" +#include "llglslshader.h" #include "llsky.h" #include "llvowlsky.h" #include "llviewerregion.h" @@ -66,7 +68,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) : sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE); - LLWLParamManager::instance()->propagateParameters(); + LLWLParamManager::getInstance()->propagateParameters(); } LLDrawPoolWLSky::~LLDrawPoolWLSky() @@ -161,7 +163,7 @@ void LLDrawPoolWLSky::renderStars(void) const // clamping and allow the star_alpha param to brighten the stars. bool error; LLColor4 star_alpha(LLColor4::black); - star_alpha.mV[3] = LLWLParamManager::instance()->mCurParams.getFloat("star_brightness", error) / 2.f; + star_alpha.mV[3] = LLWLParamManager::getInstance()->mCurParams.getFloat("star_brightness", error) / 2.f; llassert_always(!error); gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex()); @@ -254,7 +256,7 @@ void LLDrawPoolWLSky::render(S32 pass) } LLFastTimer ftm(FTM_RENDER_WL_SKY); - const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius(); + const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius(); LLGLSNoFog disableFog; LLGLDepthTest depth(GL_TRUE, GL_FALSE); -- cgit v1.2.3 From 51bb3c15c8ac6c85ed1a7e8526ba6b60794ac29e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 19 May 2011 20:38:39 -0500 Subject: SH-469 WIP -- get rid of LLMultiSampleBuffer and use GL_ARB_texture_multisample instead. --- indra/newview/lldrawpoolwlsky.cpp | 88 ++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 16 deletions(-) (limited to 'indra/newview/lldrawpoolwlsky.cpp') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 696c2d1abd..66b834ab11 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -44,6 +44,8 @@ LLPointer LLDrawPoolWLSky::sCloudNoiseTexture = NULL; LLPointer LLDrawPoolWLSky::sCloudNoiseRawImage = NULL; +static LLGLSLShader* cloud_shader = NULL; +static LLGLSLShader* sky_shader = NULL; LLDrawPoolWLSky::LLDrawPoolWLSky(void) : @@ -83,12 +85,32 @@ LLViewerTexture *LLDrawPoolWLSky::getDebugTexture() void LLDrawPoolWLSky::beginRenderPass( S32 pass ) { + sky_shader = + LLPipeline::sUnderWaterRender ? + &gObjectSimpleWaterProgram : + &gWLSkyProgram; + + cloud_shader = + LLPipeline::sUnderWaterRender ? + &gObjectSimpleWaterProgram : + &gWLCloudProgram; } void LLDrawPoolWLSky::endRenderPass( S32 pass ) { } +void LLDrawPoolWLSky::beginDeferredPass(S32 pass) +{ + sky_shader = &gDeferredWLSkyProgram; + cloud_shader = &gDeferredWLCloudProgram; +} + +void LLDrawPoolWLSky::endDeferredPass(S32 pass) +{ + +} + void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) const { LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); @@ -128,19 +150,14 @@ void LLDrawPoolWLSky::renderSkyHaze(F32 camHeightLocal) const { if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY)) { - LLGLSLShader* shader = - LLPipeline::sUnderWaterRender ? - &gObjectSimpleWaterProgram : - &gWLSkyProgram; - LLGLDisable blend(GL_BLEND); - shader->bind(); + sky_shader->bind(); /// Render the skydome - renderDome(camHeightLocal, shader); + renderDome(camHeightLocal, sky_shader); - shader->unbind(); + sky_shader->unbind(); } } @@ -186,23 +203,18 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const { if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)) { - LLGLSLShader* shader = - LLPipeline::sUnderWaterRender ? - &gObjectSimpleWaterProgram : - &gWLCloudProgram; - LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.getTexUnit(0)->bind(sCloudNoiseTexture); - shader->bind(); + cloud_shader->bind(); /// Render the skydome - renderDome(camHeightLocal, shader); + renderDome(camHeightLocal, cloud_shader); - shader->unbind(); + cloud_shader->unbind(); } } @@ -246,6 +258,50 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() } } +void LLDrawPoolWLSky::renderDeferred(S32 pass) +{ + if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY)) + { + return; + } + LLFastTimer ftm(FTM_RENDER_WL_SKY); + + const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius(); + + LLGLSNoFog disableFog; + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + LLGLDisable clip(GL_CLIP_PLANE0); + + gGL.setColorMask(true, false); + + LLGLSquashToFarClip far_clip(glh_get_current_projection()); + + renderSkyHaze(camHeightLocal); + + /*LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); + glPushMatrix(); + + glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + + // *NOTE: have to bind a texture here since register combiners blending in + // renderStars() requires something to be bound and we might as well only + // bind the moon's texture once. + gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture()); + + renderHeavenlyBodies(); + + renderStars(); + + + glPopMatrix();*/ + + renderSkyClouds(camHeightLocal); + + gGL.setColorMask(true, true); + //gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + +} + void LLDrawPoolWLSky::render(S32 pass) { if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY)) -- cgit v1.2.3 From 4353eeb9288c95b98935e60928ec0b80de4e6145 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 24 May 2011 15:29:33 -0500 Subject: SH-469 GL_ARB_texture_multisample support --- indra/newview/lldrawpoolwlsky.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/lldrawpoolwlsky.cpp') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 66b834ab11..409b18d522 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -278,11 +278,13 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) renderSkyHaze(camHeightLocal); - /*LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); + LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); glPushMatrix(); + glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); + gDeferredStarProgram.bind(); // *NOTE: have to bind a texture here since register combiners blending in // renderStars() requires something to be bound and we might as well only // bind the moon's texture once. @@ -292,8 +294,9 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) renderStars(); + gDeferredStarProgram.unbind(); - glPopMatrix();*/ + glPopMatrix(); renderSkyClouds(camHeightLocal); -- cgit v1.2.3 From d8a5736b82104f82085169c96ea289fd875b8bdf Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Jun 2011 13:12:36 -0400 Subject: correct linux compilation problem in lldrawpoolwlsky --- indra/newview/lldrawpoolwlsky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolwlsky.cpp') diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 5c20363b96..bf79c2100c 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -268,7 +268,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) } LLFastTimer ftm(FTM_RENDER_WL_SKY); - const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius(); + const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius(); LLGLSNoFog disableFog; LLGLDepthTest depth(GL_TRUE, GL_FALSE); -- cgit v1.2.3