diff options
Diffstat (limited to 'indra/newview')
22 files changed, 1224 insertions, 1196 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 297ef0e011..dbd2ddcc3b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11565,6 +11565,17 @@ <key>Value</key> <integer>75</integer> </map> + <key>SnapshotTimestamp</key> + <map> + <key>Comment</key> + <string>Add timestamp to snapshot file names</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>AbuseReportScreenshotDelay</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index 8ee53e3ae4..c05b4eed7a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -79,7 +79,6 @@ void main() vec4 diff = texture(diffuseRect, vary_fragcoord.xy); #ifdef HAS_NOISE - vec2 tc = vary_fragcoord.xy*screen_res*4.0; vec3 seed = (diff.rgb+vec3(1.0))*vec3(tc.xy, tc.x+tc.y); vec3 nz = vec3(noise(seed.rg), noise(seed.gb), noise(seed.rb)); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dfffdbf482..48e2631d8b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1304,7 +1304,7 @@ void LLAppViewer::initMaxHeapSize() F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ; #else */ -F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); + F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); /* #endif */ diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 1618d91b98..ac052d35e4 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -403,7 +403,7 @@ void LLFastTimerView::draw() legend_panel->localRectToOtherView(legend_panel->getLocalRect(), &mLegendRect, this); // Draw the window background - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(getLocalRect(), LLColor4(0.f, 0.f, 0.f, 0.25f)); drawHelp(getRect().getHeight() - MARGIN); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d0d5305b0c..5b94051e33 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2649,7 +2649,6 @@ void LLPanelPreferenceGraphics3::onMPRecommanded() gSavedSettings.setBOOL("RenderAnisotropic", false); - // Shadows gSavedSettings.setS32("RenderShadowDetail", 0); diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index daa3d62efe..0b792efa1f 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -527,9 +527,9 @@ bool LLGLTFPreviewTexture::render() if (hdr) { - gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); - gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); - gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); + gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); + gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); + gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); } U16 activeRT = 0; diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 4d27e3d92e..01d4ccecdd 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3717,10 +3717,14 @@ bool LLModelPreview::render() buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif buffer->unmapBuffer(); } @@ -3732,7 +3736,9 @@ bool LLModelPreview::render() // only do this if mDegenerate was set in the preceding mesh checks [Check this if the ordering ever breaks] if (mHasDegenerate) { +#if GL_VERSION_1_1 glPointSize(PREVIEW_DEG_POINT_SIZE); +#endif gPipeline.enableLightsFullbright(); //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); @@ -3802,7 +3808,9 @@ bool LLModelPreview::render() gGL.popMatrix(); } //glLineWidth(1.f); +#if GL_VERSION_1_1 glPointSize(1.f); +#endif gPipeline.enableLightsPreview(); gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -3924,9 +3932,13 @@ bool LLModelPreview::render() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); //glLineWidth(PREVIEW_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } } } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 68a849714c..2ddb749141 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -445,18 +445,15 @@ void LLReflectionMapManager::update() d.setSub(camera_pos, probe->mOrigin); probe->mDistance = d.getLength3().getF32() - probe->mRadius; } + else if (mDefaultProbe->mComplete) + { + // make default probe have a distance of 64m for the purposes of prioritization (if it's already been generated once) + probe->mDistance = 64.f; + } else { - if (mDefaultProbe->mComplete) - { - // make default probe have a distance of 64m for the purposes of prioritization (if it's already been generated once) - probe->mDistance = 64.f; - } - else - { - probe->mNextUpdateTime = 0.f; - probe->mDistance = -4096.f; //boost priority of default probe when it's not complete - } + probe->mNextUpdateTime = 0.f; + probe->mDistance = -4096.f; //boost priority of default probe when it's not complete } if (probe->mComplete) @@ -487,7 +484,7 @@ void LLReflectionMapManager::update() (oldestProbe == nullptr || check_priority(probe, oldestProbe))) { - oldestProbe = probe; + oldestProbe = probe; } } @@ -541,7 +538,7 @@ void LLReflectionMapManager::update() } else if (sLevel > 0) { // when probes are enabled don't update the default probe less often than the prescribed update period - oldestProbe = mDefaultProbe; + oldestProbe = mDefaultProbe; } // switch to updating the next oldest probe @@ -559,10 +556,10 @@ void LLReflectionMapManager::update() if(shouldUpdate) { - probe->autoAdjustOrigin(); + probe->autoAdjustOrigin(); - sUpdateCount++; - mUpdatingProbe = probe; + sUpdateCount++; + mUpdatingProbe = probe; if(probe->mCompletedCount < 2) { @@ -573,7 +570,7 @@ void LLReflectionMapManager::update() probe->mNextUpdateTime = gFrameTimeSeconds + fmax( (F32)sMPUpdatePeriod, 0.25); } - doProbeUpdate(); + doProbeUpdate(); } } @@ -813,11 +810,8 @@ void LLReflectionMapManager::doProbeUpdate() { mUpdatingProbe->mViewerObject->setDebugText(llformat("%.1f", (F32)gFrameTimeSeconds), LLColor4(1, 1, 1, 1)); } - updateNeighbors(mUpdatingProbe); - mUpdatingFace = 0; - if (isRadiancePass()) { mUpdatingProbe->mComplete = true; @@ -836,7 +830,7 @@ void LLReflectionMapManager::doProbeUpdate() if (debug_updates) { - mUpdatingProbe->mViewerObject->setDebugText(llformat("%.1f", (F32)gFrameTimeSeconds), LLColor4(1, 1, 0, 1)); + mUpdatingProbe->mViewerObject->setDebugText(llformat("%.1f", (F32)gFrameTimeSeconds), LLColor4(1, 1, 0, 1)); } } } @@ -896,7 +890,6 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, b LLGLDisable blend(GL_BLEND); // downsample to placeholder map - { gGL.matrixMode(gGL.MM_MODELVIEW); gGL.pushMatrix(); @@ -941,10 +934,10 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, b screen_rt->flush(); } + S32 mips = (S32)(log2((F32)mProbeResolution) + 0.5f); gReflectionMipProgram.bind(); - S32 diffuseChannel = gReflectionMipProgram.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, LLTexUnit::TT_TEXTURE); for (int i = 0; i < mMipChain.size(); ++i) @@ -963,6 +956,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, b gGL.getTexUnit(diffuseChannel)->bind(&(mMipChain[i - 1])); } + gReflectionMipProgram.uniform1f(resScale, 1.f/(mProbeResolution*2)); gPipeline.mScreenTriangleVB->setBuffer(); @@ -1002,8 +996,8 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, b if(isRadiancePass()) updateProbeRadianceOnFace(probe, face, sourceIdx); } - // if(isRadiancePass()) updateProbeRadianceOnFace(probe, face, sourceIdx); - //else updateProbeIrradianceOnFace(probe, face, sourceIdx); + // if(isRadiancePass()) updateProbeRadianceOnFace(probe, face, sourceIdx); + // else updateProbeIrradianceOnFace(probe, face, sourceIdx); } // ===================== IRRADIANCE ================================ @@ -1036,8 +1030,10 @@ void LLReflectionMapManager::updateProbeIrradiance(LLReflectionMap* probe) gIrradianceGenProgram.bind(); +#if GL_VERSION_4_0 S32 channel = gIrradianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); mTexture->bind(channel); +#endif gIrradianceGenProgram.uniform1i(sSourceIdx, sourceIdx); gIrradianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); @@ -1072,10 +1068,11 @@ void LLReflectionMapManager::updateProbeIrradiance(LLReflectionMap* probe) mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); S32 res = mMipChain[i].getWidth(); - +#if GL_VERSION_4_0 mIrradianceMaps->bind(channel); glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i - start_mip, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); mTexture->bind(channel); +#endif //mMipChain[0].clear(0); } @@ -1114,46 +1111,48 @@ void LLReflectionMapManager::updateProbeRadiance(LLReflectionMap* probe) gRadianceGenProgram.bind(); mVertexBuffer->setBuffer(); - S32 channel = gRadianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); - mTexture->bind(channel); - - gRadianceGenProgram.uniform1i(sSourceIdx, sourceIdx); - gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); - gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_STRENGTH, 1.f); - gRadianceGenProgram.uniform1i(sWidth, mProbeResolution); +#if GL_VERSION_4_0 + S32 channel = gRadianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); + mTexture->bind(channel); +#endif + gRadianceGenProgram.uniform1i(sSourceIdx, sourceIdx); + gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); + gRadianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_STRENGTH, 1.f); + gRadianceGenProgram.uniform1i(sWidth, mProbeResolution); - U32 res = mMipChain[0].getWidth(); - - for (int i = 0; i < mMipChain.size(); ++i) - { - glViewport(0, 0, res, res); + U32 res = mMipChain[0].getWidth(); + for (int i = 0; i < mMipChain.size(); ++i) + { + glViewport(0, 0, res, res); - gRadianceGenProgram.uniform1f(sMipLevel, (GLfloat)i); - gRadianceGenProgram.uniform1f(sRoughness, (F32)i / (F32)(mMipChain.size() - 1)); + gRadianceGenProgram.uniform1f(sMipLevel, (GLfloat)i); + gRadianceGenProgram.uniform1f(sRoughness, (F32)i / (F32)(mMipChain.size() - 1)); - for (int cf = 0; cf < 6; ++cf) - { - LLCoordFrame frame; - frame.lookAt(LLVector3(0, 0, 0), LLCubeMapArray::sClipToCubeLookVecs[cf], LLCubeMapArray::sClipToCubeUpVecs[cf]); + for (int cf = 0; cf < 6; ++cf) + { + LLCoordFrame frame; + frame.lookAt(LLVector3(0, 0, 0), LLCubeMapArray::sClipToCubeLookVecs[cf], LLCubeMapArray::sClipToCubeUpVecs[cf]); - F32 mat[16]; - frame.getOpenGLRotation(mat); - gGL.loadMatrix(mat); + F32 mat[16]; + frame.getOpenGLRotation(mat); + gGL.loadMatrix(mat); - mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); + mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); - glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); - LOG_GLERROR("glCopyTexSubImage3D"); - } +#if GL_VERSION_4_0 + glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); +#endif + LOG_GLERROR("glCopyTexSubImage3D"); + } - if (i != mMipChain.size() - 1) - { - res /= 2; - } + if (i != mMipChain.size() - 1) + { + res /= 2; + } } - gRadianceGenProgram.unbind(); + gRadianceGenProgram.unbind(); mMipChain[0].flush(); //mTexture->unbind(); } @@ -1180,48 +1179,52 @@ void LLReflectionMapManager::updateProbeIrradianceOnFace(LLReflectionMap* probe, mMipChain[0].bindTarget("irradiance", 0); //mMipChain[0].clear(); - gIrradianceGenProgram.bind(); + gIrradianceGenProgram.bind(); - S32 channel = gIrradianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); - mTexture->bind(channel); +#if GL_VERSION_4_0 + S32 channel = gIrradianceGenProgram.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); + mTexture->bind(channel); +#endif - gIrradianceGenProgram.uniform1i(sSourceIdx, sourceIdx); - gIrradianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); + gIrradianceGenProgram.uniform1i(sSourceIdx, sourceIdx); + gIrradianceGenProgram.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mMaxProbeLOD); - mVertexBuffer->setBuffer(); + mVertexBuffer->setBuffer(); + int start_mip = 0; + // find the mip target to start with based on irradiance map resolution + for (start_mip = 0; start_mip < mMipChain.size(); ++start_mip) + { + if (mMipChain[start_mip].getWidth() == LL_IRRADIANCE_MAP_RESOLUTION) + { + break; + } + } - int start_mip = 0; - // find the mip target to start with based on irradiance map resolution - for (start_mip = 0; start_mip < mMipChain.size(); ++start_mip) - { - if (mMipChain[start_mip].getWidth() == LL_IRRADIANCE_MAP_RESOLUTION) - { - break; - } - } + int i = start_mip; + glViewport(0, 0, mMipChain[i].getWidth(), mMipChain[i].getHeight()); - int i = start_mip; - glViewport(0, 0, mMipChain[i].getWidth(), mMipChain[i].getHeight()); + int cf = face; + { + LLCoordFrame frame; + frame.lookAt(LLVector3(0, 0, 0), LLCubeMapArray::sClipToCubeLookVecs[cf], LLCubeMapArray::sClipToCubeUpVecs[cf]); - int cf = face; - { - LLCoordFrame frame; - frame.lookAt(LLVector3(0, 0, 0), LLCubeMapArray::sClipToCubeLookVecs[cf], LLCubeMapArray::sClipToCubeUpVecs[cf]); + F32 mat[16]; + frame.getOpenGLRotation(mat); + gGL.loadMatrix(mat); - F32 mat[16]; - frame.getOpenGLRotation(mat); - gGL.loadMatrix(mat); + mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); - mVertexBuffer->drawArrays(gGL.TRIANGLE_STRIP, 0, 4); +#if GL_VERSION_4_0 + S32 res = mMipChain[i].getWidth(); + mIrradianceMaps->bind(channel); + glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i - start_mip, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); +#endif + } - S32 res = mMipChain[i].getWidth(); - mIrradianceMaps->bind(channel); - glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, i - start_mip, 0, 0, probe->mCubeIndex * 6 + cf, 0, 0, res, res); - } + mMipChain[0].flush(); - mMipChain[0].flush(); - gIrradianceGenProgram.unbind(); - mTexture->unbind(); + gIrradianceGenProgram.unbind(); + mTexture->unbind(); } void LLReflectionMapManager::updateProbeRadianceOnFace(LLReflectionMap* probe, U32 face, S32 sourceIdx) @@ -1388,7 +1391,6 @@ void LLReflectionMapManager::updateUniforms() LLSettingsSky::ptr_t psky = environment.getCurrentSky(); static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); - F32 minimum_ambiance = psky->getReflectionProbeAmbiance(should_auto_adjust); bool is_ambiance_pass = gCubeSnapshot && !isRadiancePass(); @@ -1740,9 +1742,11 @@ void LLReflectionMapManager::initReflectionMaps() else { mTexture = new LLCubeMapArray(); + // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation // source) mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2, true, render_hdr); + mIrradianceMaps = new LLCubeMapArray(); mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, false, render_hdr); } @@ -1793,7 +1797,6 @@ void LLReflectionMapManager::initReflectionMaps() mDefaultProbe->mNextUpdateTime = 0.f; touch_default_probe(mDefaultProbe); - } if (mVertexBuffer.isNull()) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 183a9a9924..95474a8aaa 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6532,7 +6532,9 @@ void LLSelectMgr::renderSilhouettes(bool for_hud) gGL.popMatrix(); //glLineWidth(1.f); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif if (shader) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index bd1fc46f5d..5183370076 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1077,8 +1077,6 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) LLSceneMonitor::getInstance()->capture(); } - - // =========== RENDER UI ============= LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI"); @@ -1245,7 +1243,7 @@ void display_cube_face() gGL.setColorMask(true, true); - glClearColor(0, 0, 0, 0); + glClearColor(0.f, 0.f, 0.f, 0.f); //gPipeline.generateSunShadow(*LLViewerCamera::getInstance()); glClear(GL_DEPTH_BUFFER_BIT); // | GL_STENCIL_BUFFER_BIT); @@ -1539,7 +1537,6 @@ void render_ui(F32 zoom_factor, int subfield) LL_PROFILE_ZONE_NAMED_CATEGORY_UI("HUD"); render_hud_elements(); LLGLState::checkStates(); - render_hud_attachments(); LLGLState::checkStates(); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 18407b5b43..43cb7d8a14 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -804,7 +804,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() S32 probe_level = llclamp(gSavedSettings.getS32("RenderReflectionProbeLevel"), 0, 3); - S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); + S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); if (shadow_detail >= 1) { @@ -2554,9 +2554,9 @@ bool LLViewerShaderMgr::loadShadersDeferred() if (success && gGLManager.mGLVersion > 3.9f) { std::vector<std::pair<std::string, std::string>> quality_levels = { {"12", "Low"}, - {"23", "Medium"}, - {"28", "High"}, - {"39", "Ultra"} }; + {"23", "Medium"}, + {"28", "High"}, + {"39", "Ultra"} }; int i = 0; bool failed = false; for (const auto& quality_pair : quality_levels) @@ -2607,9 +2607,9 @@ bool LLViewerShaderMgr::loadShadersDeferred() if (gGLManager.mGLVersion > 3.15f && success) { std::vector<std::pair<std::string, std::string>> quality_levels = { {"SMAA_PRESET_LOW", "Low"}, - {"SMAA_PRESET_MEDIUM", "Medium"}, - {"SMAA_PRESET_HIGH", "High"}, - {"SMAA_PRESET_ULTRA", "Ultra"} }; + {"SMAA_PRESET_MEDIUM", "Medium"}, + {"SMAA_PRESET_HIGH", "High"}, + {"SMAA_PRESET_ULTRA", "Ultra"} }; int i = 0; bool failed = false; for (const auto& smaa_pair : quality_levels) diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 62ed963749..7f989f281e 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -24,307 +24,306 @@ * $/LicenseInfo$ */ - #ifndef LL_VIEWER_SHADER_MGR_H - #define LL_VIEWER_SHADER_MGR_H - - #include "llshadermgr.h" - #include "llmaterial.h" - - #define LL_DEFERRED_MULTI_LIGHT_COUNT 16 - - class LLViewerShaderMgr: public LLShaderMgr - { - public: - static bool sInitialized; - static bool sSkipReload; - - LLViewerShaderMgr(); - /* virtual */ ~LLViewerShaderMgr(); - - // Add shaders to mShaderList for later uniform propagation - // Will assert on redundant shader entries in debug builds - void finalizeShaderList(); - - // singleton pattern implementation - static LLViewerShaderMgr * instance(); - static void releaseInstance(); - - void initAttribsAndUniforms(void); - void setShaders(); - void unloadShaders(); - S32 getShaderLevel(S32 type); - - // loadBasicShaders in case of a failure returns - // name of a file error happened at, otherwise - // returns an empty string - std::string loadBasicShaders(); - bool loadShadersEffects(); - bool loadShadersDeferred(); - bool loadShadersObject(); - bool loadShadersAvatar(); - bool loadShadersWater(); - bool loadShadersInterface(); - - std::vector<S32> mShaderLevel; - S32 mMaxAvatarShaderLevel; - - enum EShaderClass - { - SHADER_LIGHTING, - SHADER_OBJECT, - SHADER_AVATAR, - SHADER_ENVIRONMENT, - SHADER_INTERFACE, - SHADER_EFFECT, - SHADER_WINDLIGHT, - SHADER_WATER, - SHADER_DEFERRED, - SHADER_COUNT - }; - - // simple model of forward iterator - // http://www.sgi.com/tech/stl/ForwardIterator.html - class shader_iter - { - private: - friend bool operator == (shader_iter const & a, shader_iter const & b); - friend bool operator != (shader_iter const & a, shader_iter const & b); - - typedef std::vector<LLGLSLShader *>::const_iterator base_iter_t; - public: - shader_iter() - { - } - - shader_iter(base_iter_t iter) : mIter(iter) - { - } - - LLGLSLShader & operator * () const - { - return **mIter; - } - - LLGLSLShader * operator -> () const - { - return *mIter; - } - - shader_iter & operator++ () - { - ++mIter; - return *this; - } - - shader_iter operator++ (int) - { - return mIter++; - } - - private: - base_iter_t mIter; - }; - - shader_iter beginShaders() const; - shader_iter endShaders() const; - - /* virtual */ std::string getShaderDirPrefix(void); - - /* virtual */ void updateShaderUniforms(LLGLSLShader * shader); - - private: - // the list of shaders we need to propagate parameters to. - std::vector<LLGLSLShader *> mShaderList; - - }; //LLViewerShaderMgr - - inline bool operator == (LLViewerShaderMgr::shader_iter const & a, LLViewerShaderMgr::shader_iter const & b) - { - return a.mIter == b.mIter; - } - - inline bool operator != (LLViewerShaderMgr::shader_iter const & a, LLViewerShaderMgr::shader_iter const & b) - { - return a.mIter != b.mIter; - } - - extern LLVector4 gShinyOrigin; - - //utility shaders - extern LLGLSLShader gOcclusionProgram; - extern LLGLSLShader gOcclusionCubeProgram; - extern LLGLSLShader gGlowCombineProgram; - extern LLGLSLShader gReflectionMipProgram; - extern LLGLSLShader gGaussianProgram; - extern LLGLSLShader gRadianceGenProgram; - extern LLGLSLShader gHeroRadianceGenProgram; - extern LLGLSLShader gIrradianceGenProgram; - extern LLGLSLShader gGlowCombineFXAAProgram; - extern LLGLSLShader gDebugProgram; - enum NormalDebugShaderVariant : S32 - { - NORMAL_DEBUG_SHADER_DEFAULT, - NORMAL_DEBUG_SHADER_WITH_TANGENTS, - NORMAL_DEBUG_SHADER_COUNT - }; - extern LLGLSLShader gNormalDebugProgram[NORMAL_DEBUG_SHADER_COUNT]; - extern LLGLSLShader gSkinnedNormalDebugProgram[NORMAL_DEBUG_SHADER_COUNT]; - extern LLGLSLShader gClipProgram; - extern LLGLSLShader gBenchmarkProgram; - extern LLGLSLShader gReflectionProbeDisplayProgram; - extern LLGLSLShader gCopyProgram; - extern LLGLSLShader gCopyDepthProgram; - extern LLGLSLShader gPBRTerrainBakeProgram; - extern LLGLSLShader gDrawColorProgram; - - //output tex0[tc0] - tex1[tc1] - extern LLGLSLShader gTwoTextureCompareProgram; - //discard some fragments based on user-set color tolerance - extern LLGLSLShader gOneTextureFilterProgram; - - - //object shaders - extern LLGLSLShader gObjectPreviewProgram; - extern LLGLSLShader gPhysicsPreviewProgram; - extern LLGLSLShader gObjectBumpProgram; - extern LLGLSLShader gSkinnedObjectBumpProgram; - extern LLGLSLShader gObjectAlphaMaskNoColorProgram; - - //environment shaders - extern LLGLSLShader gWaterProgram; - extern LLGLSLShader gUnderWaterProgram; - extern LLGLSLShader gGlowProgram; - extern LLGLSLShader gGlowExtractProgram; - - //interface shaders - extern LLGLSLShader gHighlightProgram; - extern LLGLSLShader gHighlightNormalProgram; - extern LLGLSLShader gHighlightSpecularProgram; - - extern LLGLSLShader gDeferredHighlightProgram; - - extern LLGLSLShader gPathfindingProgram; - extern LLGLSLShader gPathfindingNoNormalsProgram; - - // avatar shader handles - extern LLGLSLShader gAvatarProgram; - extern LLGLSLShader gAvatarEyeballProgram; - extern LLGLSLShader gImpostorProgram; - - // Post Process Shaders - extern LLGLSLShader gPostScreenSpaceReflectionProgram; - - // Deferred rendering shaders - extern LLGLSLShader gDeferredImpostorProgram; - extern LLGLSLShader gDeferredDiffuseProgram; - extern LLGLSLShader gDeferredDiffuseAlphaMaskProgram; - extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; - extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; - extern LLGLSLShader gDeferredNonIndexedDiffuseProgram; - extern LLGLSLShader gDeferredBumpProgram; - extern LLGLSLShader gDeferredTerrainProgram; - extern LLGLSLShader gDeferredTreeProgram; - extern LLGLSLShader gDeferredTreeShadowProgram; - extern LLGLSLShader gDeferredLightProgram; - extern LLGLSLShader gDeferredMultiLightProgram[LL_DEFERRED_MULTI_LIGHT_COUNT]; - extern LLGLSLShader gDeferredSpotLightProgram; - extern LLGLSLShader gDeferredMultiSpotLightProgram; - extern LLGLSLShader gDeferredSunProgram; - extern LLGLSLShader gDeferredSunProbeProgram; - extern LLGLSLShader gHazeProgram; - extern LLGLSLShader gHazeWaterProgram; - extern LLGLSLShader gDeferredBlurLightProgram; - extern LLGLSLShader gDeferredAvatarProgram; - extern LLGLSLShader gDeferredSoftenProgram; - extern LLGLSLShader gDeferredShadowProgram; - extern LLGLSLShader gDeferredShadowCubeProgram; - extern LLGLSLShader gDeferredShadowAlphaMaskProgram; - extern LLGLSLShader gDeferredShadowGLTFAlphaMaskProgram; - extern LLGLSLShader gDeferredShadowGLTFAlphaBlendProgram; - extern LLGLSLShader gDeferredShadowFullbrightAlphaMaskProgram; - extern LLGLSLShader gDeferredPostProgram; - extern LLGLSLShader gDeferredCoFProgram; - extern LLGLSLShader gDeferredDoFCombineProgram; - extern LLGLSLShader gFXAAProgram[4]; - extern LLGLSLShader gSMAAEdgeDetectProgram[4]; - extern LLGLSLShader gSMAABlendWeightsProgram[4]; - extern LLGLSLShader gSMAANeighborhoodBlendProgram[4]; - extern LLGLSLShader gCASProgram; - extern LLGLSLShader gDeferredPostNoDoFProgram; - extern LLGLSLShader gDeferredPostNoDoFNoiseProgram; - extern LLGLSLShader gDeferredPostGammaCorrectProgram; - extern LLGLSLShader gLegacyPostGammaCorrectProgram; - extern LLGLSLShader gHDRGammaCorrectProgram; - extern LLGLSLShader gDeferredPostTonemapProgram; - extern LLGLSLShader gNoPostTonemapProgram; - extern LLGLSLShader gExposureProgram; - extern LLGLSLShader gExposureProgramNoFade; - extern LLGLSLShader gLuminanceProgram; - extern LLGLSLShader gDeferredAvatarShadowProgram; - extern LLGLSLShader gDeferredAvatarAlphaShadowProgram; - extern LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; - extern LLGLSLShader gDeferredAlphaProgram; - extern LLGLSLShader gHUDAlphaProgram; - extern LLGLSLShader gDeferredAlphaImpostorProgram; - extern LLGLSLShader gDeferredFullbrightProgram; - extern LLGLSLShader gHUDFullbrightProgram; - extern LLGLSLShader gDeferredFullbrightAlphaMaskProgram; - extern LLGLSLShader gHUDFullbrightAlphaMaskProgram; - extern LLGLSLShader gDeferredFullbrightAlphaMaskAlphaProgram; - extern LLGLSLShader gHUDFullbrightAlphaMaskAlphaProgram; - extern LLGLSLShader gDeferredEmissiveProgram; - extern LLGLSLShader gDeferredAvatarEyesProgram; - extern LLGLSLShader gDeferredAvatarAlphaProgram; - extern LLGLSLShader gEnvironmentMapProgram; - extern LLGLSLShader gDeferredWLSkyProgram; - extern LLGLSLShader gDeferredWLCloudProgram; - extern LLGLSLShader gDeferredWLSunProgram; - extern LLGLSLShader gDeferredWLMoonProgram; - extern LLGLSLShader gDeferredStarProgram; - extern LLGLSLShader gDeferredFullbrightShinyProgram; - extern LLGLSLShader gHUDFullbrightShinyProgram; - extern LLGLSLShader gNormalMapGenProgram; - extern LLGLSLShader gDeferredGenBrdfLutProgram; - extern LLGLSLShader gDeferredBufferVisualProgram; - - // Deferred materials shaders - extern LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2]; - - extern LLGLSLShader gHUDPBROpaqueProgram; - extern LLGLSLShader gPBRGlowProgram; - extern LLGLSLShader gDeferredPBROpaqueProgram; - extern LLGLSLShader gDeferredPBRAlphaProgram; - extern LLGLSLShader gHUDPBRAlphaProgram; - - // GLTF shaders - extern LLGLSLShader gGLTFPBRMetallicRoughnessProgram; - - extern LLGLSLShader gBloomExtractProgram; - extern LLGLSLShader gBloomBlurProgram; - extern LLGLSLShader gBloomCombineProgram; - - - // Encodes detail level for dropping textures, in accordance with the GLTF spec where possible - // 0 is highest detail, -1 drops emissive, etc - // Dropping metallic roughness is off-spec - Reserve for potato machines as needed - // https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#additional-textures - enum TerrainPBRDetail : S32 - { - TERRAIN_PBR_DETAIL_MAX = 0, - TERRAIN_PBR_DETAIL_EMISSIVE = 0, - TERRAIN_PBR_DETAIL_OCCLUSION = -1, - TERRAIN_PBR_DETAIL_NORMAL = -2, - TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS = -3, - TERRAIN_PBR_DETAIL_BASE_COLOR = -4, - TERRAIN_PBR_DETAIL_MIN = -4, - }; - enum TerrainPaintType : U32 - { - // Use LLVLComposition::mDatap (heightmap) generated by generateHeights, plus noise from TERRAIN_ALPHARAMP - TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE = 0, - // Use paint map if PBR terrain, otherwise fall back to TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE - TERRAIN_PAINT_TYPE_PBR_PAINTMAP = 1, - TERRAIN_PAINT_TYPE_COUNT = 2, - }; - extern LLGLSLShader gDeferredPBRTerrainProgram[TERRAIN_PAINT_TYPE_COUNT]; - #endif +#ifndef LL_VIEWER_SHADER_MGR_H +#define LL_VIEWER_SHADER_MGR_H + +#include "llshadermgr.h" +#include "llmaterial.h" + +#define LL_DEFERRED_MULTI_LIGHT_COUNT 16 + +class LLViewerShaderMgr: public LLShaderMgr +{ +public: + static bool sInitialized; + static bool sSkipReload; + + LLViewerShaderMgr(); + /* virtual */ ~LLViewerShaderMgr(); + + // Add shaders to mShaderList for later uniform propagation + // Will assert on redundant shader entries in debug builds + void finalizeShaderList(); + + // singleton pattern implementation + static LLViewerShaderMgr * instance(); + static void releaseInstance(); + + void initAttribsAndUniforms(void); + void setShaders(); + void unloadShaders(); + S32 getShaderLevel(S32 type); + + // loadBasicShaders in case of a failure returns + // name of a file error happened at, otherwise + // returns an empty string + std::string loadBasicShaders(); + bool loadShadersEffects(); + bool loadShadersDeferred(); + bool loadShadersObject(); + bool loadShadersAvatar(); + bool loadShadersWater(); + bool loadShadersInterface(); + + std::vector<S32> mShaderLevel; + S32 mMaxAvatarShaderLevel; + + enum EShaderClass + { + SHADER_LIGHTING, + SHADER_OBJECT, + SHADER_AVATAR, + SHADER_ENVIRONMENT, + SHADER_INTERFACE, + SHADER_EFFECT, + SHADER_WINDLIGHT, + SHADER_WATER, + SHADER_DEFERRED, + SHADER_COUNT + }; + + // simple model of forward iterator + // http://www.sgi.com/tech/stl/ForwardIterator.html + class shader_iter + { + private: + friend bool operator == (shader_iter const & a, shader_iter const & b); + friend bool operator != (shader_iter const & a, shader_iter const & b); + + typedef std::vector<LLGLSLShader *>::const_iterator base_iter_t; + public: + shader_iter() + { + } + + shader_iter(base_iter_t iter) : mIter(iter) + { + } + + LLGLSLShader & operator * () const + { + return **mIter; + } + + LLGLSLShader * operator -> () const + { + return *mIter; + } + + shader_iter & operator++ () + { + ++mIter; + return *this; + } + + shader_iter operator++ (int) + { + return mIter++; + } + + private: + base_iter_t mIter; + }; + + shader_iter beginShaders() const; + shader_iter endShaders() const; + + /* virtual */ std::string getShaderDirPrefix(void); + + /* virtual */ void updateShaderUniforms(LLGLSLShader * shader); + +private: + // the list of shaders we need to propagate parameters to. + std::vector<LLGLSLShader *> mShaderList; + +}; //LLViewerShaderMgr + +inline bool operator == (LLViewerShaderMgr::shader_iter const & a, LLViewerShaderMgr::shader_iter const & b) +{ + return a.mIter == b.mIter; +} + +inline bool operator != (LLViewerShaderMgr::shader_iter const & a, LLViewerShaderMgr::shader_iter const & b) +{ + return a.mIter != b.mIter; +} + +extern LLVector4 gShinyOrigin; + +//utility shaders +extern LLGLSLShader gOcclusionProgram; +extern LLGLSLShader gOcclusionCubeProgram; +extern LLGLSLShader gGlowCombineProgram; +extern LLGLSLShader gReflectionMipProgram; +extern LLGLSLShader gGaussianProgram; +extern LLGLSLShader gRadianceGenProgram; +extern LLGLSLShader gHeroRadianceGenProgram; +extern LLGLSLShader gIrradianceGenProgram; +extern LLGLSLShader gGlowCombineFXAAProgram; +extern LLGLSLShader gDebugProgram; +enum NormalDebugShaderVariant : S32 +{ + NORMAL_DEBUG_SHADER_DEFAULT, + NORMAL_DEBUG_SHADER_WITH_TANGENTS, + NORMAL_DEBUG_SHADER_COUNT +}; +extern LLGLSLShader gNormalDebugProgram[NORMAL_DEBUG_SHADER_COUNT]; +extern LLGLSLShader gSkinnedNormalDebugProgram[NORMAL_DEBUG_SHADER_COUNT]; +extern LLGLSLShader gClipProgram; +extern LLGLSLShader gBenchmarkProgram; +extern LLGLSLShader gReflectionProbeDisplayProgram; +extern LLGLSLShader gCopyProgram; +extern LLGLSLShader gCopyDepthProgram; +extern LLGLSLShader gPBRTerrainBakeProgram; +extern LLGLSLShader gDrawColorProgram; + +//output tex0[tc0] - tex1[tc1] +extern LLGLSLShader gTwoTextureCompareProgram; +//discard some fragments based on user-set color tolerance +extern LLGLSLShader gOneTextureFilterProgram; + + +//object shaders +extern LLGLSLShader gObjectPreviewProgram; +extern LLGLSLShader gPhysicsPreviewProgram; +extern LLGLSLShader gObjectBumpProgram; +extern LLGLSLShader gSkinnedObjectBumpProgram; +extern LLGLSLShader gObjectAlphaMaskNoColorProgram; + +//environment shaders +extern LLGLSLShader gWaterProgram; +extern LLGLSLShader gUnderWaterProgram; +extern LLGLSLShader gGlowProgram; +extern LLGLSLShader gGlowExtractProgram; + +//interface shaders +extern LLGLSLShader gHighlightProgram; +extern LLGLSLShader gHighlightNormalProgram; +extern LLGLSLShader gHighlightSpecularProgram; + +extern LLGLSLShader gDeferredHighlightProgram; + +extern LLGLSLShader gPathfindingProgram; +extern LLGLSLShader gPathfindingNoNormalsProgram; + +// avatar shader handles +extern LLGLSLShader gAvatarProgram; +extern LLGLSLShader gAvatarEyeballProgram; +extern LLGLSLShader gImpostorProgram; + +// Post Process Shaders +extern LLGLSLShader gPostScreenSpaceReflectionProgram; + +// Deferred rendering shaders +extern LLGLSLShader gDeferredImpostorProgram; +extern LLGLSLShader gDeferredDiffuseProgram; +extern LLGLSLShader gDeferredDiffuseAlphaMaskProgram; +extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; +extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; +extern LLGLSLShader gDeferredNonIndexedDiffuseProgram; +extern LLGLSLShader gDeferredBumpProgram; +extern LLGLSLShader gDeferredTerrainProgram; +extern LLGLSLShader gDeferredTreeProgram; +extern LLGLSLShader gDeferredTreeShadowProgram; +extern LLGLSLShader gDeferredLightProgram; +extern LLGLSLShader gDeferredMultiLightProgram[LL_DEFERRED_MULTI_LIGHT_COUNT]; +extern LLGLSLShader gDeferredSpotLightProgram; +extern LLGLSLShader gDeferredMultiSpotLightProgram; +extern LLGLSLShader gDeferredSunProgram; +extern LLGLSLShader gDeferredSunProbeProgram; +extern LLGLSLShader gHazeProgram; +extern LLGLSLShader gHazeWaterProgram; +extern LLGLSLShader gDeferredBlurLightProgram; +extern LLGLSLShader gDeferredAvatarProgram; +extern LLGLSLShader gDeferredSoftenProgram; +extern LLGLSLShader gDeferredShadowProgram; +extern LLGLSLShader gDeferredShadowCubeProgram; +extern LLGLSLShader gDeferredShadowAlphaMaskProgram; +extern LLGLSLShader gDeferredShadowGLTFAlphaMaskProgram; +extern LLGLSLShader gDeferredShadowGLTFAlphaBlendProgram; +extern LLGLSLShader gDeferredShadowFullbrightAlphaMaskProgram; +extern LLGLSLShader gDeferredPostProgram; +extern LLGLSLShader gDeferredCoFProgram; +extern LLGLSLShader gDeferredDoFCombineProgram; +extern LLGLSLShader gFXAAProgram[4]; +extern LLGLSLShader gSMAAEdgeDetectProgram[4]; +extern LLGLSLShader gSMAABlendWeightsProgram[4]; +extern LLGLSLShader gSMAANeighborhoodBlendProgram[4]; +extern LLGLSLShader gCASProgram; +extern LLGLSLShader gDeferredPostNoDoFProgram; +extern LLGLSLShader gDeferredPostNoDoFNoiseProgram; +extern LLGLSLShader gDeferredPostGammaCorrectProgram; +extern LLGLSLShader gLegacyPostGammaCorrectProgram; +extern LLGLSLShader gHDRGammaCorrectProgram; +extern LLGLSLShader gDeferredPostTonemapProgram; +extern LLGLSLShader gNoPostTonemapProgram; +extern LLGLSLShader gExposureProgram; +extern LLGLSLShader gExposureProgramNoFade; +extern LLGLSLShader gLuminanceProgram; +extern LLGLSLShader gDeferredAvatarShadowProgram; +extern LLGLSLShader gDeferredAvatarAlphaShadowProgram; +extern LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; +extern LLGLSLShader gDeferredAlphaProgram; +extern LLGLSLShader gHUDAlphaProgram; +extern LLGLSLShader gDeferredAlphaImpostorProgram; +extern LLGLSLShader gDeferredFullbrightProgram; +extern LLGLSLShader gHUDFullbrightProgram; +extern LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +extern LLGLSLShader gHUDFullbrightAlphaMaskProgram; +extern LLGLSLShader gDeferredFullbrightAlphaMaskAlphaProgram; +extern LLGLSLShader gHUDFullbrightAlphaMaskAlphaProgram; +extern LLGLSLShader gDeferredEmissiveProgram; +extern LLGLSLShader gDeferredAvatarEyesProgram; +extern LLGLSLShader gDeferredAvatarAlphaProgram; +extern LLGLSLShader gEnvironmentMapProgram; +extern LLGLSLShader gDeferredWLSkyProgram; +extern LLGLSLShader gDeferredWLCloudProgram; +extern LLGLSLShader gDeferredWLSunProgram; +extern LLGLSLShader gDeferredWLMoonProgram; +extern LLGLSLShader gDeferredStarProgram; +extern LLGLSLShader gDeferredFullbrightShinyProgram; +extern LLGLSLShader gHUDFullbrightShinyProgram; +extern LLGLSLShader gNormalMapGenProgram; +extern LLGLSLShader gDeferredGenBrdfLutProgram; +extern LLGLSLShader gDeferredBufferVisualProgram; + +// Deferred materials shaders +extern LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2]; + +extern LLGLSLShader gHUDPBROpaqueProgram; +extern LLGLSLShader gPBRGlowProgram; +extern LLGLSLShader gDeferredPBROpaqueProgram; +extern LLGLSLShader gDeferredPBRAlphaProgram; +extern LLGLSLShader gHUDPBRAlphaProgram; + +// GLTF shaders +extern LLGLSLShader gGLTFPBRMetallicRoughnessProgram; + +extern LLGLSLShader gBloomExtractProgram; +extern LLGLSLShader gBloomBlurProgram; +extern LLGLSLShader gBloomCombineProgram; + +// Encodes detail level for dropping textures, in accordance with the GLTF spec where possible +// 0 is highest detail, -1 drops emissive, etc +// Dropping metallic roughness is off-spec - Reserve for potato machines as needed +// https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#additional-textures +enum TerrainPBRDetail : S32 +{ + TERRAIN_PBR_DETAIL_MAX = 0, + TERRAIN_PBR_DETAIL_EMISSIVE = 0, + TERRAIN_PBR_DETAIL_OCCLUSION = -1, + TERRAIN_PBR_DETAIL_NORMAL = -2, + TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS = -3, + TERRAIN_PBR_DETAIL_BASE_COLOR = -4, + TERRAIN_PBR_DETAIL_MIN = -4, +}; +enum TerrainPaintType : U32 +{ + // Use LLVLComposition::mDatap (heightmap) generated by generateHeights, plus noise from TERRAIN_ALPHARAMP + TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE = 0, + // Use paint map if PBR terrain, otherwise fall back to TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE + TERRAIN_PAINT_TYPE_PBR_PAINTMAP = 1, + TERRAIN_PAINT_TYPE_COUNT = 2, +}; +extern LLGLSLShader gDeferredPBRTerrainProgram[TERRAIN_PAINT_TYPE_COUNT]; +#endif diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 82246b564c..cde6d0c1dc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1966,7 +1966,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) // LL_DEBUGS("Window") << "Loading feature tables." << LL_ENDL; - // Initialize OpenGL Renderer LLVertexBuffer::initClass(mWindow, gSavedSettings.getU32("MPVertexBufferMode")); @@ -4831,13 +4830,21 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save auto err = 0; auto extension("." + image->getExtension()); auto now = LLDate::now(); + static LLCachedControl<bool> snapshot_timestamp(gSavedSettings, "SnapshotTimestamp", true); do { filepath = sSnapshotDir; filepath += gDirUtilp->getDirDelimiter(); filepath += sSnapshotBaseName; + if (snapshot_timestamp) + { filepath += now.toLocalDateString("_%Y-%m-%d_%H%M%S"); filepath += llformat("%.2d", i); + } + else if (is_snapshot_name_loc_set) + { + filepath += llformat("_%.3d", i); + } filepath += extension; llstat stat_info; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 996221fdba..800ed79d8a 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1,28 +1,28 @@ /** -* @file pipeline.cpp -* @brief Rendering pipeline. -* -* $LicenseInfo:firstyear=2005&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ + * @file pipeline.cpp + * @brief Rendering pipeline. + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ #include "llviewerprecompiledheaders.h" @@ -1581,7 +1581,7 @@ void LLPipeline::restoreGL() if (part) { part->restoreGL(); - } + } } } } @@ -2117,7 +2117,7 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) { LL_PROFILE_ZONE_SCOPED; for (LLDrawable::drawable_vector_t::iterator iter = moved_list.begin(); - iter != moved_list.end(); ) + iter != moved_list.end(); ) { LLDrawable::drawable_vector_t::iterator curiter = iter++; LLDrawable *drawablep = *curiter; @@ -2783,7 +2783,7 @@ void LLPipeline::clearRebuildGroups() mGroupQ1Locked = true; // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); - iter != mGroupQ1.end(); ++iter) + iter != mGroupQ1.end(); ++iter) { LLSpatialGroup* group = *iter; @@ -2811,7 +2811,7 @@ void LLPipeline::clearRebuildDrawables() { // Clear all drawables on the priority build queue, for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin(); - iter != mBuildQ1.end(); ++iter) + iter != mBuildQ1.end(); ++iter) { LLDrawable* drawablep = *iter; if (drawablep && !drawablep->isDead()) @@ -2823,7 +2823,7 @@ void LLPipeline::clearRebuildDrawables() //clear all moving bridges for (LLDrawable::drawable_vector_t::iterator iter = mMovedBridge.begin(); - iter != mMovedBridge.end(); ++iter) + iter != mMovedBridge.end(); ++iter) { LLDrawable *drawablep = *iter; drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD); @@ -2832,7 +2832,7 @@ void LLPipeline::clearRebuildDrawables() //clear all moving drawables for (LLDrawable::drawable_vector_t::iterator iter = mMovedList.begin(); - iter != mMovedList.end(); ++iter) + iter != mMovedList.end(); ++iter) { LLDrawable *drawablep = *iter; drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD); @@ -2861,7 +2861,7 @@ void LLPipeline::rebuildPriorityGroups() mGroupQ1Locked = true; // Iterate through all drawables on the priority build queue, for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); - iter != mGroupQ1.end(); ++iter) + iter != mGroupQ1.end(); ++iter) { LLSpatialGroup* group = *iter; group->rebuildGeom(); @@ -2893,7 +2893,7 @@ void LLPipeline::updateGeom(F32 max_dtime) // Iterate through all drawables on the priority build queue, for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin(); - iter != mBuildQ1.end();) + iter != mBuildQ1.end();) { LLDrawable::drawable_list_t::iterator curiter = iter++; LLDrawable* drawablep = *curiter; @@ -2943,8 +2943,8 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) LLVOAvatar* av = vobj->asAvatar(); if (av && ((!sImpostorRender && av->isImpostor()) //ignore impostor flag during impostor pass - || av->isInMuteList() - || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) + || av->isInMuteList() + || (LLVOAvatar::AOA_JELLYDOLL == av->getOverallAppearance() && !av->needsImpostorUpdate()) )) { return; } @@ -3161,13 +3161,13 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) LL_PROFILE_GPU_ZONE("stateSort"); if (hasAnyRenderType(LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_CONTROL_AV, - LLPipeline::RENDER_TYPE_TERRAIN, - LLPipeline::RENDER_TYPE_TREE, - LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_VOIDWATER, - LLPipeline::RENDER_TYPE_WATER, - LLPipeline::END_RENDER_TYPES)) + LLPipeline::RENDER_TYPE_CONTROL_AV, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_VOIDWATER, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::END_RENDER_TYPES)) { //clear faces from face pools gPipeline.resetDrawOrders(); @@ -3265,7 +3265,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWABLE("stateSort"); // LL_RECORD_BLOCK_TIME(FTM_STATESORT_DRAWABLE); for (LLCullResult::drawable_iterator iter = sCull->beginVisibleList(); - iter != sCull->endVisibleList(); ++iter) + iter != sCull->endVisibleList(); ++iter) { LLDrawable *drawablep = *iter; if (!drawablep->isDead()) @@ -3400,8 +3400,8 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) void forAllDrawables(LLCullResult::sg_iterator begin, - LLCullResult::sg_iterator end, - void (*func)(LLDrawable*)) + LLCullResult::sg_iterator end, + void (*func)(LLDrawable*)) { for (LLCullResult::sg_iterator i = begin; i != end; ++i) { @@ -3464,7 +3464,7 @@ void renderScriptedTouchBeacons(LLDrawable *drawablep) if (gPipeline.sRenderBeacons) { gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), - LLPipeline::DebugBeaconLineWidth); + LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3494,7 +3494,7 @@ void renderPhysicalBeacons(LLDrawable *drawablep) if (gPipeline.sRenderBeacons) { gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), - LLPipeline::DebugBeaconLineWidth); + LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3535,7 +3535,7 @@ void renderMOAPBeacons(LLDrawable *drawablep) if (gPipeline.sRenderBeacons) { gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 1.f, 1.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), - LLPipeline::DebugBeaconLineWidth); + LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3564,7 +3564,7 @@ void renderParticleBeacons(LLDrawable *drawablep) { LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), - LLPipeline::DebugBeaconLineWidth); + LLPipeline::DebugBeaconLineWidth); } if (gPipeline.sRenderHighlight) @@ -3649,7 +3649,7 @@ void LLPipeline::postSort(LLCamera &camera) if ((sUseOcclusion && group->isOcclusionState(LLSpatialGroup::OCCLUDED)) || (RenderAutoHideSurfaceAreaLimit > 0.f && - group->mSurfaceArea > RenderAutoHideSurfaceAreaLimit * llmax(group->mObjectBoxSize, 10.f))) + group->mSurfaceArea > RenderAutoHideSurfaceAreaLimit * llmax(group->mObjectBoxSize, 10.f))) { continue; } @@ -4620,7 +4620,6 @@ void LLPipeline::renderDebug() LLGLDisable cull(i >= 2 ? GL_CULL_FACE : 0); gGL.flush(); - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); //get rid of some z-fighting @@ -5636,8 +5635,8 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) LLDrawable* drawable = light->drawable; const LLViewerObject *vobj = light->drawable->getVObj(); if(vobj && vobj->getAvatar() - && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList() || vobj->getAvatar()->isTooSlow()) - ) + && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList() || vobj->getAvatar()->isTooSlow()) + ) { drawable->clearState(LLDrawable::NEARBY_LIGHT); continue; @@ -5698,7 +5697,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) // FIND NEW LIGHTS THAT ARE IN RANGE light_set_t new_nearby_lights; for (LLDrawable::ordered_drawable_set_t::iterator iter = mLights.begin(); - iter != mLights.end(); ++iter) + iter != mLights.end(); ++iter) { LLDrawable* drawable = *iter; LLVOVolume* light = drawable->getVOVolume(); @@ -5736,7 +5735,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) // INSERT ANY NEW LIGHTS for (light_set_t::iterator iter = new_nearby_lights.begin(); - iter != new_nearby_lights.end(); iter++) + iter != new_nearby_lights.end(); iter++) { const Light* light = &(*iter); if (LLPipeline::sRenderDeferred || mNearbyLights.size() < (U32)MAX_LOCAL_LIGHTS) @@ -5778,7 +5777,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) //mark nearby lights not-removable. for (light_set_t::iterator iter = mNearbyLights.begin(); - iter != mNearbyLights.end(); iter++) + iter != mNearbyLights.end(); iter++) { const Light* light = &(*iter); ((LLViewerOctreeEntryData*) light->drawable)->setVisible(); @@ -5885,7 +5884,7 @@ void LLPipeline::setupHWLights() if (local_light_count >= 1) { for (light_set_t::iterator iter = mNearbyLights.begin(); - iter != mNearbyLights.end(); ++iter) + iter != mNearbyLights.end(); ++iter) { LLDrawable* drawable = iter->drawable; LLVOVolume* light = drawable->getVOVolume(); @@ -6729,7 +6728,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, !drawable->getVObj()->isAttachment() || delta.getLength3().getF32() > ATTACHMENT_OVERRIDE_DIST) { //avatar overrides if previously hit drawable is not an attachment or - //attachment is far enough away from detected intersection + //attachment is far enough away from detected intersection drawable = hit; local_end = position; } @@ -6799,12 +6798,12 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, } LLViewerObject* LLPipeline::lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, - bool pick_transparent, - S32* face_hit, - LLVector4a* intersection, // return the intersection point - LLVector2* tex_coord, // return the texture coordinates of the intersection point - LLVector4a* normal, // return the surface normal at the intersection point - LLVector4a* tangent // return the surface tangent at the intersection point + bool pick_transparent, + S32* face_hit, + LLVector4a* intersection, // return the intersection point + LLVector2* tex_coord, // return the texture coordinates of the intersection point + LLVector4a* normal, // return the surface normal at the intersection point + LLVector4a* tangent // return the surface tangent at the intersection point ) { LLDrawable* drawable = NULL; @@ -7434,8 +7433,8 @@ void LLPipeline::generateGlow(LLRenderTarget* src) gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } gGlowExtractProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, - (GLfloat)mGlow[2].getWidth(), - (GLfloat)mGlow[2].getHeight()); + (GLfloat)mGlow[2].getWidth(), + (GLfloat)mGlow[2].getHeight()); } { @@ -7559,90 +7558,95 @@ bool LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) bool LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { - llassert(!gCubeSnapshot); - bool multisample = RenderFSAAType == 1 && gFXAAProgram[0].isComplete() && mFXAAMap.isComplete(); + { + llassert(!gCubeSnapshot); + bool multisample = RenderFSAAType == 1 && gFXAAProgram[0].isComplete() && mFXAAMap.isComplete(); - if(!multisample) return false; + if(!multisample) return false; - LL_PROFILE_GPU_ZONE("aa"); - S32 width = dst->getWidth(); - S32 height = dst->getHeight(); + { + LL_PROFILE_GPU_ZONE("aa"); + S32 width = dst->getWidth(); + S32 height = dst->getHeight(); + //LL_WARNS() << "dst width=" << width << LL_ENDL; - // bake out texture2D with RGBL for FXAA shader - mFXAAMap.bindTarget("applyFXAA", 1); - mFXAAMap.clear(GL_COLOR_BUFFER_BIT); + // bake out texture2D with RGBL for FXAA shader + mFXAAMap.bindTarget("applyFXAA", 1); + mFXAAMap.clear(GL_COLOR_BUFFER_BIT); - LLGLSLShader* shader = &gGlowCombineFXAAProgram; - shader->bind(); + LLGLSLShader* shader = &gGlowCombineFXAAProgram; + shader->bind(); - S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); - if (channel > -1) - { - src->bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); - } + S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); + if (channel > -1) + { + src->bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); + } - { - LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS); - renderTriangle(); - } + { + LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS); + renderTriangle(); + } - shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); - shader->unbind(); + shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); + shader->unbind(); - mFXAAMap.flush(); + mFXAAMap.flush(); - dst->bindTarget("applyFXAA", 1); - dst->clear(); + dst->bindTarget("applyFXAA", 1); + dst->clear(); - static LLCachedControl<U32> aa_quality(gSavedSettings, "RenderFSAASamples", 0U); - U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); + static LLCachedControl<U32> aa_quality(gSavedSettings, "RenderFSAASamples", 0U); + U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); - shader = &gFXAAProgram[fsaa_quality]; - shader->bind(); + shader = &gFXAAProgram[fsaa_quality]; + shader->bind(); - channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAAMap.getUsage()); - if (channel > -1) - { - mFXAAMap.bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); - } + channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAAMap.getUsage()); + if (channel > -1) + { + mFXAAMap.bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); + } - /* - gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; - gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; - gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); - gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); +/* + gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; + gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; + gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); + gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); - glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); + glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); */ - F32 scale_x = (F32)width / mFXAAMap.getWidth(); - F32 scale_y = (F32)height / mFXAAMap.getHeight(); + F32 scale_x = (F32)width / mFXAAMap.getWidth(); + F32 scale_y = (F32)height / mFXAAMap.getHeight(); - //LL_WARNS() << "vp width=" << gGLViewport[2] << " scale=" << scale_x << LL_ENDL; + //LL_WARNS() << "vp width=" << gGLViewport[2] << " scale=" << scale_x << LL_ENDL; - shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y); - shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f / width * scale_x, 1.f / height * scale_y); - shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f / width * scale_x, -0.5f / height * scale_y, - 0.5f / width * scale_x, 0.5f / height * scale_y); - shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f / width * scale_x, -2.f / height * scale_y, - 2.f / width * scale_x, 2.f / height * scale_y); + shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y); + shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f / width * scale_x, 1.f / height * scale_y); + shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f / width * scale_x, -0.5f / height * scale_y, + 0.5f / width * scale_x, 0.5f / height * scale_y); + shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f / width * scale_x, -2.f / height * scale_y, + 2.f / width * scale_x, 2.f / height * scale_y); - { - LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS); - S32 depth_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DEPTH); - gGL.getTexUnit(depth_channel)->bind(&mRT->deferredScreen, true); + { + LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS); + S32 depth_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DEPTH); + gGL.getTexUnit(depth_channel)->bind(&mRT->deferredScreen, true); - renderTriangle(); - } + renderTriangle(); + } - if (channel > -1) - { - shader->unbindTexture(channel); - } + if (channel > -1) + { + shader->unbindTexture(channel); + } - shader->unbind(); - dst->flush(); + shader->unbind(); + dst->flush(); + } + } return true; } @@ -7760,10 +7764,8 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) //{ // glStencilFunc(GL_ALWAYS, 0, 0xFF); //} - blend_weights_shader.unbind(); dest.flush(); - gGL.getTexUnit(edge_tex_channel)->unbindFast(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(area_tex_channel)->unbindFast(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(search_tex_channel)->unbindFast(LLTexUnit::TT_TEXTURE); @@ -7785,56 +7787,57 @@ bool LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst) if(!multisample) return false; - LL_PROFILE_GPU_ZONE("aa"); - - generateSMAABuffers(src); + { + LL_PROFILE_GPU_ZONE("aa"); + generateSMAABuffers(src); - static LLCachedControl<U32> aa_quality(gSavedSettings, "RenderFSAASamples", 0U); - U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); + static LLCachedControl<U32> aa_quality(gSavedSettings, "RenderFSAASamples", 0U); + U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); - S32 width = src->getWidth(); - S32 height = src->getHeight(); + S32 width = src->getWidth(); + S32 height = src->getHeight(); - float rt_metrics[] = { 1.f / width, 1.f / height, (float)width, (float)height }; + float rt_metrics[] = { 1.f / width, 1.f / height, (float)width, (float)height }; - LLGLDepthTest depth(GL_FALSE, GL_FALSE); + LLGLDepthTest depth(GL_FALSE, GL_FALSE); - static LLCachedControl<bool> use_sample(gSavedSettings, "RenderSMAAUseSample", false); - //static LLCachedControl<bool> use_stencil(gSavedSettings, "RenderSMAAUseStencil", true); + static LLCachedControl<bool> use_sample(gSavedSettings, "RenderSMAAUseSample", false); + //static LLCachedControl<bool> use_stencil(gSavedSettings, "RenderSMAAUseStencil", true); - { - //LLGLDisable stencil(GL_STENCIL_TEST); + { + //LLGLDisable stencil(GL_STENCIL_TEST); - // Bind setup: - LLRenderTarget* bound_target = dst; - LLGLSLShader& blend_shader = gSMAANeighborhoodBlendProgram[fsaa_quality]; + // Bind setup: + LLRenderTarget* bound_target = dst; + LLGLSLShader& blend_shader = gSMAANeighborhoodBlendProgram[fsaa_quality]; - bound_target->bindTarget("applySMAA", 1); - bound_target->clear(GL_COLOR_BUFFER_BIT); + bound_target->bindTarget("applySMAA", 1); + bound_target->clear(GL_COLOR_BUFFER_BIT); - blend_shader.bind(); - blend_shader.uniform4fv(sSmaaRTMetrics, 1, rt_metrics); + blend_shader.bind(); + blend_shader.uniform4fv(sSmaaRTMetrics, 1, rt_metrics); - S32 diffuse_channel = blend_shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE); - if(diffuse_channel > -1) - { - src->bindTexture(0, diffuse_channel, LLTexUnit::TFO_BILINEAR); - gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - } + S32 diffuse_channel = blend_shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE); + if(diffuse_channel > -1) + { + src->bindTexture(0, diffuse_channel, LLTexUnit::TFO_BILINEAR); + gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + } - S32 blend_channel = blend_shader.enableTexture(LLShaderMgr::SMAA_BLEND_TEX); - if (blend_channel > -1) - { - mSMAABlendBuffer.bindTexture(0, blend_channel, LLTexUnit::TFO_BILINEAR); - } + S32 blend_channel = blend_shader.enableTexture(LLShaderMgr::SMAA_BLEND_TEX); + if (blend_channel > -1) + { + mSMAABlendBuffer.bindTexture(0, blend_channel, LLTexUnit::TFO_BILINEAR); + } - renderTriangle(); + renderTriangle(); - bound_target->flush(); - blend_shader.unbind(); - gGL.getTexUnit(diffuse_channel)->unbindFast(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(blend_channel)->unbindFast(LLTexUnit::TT_TEXTURE); + bound_target->flush(); + blend_shader.unbind(); + gGL.getTexUnit(diffuse_channel)->unbindFast(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(blend_channel)->unbindFast(LLTexUnit::TT_TEXTURE); + } } LOG_GLERROR("LLPipeline::applySMAA()"); @@ -7843,6 +7846,7 @@ bool LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::copyRenderTarget(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("copyRenderTarget"); dst->bindTarget("copyRenderTarget", 1); dst->clear(GL_COLOR_BUFFER_BIT); @@ -7865,6 +7869,7 @@ void LLPipeline::combineGlow(LLRenderTarget* src, LLRenderTarget* dst) dst->bindTarget("combineGlow", 1); { + gGlowCombineProgram.bind(); gGlowCombineProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src); @@ -7879,188 +7884,190 @@ void LLPipeline::combineGlow(LLRenderTarget* src, LLRenderTarget* dst) bool LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) { - bool dof_enabled = + { + bool dof_enabled = (RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && RenderDepthOfField && !gCubeSnapshot; if(!dof_enabled) return false; - gViewerWindow->setup3DViewport(); + gViewerWindow->setup3DViewport(); - if (dof_enabled) - { - LL_PROFILE_GPU_ZONE("dof"); - LLGLDisable blend(GL_BLEND); + if (dof_enabled) + { + LL_PROFILE_GPU_ZONE("dof"); + LLGLDisable blend(GL_BLEND); - // depth of field focal plane calculations - static F32 current_distance = 16.f; - static F32 start_distance = 16.f; - static F32 transition_time = 1.f; + // depth of field focal plane calculations + static F32 current_distance = 16.f; + static F32 start_distance = 16.f; + static F32 transition_time = 1.f; - LLVector3 focus_point; + LLVector3 focus_point; - LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject(); - if (obj && obj->mDrawable && obj->isSelected()) - { // focus on selected media object - S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace(); - if (obj && obj->mDrawable) - { - LLFace* face = obj->mDrawable->getFace(face_idx); - if (face) + LLViewerObject* obj = LLViewerMediaFocus::getInstance()->getFocusedObject(); + if (obj && obj->mDrawable && obj->isSelected()) + { // focus on selected media object + S32 face_idx = LLViewerMediaFocus::getInstance()->getFocusedFace(); + if (obj && obj->mDrawable) { - focus_point = face->getPositionAgent(); + LLFace* face = obj->mDrawable->getFace(face_idx); + if (face) + { + focus_point = face->getPositionAgent(); + } } } - } - if (focus_point.isExactlyZero()) - { - if (LLViewerJoystick::getInstance()->getOverrideCamera()) - { // focus on point under cursor - focus_point.set(gDebugRaycastIntersection.getF32ptr()); - } - else if (gAgentCamera.cameraMouselook()) - { // focus on point under mouselook crosshairs - LLVector4a result; - result.clear(); + if (focus_point.isExactlyZero()) + { + if (LLViewerJoystick::getInstance()->getOverrideCamera()) + { // focus on point under cursor + focus_point.set(gDebugRaycastIntersection.getF32ptr()); + } + else if (gAgentCamera.cameraMouselook()) + { // focus on point under mouselook crosshairs + LLVector4a result; + result.clear(); - gViewerWindow->cursorIntersect(-1, -1, 512.f, nullptr, -1, false, false, true, true, nullptr, nullptr, nullptr, &result); + gViewerWindow->cursorIntersect(-1, -1, 512.f, nullptr, -1, false, false, true, true, nullptr, nullptr, nullptr, &result); - focus_point.set(result.getF32ptr()); - } - else - { - // focus on alt-zoom target - LLViewerRegion* region = gAgent.getRegion(); - if (region) + focus_point.set(result.getF32ptr()); + } + else { - focus_point = LLVector3(gAgentCamera.getFocusGlobal() - region->getOriginGlobal()); + // focus on alt-zoom target + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + focus_point = LLVector3(gAgentCamera.getFocusGlobal() - region->getOriginGlobal()); + } } } - } - LLVector3 eye = LLViewerCamera::getInstance()->getOrigin(); - F32 target_distance = 16.f; - if (!focus_point.isExactlyZero()) - { - target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point - eye); - } + LLVector3 eye = LLViewerCamera::getInstance()->getOrigin(); + F32 target_distance = 16.f; + if (!focus_point.isExactlyZero()) + { + target_distance = LLViewerCamera::getInstance()->getAtAxis() * (focus_point - eye); + } - if (transition_time >= 1.f && fabsf(current_distance - target_distance) / current_distance > 0.01f) - { // large shift happened, interpolate smoothly to new target distance - transition_time = 0.f; - start_distance = current_distance; - } - else if (transition_time < 1.f) - { // currently in a transition, continue interpolating - transition_time += 1.f / CameraFocusTransitionTime * gFrameIntervalSeconds.value(); - transition_time = llmin(transition_time, 1.f); + if (transition_time >= 1.f && fabsf(current_distance - target_distance) / current_distance > 0.01f) + { // large shift happened, interpolate smoothly to new target distance + transition_time = 0.f; + start_distance = current_distance; + } + else if (transition_time < 1.f) + { // currently in a transition, continue interpolating + transition_time += 1.f / CameraFocusTransitionTime * gFrameIntervalSeconds.value(); + transition_time = llmin(transition_time, 1.f); - F32 t = cosf(transition_time * F_PI + F_PI) * 0.5f + 0.5f; - current_distance = start_distance + (target_distance - start_distance) * t; - } - else - { // small or no change, just snap to target distance - current_distance = target_distance; - } + F32 t = cosf(transition_time * F_PI + F_PI) * 0.5f + 0.5f; + current_distance = start_distance + (target_distance - start_distance) * t; + } + else + { // small or no change, just snap to target distance + current_distance = target_distance; + } - // convert to mm - F32 subject_distance = current_distance * 1000.f; - F32 fnumber = CameraFNumber; - F32 default_focal_length = CameraFocalLength; + // convert to mm + F32 subject_distance = current_distance * 1000.f; + F32 fnumber = CameraFNumber; + F32 default_focal_length = CameraFocalLength; - F32 fov = LLViewerCamera::getInstance()->getView(); + F32 fov = LLViewerCamera::getInstance()->getView(); - const F32 default_fov = CameraFieldOfView * F_PI / 180.f; + const F32 default_fov = CameraFieldOfView * F_PI / 180.f; - // F32 aspect_ratio = (F32) mRT->screen.getWidth()/(F32)mRT->screen.getHeight(); + // F32 aspect_ratio = (F32) mRT->screen.getWidth()/(F32)mRT->screen.getHeight(); - F32 dv = 2.f * default_focal_length * tanf(default_fov / 2.f); + F32 dv = 2.f * default_focal_length * tanf(default_fov / 2.f); - F32 focal_length = dv / (2 * tanf(fov / 2.f)); + F32 focal_length = dv / (2 * tanf(fov / 2.f)); - // F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle); + // F32 tan_pixel_angle = tanf(LLDrawable::sCurPixelAngle); - // from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f)) - // where N = fnumber - // s2 = dot distance - // s1 = subject distance - // f = focal length - // + // from wikipedia -- c = |s2-s1|/s2 * f^2/(N(S1-f)) + // where N = fnumber + // s2 = dot distance + // s1 = subject distance + // f = focal length + // - F32 blur_constant = focal_length * focal_length / (fnumber * (subject_distance - focal_length)); - blur_constant /= 1000.f; // convert to meters for shader - F32 magnification = focal_length / (subject_distance - focal_length); + F32 blur_constant = focal_length * focal_length / (fnumber * (subject_distance - focal_length)); + blur_constant /= 1000.f; // convert to meters for shader + F32 magnification = focal_length / (subject_distance - focal_length); - { // build diffuse+bloom+CoF - mRT->deferredLight.bindTarget("renderDOF", 1); + { // build diffuse+bloom+CoF + mRT->deferredLight.bindTarget("renderDOF", 1); - gDeferredCoFProgram.bind(); + gDeferredCoFProgram.bind(); - gDeferredCoFProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, LLTexUnit::TFO_POINT); - gDeferredCoFProgram.bindTexture(LLShaderMgr::DEFERRED_DEPTH, &mRT->deferredScreen, true); + gDeferredCoFProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, LLTexUnit::TFO_POINT); + gDeferredCoFProgram.bindTexture(LLShaderMgr::DEFERRED_DEPTH, &mRT->deferredScreen, true); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); - gDeferredCoFProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance / 1000.f); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle)); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); - gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); + gDeferredCoFProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance / 1000.f); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle)); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAGNIFICATION, magnification); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); - renderTriangle(); + renderTriangle(); - gDeferredCoFProgram.unbind(); - mRT->deferredLight.flush(); - } + gDeferredCoFProgram.unbind(); + mRT->deferredLight.flush(); + } - U32 dof_width = (U32)(mRT->screen.getWidth() * CameraDoFResScale); - U32 dof_height = (U32)(mRT->screen.getHeight() * CameraDoFResScale); + U32 dof_width = (U32)(mRT->screen.getWidth() * CameraDoFResScale); + U32 dof_height = (U32)(mRT->screen.getHeight() * CameraDoFResScale); - { // perform DoF sampling at half-res (preserve alpha channel) - src->bindTarget("DoF sampling", 1); - glViewport(0, 0, dof_width, dof_height); + { // perform DoF sampling at half-res (preserve alpha channel) + src->bindTarget("DoF sampling", 1); + glViewport(0, 0, dof_width, dof_height); - gGL.setColorMask(true, false); + gGL.setColorMask(true, false); - gDeferredPostProgram.bind(); - gDeferredPostProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, &mRT->deferredLight, LLTexUnit::TFO_POINT); + gDeferredPostProgram.bind(); + gDeferredPostProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, &mRT->deferredLight, LLTexUnit::TFO_POINT); - gDeferredPostProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); - gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); - gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + gDeferredPostProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); + gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); - renderTriangle(); + renderTriangle(); - gDeferredPostProgram.unbind(); + gDeferredPostProgram.unbind(); - src->flush(); - gGL.setColorMask(true, true); - } + src->flush(); + gGL.setColorMask(true, true); + } - { // combine result based on alpha + { // combine result based on alpha - dst->bindTarget("DoF combine", 1); - glViewport(0, 0, dst->getWidth(), dst->getHeight()); + dst->bindTarget("DoF combine", 1); + glViewport(0, 0, dst->getWidth(), dst->getHeight()); - gDeferredDoFCombineProgram.bind(); - gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, LLTexUnit::TFO_POINT); - gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_LIGHT, &mRT->deferredLight, LLTexUnit::TFO_POINT); + gDeferredDoFCombineProgram.bind(); + gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, LLTexUnit::TFO_POINT); + gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_LIGHT, &mRT->deferredLight, LLTexUnit::TFO_POINT); - gDeferredDoFCombineProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); - gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); - gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); - gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_WIDTH, (dof_width - 1) / (F32)src->getWidth()); - gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_HEIGHT, (dof_height - 1) / (F32)src->getHeight()); + gDeferredDoFCombineProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); + gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); + gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); + gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_WIDTH, (dof_width - 1) / (F32)src->getWidth()); + gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_HEIGHT, (dof_height - 1) / (F32)src->getHeight()); - renderTriangle(); + renderTriangle(); - gDeferredDoFCombineProgram.unbind(); - dst->flush(); + gDeferredDoFCombineProgram.unbind(); + dst->flush(); + } } } @@ -8372,8 +8379,8 @@ void LLPipeline::renderFinalize() /*if (LLRenderTarget::sUseFBO && !gCubeSnapshot) { // copy depth buffer from mRT->screen to framebuffer LLRenderTarget::copyContentsToFramebuffer(mRT->screen, 0, 0, mRT->screen.getWidth(), mRT->screen.getHeight(), 0, 0, - mRT->screen.getWidth(), mRT->screen.getHeight(), - GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); + mRT->screen.getWidth(), mRT->screen.getHeight(), + GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); }*/ LLVertexBuffer::unbind(); @@ -8579,8 +8586,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ F32* m = gGLModelView; F32 mat[] = { m[0], m[1], m[2], - m[4], m[5], m[6], - m[8], m[9], m[10] }; + m[4], m[5], m[6], + m[8], m[9], m[10] }; shader.uniformMatrix3fv(LLShaderMgr::DEFERRED_ENV_MAT, 1, true, mat); } @@ -8774,8 +8781,8 @@ void LLPipeline::renderDeferredLighting() glClearColor(0, 0, 0, 0); sun_shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, - (GLfloat)deferred_light_target->getWidth(), - (GLfloat)deferred_light_target->getHeight()); + (GLfloat)deferred_light_target->getWidth(), + (GLfloat)deferred_light_target->getHeight()); { LLGLDisable blend(GL_BLEND); @@ -8854,8 +8861,7 @@ void LLPipeline::renderDeferredLighting() screen_target->clear(GL_COLOR_BUFFER_BIT); if (RenderDeferredAtmospheric) - { - // apply sunlight contribution + { // apply sunlight contribution LLGLSLShader &soften_shader = gDeferredSoftenProgram; LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("renderDeferredLighting - atmospherics"); @@ -9152,35 +9158,35 @@ void LLPipeline::renderDeferredLighting() pushRenderTypeMask(); andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, - LLPipeline::RENDER_TYPE_ALPHA_PRE_WATER, - LLPipeline::RENDER_TYPE_ALPHA_POST_WATER, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_GLOW, - LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_GLTF_PBR, - LLPipeline::RENDER_TYPE_PASS_SIMPLE, - LLPipeline::RENDER_TYPE_PASS_ALPHA, - LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_BUMP, - LLPipeline::RENDER_TYPE_PASS_POST_BUMP, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, - LLPipeline::RENDER_TYPE_PASS_GLOW, - LLPipeline::RENDER_TYPE_PASS_GLTF_GLOW, - LLPipeline::RENDER_TYPE_PASS_GRASS, - LLPipeline::RENDER_TYPE_PASS_SHINY, - LLPipeline::RENDER_TYPE_PASS_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, - LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_CONTROL_AV, - LLPipeline::RENDER_TYPE_ALPHA_MASK, - LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, - LLPipeline::RENDER_TYPE_TERRAIN, - LLPipeline::RENDER_TYPE_WATER, - LLPipeline::RENDER_TYPE_WATEREXCLUSION, - END_RENDER_TYPES); + LLPipeline::RENDER_TYPE_ALPHA_PRE_WATER, + LLPipeline::RENDER_TYPE_ALPHA_POST_WATER, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_GLOW, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_GLTF_PBR, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_POST_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_GLOW, + LLPipeline::RENDER_TYPE_PASS_GLTF_GLOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_CONTROL_AV, + LLPipeline::RENDER_TYPE_ALPHA_MASK, + LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_WATEREXCLUSION, + END_RENDER_TYPES); renderGeomPostDeferred(*LLViewerCamera::getInstance()); popRenderTypeMask(); @@ -9288,7 +9294,6 @@ void LLPipeline::doWaterHaze() LLRenderTarget& dst = gPipeline.mWaterDis; mRT->screen.flush(); - dst.bindTarget("water haze copy depth", 1); gCopyDepthProgram.bind(); @@ -9347,6 +9352,7 @@ void LLPipeline::doWaterHaze() unbindDeferredShader(haze_shader); + gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -9589,7 +9595,6 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader) S32 channel = shader.enableTexture(LLShaderMgr::REFLECTION_PROBES, LLTexUnit::TT_CUBE_MAP_ARRAY); bool bound = false; - if (channel > -1 && mReflectionMapManager.mTexture.notNull()) { mReflectionMapManager.mTexture->bind(channel); @@ -9627,32 +9632,34 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader) //{ //LL_WARNS() << "binding SSR to reflection maps" << LL_ENDL; - channel = shader.enableTexture(LLShaderMgr::SCENE_MAP); - if (channel > -1) - { - gGL.getTexUnit(channel)->bind(&mSceneMap); - } + channel = shader.enableTexture(LLShaderMgr::SCENE_MAP); + if (channel > -1) + { + gGL.getTexUnit(channel)->bind(&mSceneMap); + } - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ITR_COUNT, (GLfloat)RenderScreenSpaceReflectionIterations); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_DIST_BIAS, RenderScreenSpaceReflectionDistanceBias); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_RAY_STEP, RenderScreenSpaceReflectionRayStep); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_GLOSSY_SAMPLES, (GLfloat)RenderScreenSpaceReflectionGlossySamples); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_REJECT_BIAS, RenderScreenSpaceReflectionDepthRejectBias); - mPoissonOffset++; - if (mPoissonOffset > 128 - RenderScreenSpaceReflectionGlossySamples) - mPoissonOffset = 0; + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ITR_COUNT, (GLfloat)RenderScreenSpaceReflectionIterations); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_DIST_BIAS, RenderScreenSpaceReflectionDistanceBias); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_RAY_STEP, RenderScreenSpaceReflectionRayStep); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_GLOSSY_SAMPLES, (GLfloat)RenderScreenSpaceReflectionGlossySamples); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_REJECT_BIAS, RenderScreenSpaceReflectionDepthRejectBias); + mPoissonOffset++; - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_NOISE_SINE, (GLfloat)mPoissonOffset); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ADAPTIVE_STEP_MULT, RenderScreenSpaceReflectionAdaptiveStepMultiplier); + if (mPoissonOffset > 128 - RenderScreenSpaceReflectionGlossySamples) + mPoissonOffset = 0; - channel = shader.enableTexture(LLShaderMgr::SCENE_DEPTH); - if (channel > -1) - { - gGL.getTexUnit(channel)->bind(&mSceneMap, true); - } + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_NOISE_SINE, (GLfloat)mPoissonOffset); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ADAPTIVE_STEP_MULT, RenderScreenSpaceReflectionAdaptiveStepMultiplier); + + channel = shader.enableTexture(LLShaderMgr::SCENE_DEPTH); + if (channel > -1) + { + gGL.getTexUnit(channel)->bind(&mSceneMap, true); + } //} + LOG_GLERROR("bindReflectionProbes() end"); } @@ -9794,6 +9801,7 @@ void LLPipeline::renderShadow(const glm::mat4& view, const glm::mat4& proj, LLCa } }; + LLVertexBuffer::unbind(); for (int j = 0; j < 2; ++j) // 0 -- static, 1 -- rigged { @@ -11109,12 +11117,12 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar, bool // previews can't be muted or impostered bool visually_muted = !for_profile && !preview_avatar && avatar->isVisuallyMuted(); LL_DEBUGS_ONCE("AvatarRenderPipeline") << "Avatar " << avatar->getID() - << " is " << ( visually_muted ? "" : "not ") << "visually muted" - << LL_ENDL; + << " is " << ( visually_muted ? "" : "not ") << "visually muted" + << LL_ENDL; bool too_complex = !for_profile && !preview_avatar && avatar->isTooComplex(); LL_DEBUGS_ONCE("AvatarRenderPipeline") << "Avatar " << avatar->getID() - << " is " << ( too_complex ? "" : "not ") << "too complex" - << LL_ENDL; + << " is " << ( too_complex ? "" : "not ") << "too complex" + << LL_ENDL; pushRenderTypeMask(); @@ -11144,7 +11152,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar, bool RENDER_TYPE_CLOUDS, RENDER_TYPE_HUD_PARTICLES, END_RENDER_TYPES - ); + ); } if (specific_attachment && specific_attachment->isHUDAttachment()) @@ -11736,7 +11744,7 @@ void LLPipeline::hideDrawable( LLDrawable *pDrawable ) //hide the children LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++ ) + iter != child_list.end(); iter++ ) { LLViewerObject* child = *iter; LLDrawable* drawable = child->mDrawable; @@ -11754,7 +11762,7 @@ void LLPipeline::unhideDrawable( LLDrawable *pDrawable ) //restore children LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + iter != child_list.end(); iter++) { LLViewerObject* child = *iter; LLDrawable* drawable = child->mDrawable; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 0145a9c397..4bba462f78 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -233,12 +233,12 @@ public: 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 + 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. @@ -847,8 +847,8 @@ protected: { Light(LLDrawable* ptr, F32 d, F32 f = 0.0f) : drawable(ptr), - dist(d), - fade(f) + dist(d), + fade(f) {} LLPointer<LLDrawable> drawable; F32 dist; diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 4e7ce2c32f..0d22d37085 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -103,8 +103,8 @@ gwigz (nya) EmilyAmiee Bavid Dailey Aria (Tashia Redrose) Cate (32a) Hiroo Ono Melodey Keysin (scoutkeysin) -Yikes Lopez Padoria -~ ( ^-^ ) ~ (cutie_qu) +Yikes Lopez Padoria Teuden +~ ( ^-^ ) ~ (cutie_qu) Markus Teuden </text_editor> <text follows="top|left" @@ -135,6 +135,7 @@ Vir Linden - Making it possible for the project to have a place in SL nutsobvious - Early testing and video proof Soft Linden - Security testing Kyle Linden - Giving TPV parcel 2 to Erik Kundiman +Signal Linden - Opening opportunities for Megapahit to contribute more </text_editor> </panel> </accordion_tab> diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index a96a4f2b75..97ff1fd5a2 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -1,201 +1,184 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater -legacy_header_height="18" -positioning="centered" -default_tab_group="1" -height="530" -layout="topleft" -name="Preferences" -help_topic="preferences" -save_rect="true" -single_instance="true" -title="PREFERENCES" -width="658"> - -<button -follows="right|bottom" -height="23" -label="OK" -label_selected="OK" -layout="topleft" -right="-105" -name="OK" -top="492" -width="90"> - <button.commit_callback - function="Pref.OK" /> -</button> - -<button -follows="right|bottom" -height="23" -label="Cancel" -label_selected="Cancel" -layout="topleft" -left_pad="5" -name="Cancel" -right="-10" -width="90" > - <button.commit_callback - function="Pref.Cancel" /> -</button> - -<panel -name="search_panel" -layout="topleft" -follows="left|top|right" -left="4" -right="-4" -top="21" -height="18" -tab_group="2"> - - <search_editor - clear_button_visible="true" - follows="left|top|right" - height="18" - label="Search Settings" - layout="topleft" - left="0" - max_length_bytes="255" - name="search_prefs_edit" - right="-1" - text_pad_left="6" - tool_tip="Type the search term you are interested in here. Results will be displayed for partial fulltext matches within the setting's name or comment." - top="0"> - - <search_editor.commit_callback - function="UpdateFilter" /> - - <search_editor.clear_button - rect.height="18" - rect.width="18" - rect.bottom="-1" /> - - <search_editor.search_button - rect.height="12" - rect.width="12" - rect.bottom="-1" /> - </search_editor> -</panel> - -<tab_container -follows="all" -halign="left" -height="440" -layout="topleft" -left="0" -name="pref core" -tab_group="1" -tab_position="left" -tab_width="140" -tab_padding_right="0" -top="40" -width="658"> - - <panel - class="panel_preference" - filename="panel_preferences_general.xml" - label="General" - layout="topleft" - help_topic="preferences_general_tab" - name="general" /> - - <panel - class="panel_preference_graphics" - filename="panel_preferences_graphics1.xml" - label="Graphics" - layout="topleft" - help_topic="preferences_display_tab" - name="display" /> - - <panel - class="panel_preference_graphics3" - filename="panel_preferences_graphics3.xml" - label="Visual Effects" - layout="topleft" - help_topic="preferences_display_tab" - name="display3" /> - - <panel - class="panel_preference" - filename="panel_preferences_sound.xml" - label="Sound & Media" - layout="topleft" - help_topic="preferences_audio_tab" - name="audio" /> - - <panel - class="panel_preference" - filename="panel_preferences_chat.xml" - label="Chat" - layout="topleft" - help_topic="preferences_chat_tab" - name="chat" /> - - <panel - class="panel_preference" - filename="panel_preferences_move.xml" - label="Move & View" - layout="topleft" - help_topic="preferences_move_tab" - name="move" /> - - <panel - class="panel_preference" - filename="panel_preferences_alerts.xml" - label="Notifications" - layout="topleft" - help_topic="preferences_msgs_tab" - name="msgs" /> - - <panel - class="panel_preference" - filename="panel_preferences_colors.xml" - label="Colors" - layout="topleft" - help_topic="preferences_colors_tab" - name="colors" /> - - <panel - class="panel_preference_privacy" - filename="panel_preferences_privacy.xml" - label="Privacy" - layout="topleft" - help_topic="preferences_im_tab" - name="im" /> - - <panel - class="panel_preference" - filename="panel_preferences_setup.xml" - label="Setup" - layout="topleft" - help_topic="preferences_input_tab" - name="input" /> - - <panel - class="panel_preference" - filename="panel_preferences_advanced.xml" - label="Advanced" - layout="topleft" - help_topic="preferences_advanced1_tab" - name="advanced1" /> - - <panel - class="panel_preference" - filename="panel_preferences_uploads.xml" - label="Uploads" - layout="topleft" - help_topic="preferences_uploads_tab" - name="uploads" /> - - <panel - class="panel_preference_controls" - filename="panel_preferences_controls.xml" - label="Controls" - layout="topleft" - help_topic="preferences_controls_tab" - name="controls" /> -</tab_container> + legacy_header_height="18" + positioning="centered" + default_tab_group="1" + height="530" + layout="topleft" + name="Preferences" + help_topic="preferences" + save_rect="true" + single_instance="true" + title="PREFERENCES" + width="658"> + <button + follows="right|bottom" + height="23" + label="OK" + label_selected="OK" + layout="topleft" + right="-105" + name="OK" + top="492" + width="90"> + <button.commit_callback + function="Pref.OK" /> + </button> + <button + follows="right|bottom" + height="23" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="5" + name="Cancel" + right="-10" + width="90" > + <button.commit_callback + function="Pref.Cancel" /> + </button> + + <panel + name="search_panel" + layout="topleft" + follows="left|top|right" + left="4" + right="-4" + top="21" + height="18" + tab_group="2"> + <search_editor + clear_button_visible="true" + follows="left|top|right" + height="18" + label="Search Settings" + layout="topleft" + left="0" + max_length_bytes="255" + name="search_prefs_edit" + right="-1" + text_pad_left="6" + tool_tip="Type the search term you are interested in here. Results will be displayed for partial fulltext matches within the setting's name or comment." + top="0"> + <search_editor.commit_callback + function="UpdateFilter" /> + <search_editor.clear_button + rect.height="18" + rect.width="18" + rect.bottom="-1" /> + <search_editor.search_button + rect.height="12" + rect.width="12" + rect.bottom="-1" /> + </search_editor> + </panel> + + <tab_container + follows="all" + halign="left" + height="440" + layout="topleft" + left="0" + name="pref core" + tab_group="1" + tab_position="left" + tab_width="140" + tab_padding_right="0" + top="40" + width="658"> + <panel + class="panel_preference" + filename="panel_preferences_general.xml" + label="General" + layout="topleft" + help_topic="preferences_general_tab" + name="general" /> + <panel + class="panel_preference_graphics" + filename="panel_preferences_graphics1.xml" + label="Graphics" + layout="topleft" + help_topic="preferences_display_tab" + name="display" /> + + <panel + class="panel_preference_graphics3" + filename="panel_preferences_graphics3.xml" + label="Visual Effects" + layout="topleft" + help_topic="preferences_display_tab" + name="display3" /> + + <panel + class="panel_preference" + filename="panel_preferences_sound.xml" + label="Sound & Media" + layout="topleft" + help_topic="preferences_audio_tab" + name="audio" /> + <panel + class="panel_preference" + filename="panel_preferences_chat.xml" + label="Chat" + layout="topleft" + help_topic="preferences_chat_tab" + name="chat" /> + <panel + class="panel_preference" + filename="panel_preferences_move.xml" + label="Move & View" + layout="topleft" + help_topic="preferences_move_tab" + name="move" /> + <panel + class="panel_preference" + filename="panel_preferences_alerts.xml" + label="Notifications" + layout="topleft" + help_topic="preferences_msgs_tab" + name="msgs" /> + <panel + class="panel_preference" + filename="panel_preferences_colors.xml" + label="Colors" + layout="topleft" + help_topic="preferences_colors_tab" + name="colors" /> + <panel + class="panel_preference_privacy" + filename="panel_preferences_privacy.xml" + label="Privacy" + layout="topleft" + help_topic="preferences_im_tab" + name="im" /> + <panel + class="panel_preference" + filename="panel_preferences_setup.xml" + label="Setup" + layout="topleft" + help_topic="preferences_input_tab" + name="input" /> + <panel + class="panel_preference" + filename="panel_preferences_advanced.xml" + label="Advanced" + layout="topleft" + help_topic="preferences_advanced1_tab" + name="advanced1" /> + <panel + class="panel_preference" + filename="panel_preferences_uploads.xml" + label="Uploads" + layout="topleft" + help_topic="preferences_uploads_tab" + name="uploads" /> + <panel + class="panel_preference_controls" + filename="panel_preferences_controls.xml" + label="Controls" + layout="topleft" + help_topic="preferences_controls_tab" + name="controls" /> + </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index ddb2833b5d..8acf870c9d 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -52,7 +52,7 @@ left_delta="330" width="20"> m - </text> + </text> <slider control_name="RenderMaxPartCount" decimal_digits="0" @@ -626,9 +626,9 @@ layout="topleft" left="385" name="vert_border" - top="16" + top="16" width="0"/> - + <text type="string" length="1" @@ -732,7 +732,7 @@ <check_box.commit_callback function="Pref.RenderOptionUpdate" /> </check_box> - + <text type="string" length="1" @@ -751,7 +751,7 @@ height="18" layout="topleft" left_delta="130" - top_delta="0" + top_delta="0" name="ShadowDetail" width="150"> <combo_box.item @@ -785,7 +785,7 @@ <check_box.commit_callback function="Pref.RenderOptionUpdate" /> </check_box> - + <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml index 8d4e8dc8e8..ece9bb2552 100644 --- a/indra/newview/skins/default/xui/en/panel_performance_preferences.xml +++ b/indra/newview/skins/default/xui/en/panel_performance_preferences.xml @@ -420,7 +420,6 @@ width="180"> (Enter value between 0.0 and 4.0) </text> - <text follows="left|top" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index c38af9d4fa..8248da9fda 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -213,7 +213,6 @@ layout="topleft" left="30" name="stream_notification_channel_enabled" - top_pad="10" width="256"> </check_box> <spinner @@ -233,6 +232,15 @@ name="stream_notification_channel" top_pad="-15" width="170" /> + <check_box + control_name="SnapshotTimestamp" + height="16" + label="Add timestamp to snapshot file names" + layout="topleft" + left="30" + name="snapshot_timestamp" + width="256"> + </check_box> <check_box control_name="AllowMultipleViewers" @@ -242,7 +250,7 @@ layout="topleft" left="30" name="allow_multiple_viewer_check" - top_pad="20" + top_pad="15" width="237"/> <check_box control_name="ForceShowGrid" diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml index ae203d68de..fb88b752ae 100644 --- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml @@ -28,9 +28,9 @@ top_delta="2"> Disk </text> - <view_border + <view_border bevel_style="in" - follows="left|top|right" + follows="left|top|right" height="1" left="9" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 3bf402b7fd..dbdec5b5ef 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -1,209 +1,209 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel -background_opaque="true" -background_visible="true" -bg_opaque_color="DkGray" -chrome="true" -follows="top|right" -height="19" -layout="topleft" -left="0" -mouse_opaque="false" -name="status" -top="19" -width="1000"> - <panel.string - name="packet_loss_tooltip"> - Packet Loss - </panel.string> - <panel.string - name="bandwidth_tooltip"> - Bandwidth - </panel.string> - <panel.string - name="time"> - [hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt] - </panel.string> - <panel.string - name="timeTooltip"> - [weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt] - </panel.string> -<panel.string - name="buycurrencylabel"> - L$ [AMT] - </panel.string> -<panel - height="18" - left="-398" - top="0" - width="120" - follows="right|top" - name="menu_search_panel" - background_opaque="true" - background_visible="true" - bg_opaque_color="MouseGray"> - <search_editor - clear_button_visible="true" - follows="left|top" - height="18" - label="Search Menus" - layout="topleft" - left="0" - max_length_bytes="255" - name="search_menu_edit" - right="-1" - text_pad_left="6" - tool_tip="Type the search term you are interested in here. Results will be displayed for partial fulltext matches within the menu." - top="0"> - <search_button - top_pad="4" - left_pad="4" - width="12" - height="12" - image_unselected="Search" - image_selected="Search"/> - <clear_button - bottom="2" - height="12" - image_unselected="Icon_Close_Foreground" - image_selected="Icon_Close_Press" - pad_right="4" - pad_left="4" - width="12"/> - </search_editor> -</panel> -<panel - height="18" - left="-398" - width="185" - top="1" - follows="right|top" - name="balance_bg"> - <text - halign="center" - font="SansSerifSmall" - follows="all" - height="18" - left="0" - name="balance" - tool_tip="Click to refresh your L$ balance" - v_pad="4" - top="0" - wrap="false" - value="L$??" - width="40" /> - <button - halign="center" - font="SansSerifSmall" - follows="right|top|bottom" - image_hover_unselected="PushButton_Over" - image_unselected="PushButton_Off" - image_pressed="PushButton_Press" - height="18" - label="Buy L$" - label_color="White" - left_pad="0" - label_shadow="true" - name="buyL" - pad_right="0" - tool_tip="Click to buy more L$" - top="0" - width="80" /> - <button - halign="left" - font="SansSerifSmall" - follows="right|top|bottom" - imgoverlay_label_space="7" - image_overlay="Command_MiniCart_Icon" - image_overlay_alignment="left" - image_hover_unselected="PushButton_Over" - image_unselected="PushButton_Off" - image_pressed="PushButton_Press" - height="18" - label="Shop" - label_color="White" - left_pad="0" - label_shadow="true" - name="goShop" - tool_tip="Open Second Life Marketplace" - top="0" - width="65" /> -</panel> - <text - type="string" - font="SansSerifSmall" - text_readonly_color="TimeTextColor" - follows="right|top" - halign="right" - height="16" - top="5" - layout="topleft" - left_pad="0" - name="TimeText" - tool_tip="Current time (Pacific)" - width="85"> - 24:00 AM PST - </text> - <icon - follows="right|top" - height="16" - image_name="Cam_FreeCam_Off" - left_pad="8" - top="2" - name="presets_icon_camera" - width="18" /> - <icon - follows="right|top" - height="13" - image_name="Presets_Icon" - left_pad="8" - top="4" - name="presets_icon_graphic" - width="16" /> - <button - follows="right|top" - height="16" - image_selected="Play_Off" - image_unselected="Pause_Off" - image_pressed="Pause_Press" - image_pressed_selected="Play_Press" - is_toggle="true" - left_pad="5" - top="1" - name="media_toggle_btn" - tool_tip="Start/Stop All Media (Music, Video, Web pages)" - width="16" > - </button> - <button - follows="right|top" - height="16" - image_selected="AudioMute_Off" - image_pressed="Audio_Press" - image_unselected="Audio_Off" - is_toggle="true" - left_pad="5" - top="2" - name="volume_btn" - width="16" /> - <button - type="string" - font="SansSerif" - image_unselected="mp_fpsButton" - image_selected="mp_fpsButton" - image_hover_unselected="mp_fpsButton" - image_pressed="mp_fpsButton" - image_pressed_selected="mp_fpsButton" - image_color="White" - label_color="FpsTextColor" - follows="right|top" - halign="center" - valign="center" - height="18" - top="1" - left_pad="2" - name="FpsText" - tool_tip="fps: Color indicates frametime fluctuations (Green is optimal)" - width="32"> - 60 - </button> + background_opaque="true" + background_visible="true" + bg_opaque_color="DkGray" + chrome="true" + follows="top|right" + height="19" + layout="topleft" + left="0" + mouse_opaque="false" + name="status" + top="19" + width="1000"> + <panel.string + name="packet_loss_tooltip"> + Packet Loss + </panel.string> + <panel.string + name="bandwidth_tooltip"> + Bandwidth + </panel.string> + <panel.string + name="time"> + [hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt] + </panel.string> + <panel.string + name="timeTooltip"> + [weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt] + </panel.string> + <panel.string + name="buycurrencylabel"> + L$ [AMT] + </panel.string> + <panel + height="18" + left="-398" + top="0" + width="120" + follows="right|top" + name="menu_search_panel" + background_opaque="true" + background_visible="true" + bg_opaque_color="MouseGray"> + <search_editor + clear_button_visible="true" + follows="left|top" + height="18" + label="Search Menus" + layout="topleft" + left="0" + max_length_bytes="255" + name="search_menu_edit" + right="-1" + text_pad_left="6" + tool_tip="Type the search term you are interested in here. Results will be displayed for partial fulltext matches within the menu." + top="0"> + <search_button + top_pad="4" + left_pad="4" + width="12" + height="12" + image_unselected="Search" + image_selected="Search"/> + <clear_button + bottom="2" + height="12" + image_unselected="Icon_Close_Foreground" + image_selected="Icon_Close_Press" + pad_right="4" + pad_left="4" + width="12"/> + </search_editor> + </panel> + <panel + height="18" + left="-398" + width="185" + top="1" + follows="right|top" + name="balance_bg"> + <text + halign="center" + font="SansSerifSmall" + follows="all" + height="18" + left="0" + name="balance" + tool_tip="Click to refresh your L$ balance" + v_pad="4" + top="0" + wrap="false" + value="L$??" + width="40" /> + <button + halign="center" + font="SansSerifSmall" + follows="right|top|bottom" + image_hover_unselected="PushButton_Over" + image_unselected="PushButton_Off" + image_pressed="PushButton_Press" + height="18" + label="Buy L$" + label_color="White" + left_pad="0" + label_shadow="true" + name="buyL" + pad_right="0" + tool_tip="Click to buy more L$" + top="0" + width="80" /> + <button + halign="left" + font="SansSerifSmall" + follows="right|top|bottom" + imgoverlay_label_space="7" + image_overlay="Command_MiniCart_Icon" + image_overlay_alignment="left" + image_hover_unselected="PushButton_Over" + image_unselected="PushButton_Off" + image_pressed="PushButton_Press" + height="18" + label="Shop" + label_color="White" + left_pad="0" + label_shadow="true" + name="goShop" + tool_tip="Open Second Life Marketplace" + top="0" + width="65" /> + </panel> + <text + type="string" + font="SansSerifSmall" + text_readonly_color="TimeTextColor" + follows="right|top" + halign="right" + height="16" + top="5" + layout="topleft" + left_pad="0" + name="TimeText" + tool_tip="Current time (Pacific)" + width="85"> + 24:00 AM PST + </text> + <icon + follows="right|top" + height="16" + image_name="Cam_FreeCam_Off" + left_pad="8" + top="2" + name="presets_icon_camera" + width="18" /> + <icon + follows="right|top" + height="13" + image_name="Presets_Icon" + left_pad="8" + top="4" + name="presets_icon_graphic" + width="16" /> + <button + follows="right|top" + height="16" + image_selected="Play_Off" + image_unselected="Pause_Off" + image_pressed="Pause_Press" + image_pressed_selected="Play_Press" + is_toggle="true" + left_pad="5" + top="1" + name="media_toggle_btn" + tool_tip="Start/Stop All Media (Music, Video, Web pages)" + width="16" > + </button> + <button + follows="right|top" + height="16" + image_selected="AudioMute_Off" + image_pressed="Audio_Press" + image_unselected="Audio_Off" + is_toggle="true" + left_pad="5" + top="2" + name="volume_btn" + width="16" /> + <button + type="string" + font="SansSerif" + image_unselected="mp_fpsButton" + image_selected="mp_fpsButton" + image_hover_unselected="mp_fpsButton" + image_pressed="mp_fpsButton" + image_pressed_selected="mp_fpsButton" + image_color="White" + label_color="FpsTextColor" + follows="right|top" + halign="center" + valign="center" + height="18" + top="1" + left_pad="2" + name="FpsText" + tool_tip="fps: Color indicates frametime fluctuations (Green is optimal)" + width="32"> + 60 + </button> </panel> |