diff options
author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2024-11-25 20:56:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 20:56:03 -0500 |
commit | d65fb7cec8ce36ce7f6ff082f8d04bdd8bc0208c (patch) | |
tree | 0005e8ec095fb31dcd4f8b079af585e3333c365f /indra/newview/pipeline.cpp | |
parent | 7ef6e8fce763eb529ed160ea4ff11e6125e32ed5 (diff) |
Drop emissive on old Intel GPUs (#3110)
* #3103 Add the ability to disable the emissive buffer for older GPUs with low memory bandwidth.
* #3135 Add a "vintage" mode for slower GPUs
* #2719 Fix for skies being overbrightened
* #2632 Do not apply tonemapping on legacy skies
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6bef6b3438..3b51cbfbb2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -350,17 +350,22 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false) U32 emissive = GL_RGB16F; bool hdr = gSavedSettings.getBOOL("RenderHDREnabled") && gGLManager.mGLVersion > 4.05f; + LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false); if (!hdr) { - norm = GL_RGBA; + norm = GL_RGB10_A2; emissive = GL_RGB; } - bool valid = true - && target.addColorAttachment(orm) // frag-data[1] specular OR PBR ORM - && target.addColorAttachment(norm) // frag_data[2] normal+fogmask, See: class1\deferred\materialF.glsl & softenlight - && target.addColorAttachment(emissive); // frag_data[3] PBR emissive OR material env intensity + bool valid = true; + valid = valid && target.addColorAttachment(orm); // frag-data[1] specular OR PBR ORM + valid = valid && target.addColorAttachment(norm); + if (has_emissive) + { + valid = valid && target.addColorAttachment(emissive); // frag_data[3] PBR emissive OR material env intensity + } + return valid; } @@ -847,7 +852,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) GLuint screenFormat = hdr ? GL_RGBA16F : GL_RGBA; - if (!mRT->screen.allocate(resX, resY, screenFormat)) return false; + if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; mRT->deferredScreen.shareDepthBuffer(mRT->screen); @@ -7059,28 +7064,35 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool static LLStaticHashedString dt("dt"); static LLStaticHashedString noiseVec("noiseVec"); static LLStaticHashedString dynamic_exposure_params("dynamic_exposure_params"); + static LLStaticHashedString dynamic_exposure_params2("dynamic_exposure_params2"); + static LLStaticHashedString dynamic_exposure_e("dynamic_exposure_enabled"); + static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); + static LLCachedControl<bool> dynamic_exposure_enabled(gSavedSettings, "RenderDynamicExposureEnabled", true); static LLCachedControl<F32> dynamic_exposure_coefficient(gSavedSettings, "RenderDynamicExposureCoefficient", 0.175f); - static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl<F32> dynamic_exposure_speed_error(gSavedSettings, "RenderDynamicExposureSpeedError", 0.1f); + static LLCachedControl<F32> dynamic_exposure_speed_target(gSavedSettings, "RenderDynamicExposureSpeedTarget", 2.f); LLSettingsSky::ptr_t sky = LLEnvironment::instance().getCurrentSky(); F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust); - F32 exp_min = 1.f; - F32 exp_max = 1.f; + F32 exp_min = sky->getHDRMin(); + F32 exp_max = sky->getHDRMax(); - if (probe_ambiance > 0.f) + if (dynamic_exposure_enabled) { - F32 hdr_scale = sqrtf(LLEnvironment::instance().getCurrentSky()->getGamma()) * 2.f; - - if (hdr_scale > 1.f) - { - exp_min = 1.f / hdr_scale; - exp_max = hdr_scale; - } + exp_min = sky->getHDROffset() - exp_min; + exp_max = sky->getHDROffset() + exp_max; + } + else + { + exp_min = sky->getHDROffset(); + exp_max = sky->getHDROffset(); } + shader->uniform1f(dt, gFrameIntervalSeconds); shader->uniform2f(noiseVec, ll_frand() * 2.0f - 1.0f, ll_frand() * 2.0f - 1.0f); - shader->uniform3f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max); + shader->uniform4f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max, dynamic_exposure_speed_error); + shader->uniform4f(dynamic_exposure_params2, sky->getHDROffset(), exp_min, exp_max, dynamic_exposure_speed_target); mScreenTriangleVB->setBuffer(); mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3); @@ -7140,7 +7152,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) shader.uniform1i(tonemap_type, tonemap_type_setting); static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f); - shader.uniform1f(tonemap_mix, tonemap_mix_setting); + shader.uniform1f(tonemap_mix, psky->getTonemapMix()); mScreenTriangleVB->setBuffer(); mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3); @@ -8481,6 +8493,7 @@ void LLPipeline::renderDeferredLighting() soften_shader.uniform1f(ssao_max_str, ssao_max); LLEnvironment &environment = LLEnvironment::instance(); + soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0); soften_shader.uniform3fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV); |