diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 51 | ||||
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 4 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl | 12 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 4 | ||||
| -rw-r--r-- | indra/newview/lldynamictexture.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 221 | ||||
| -rw-r--r-- | indra/newview/llreflectionmapmanager.h | 6 | ||||
| -rw-r--r-- | indra/newview/llviewerdisplay.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 45 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_graphics3.xml | 73 | 
11 files changed, 150 insertions, 279 deletions
| diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index e8276e523f..3058a6f289 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -160,8 +160,18 @@ attributedStringInfo getSegments(NSAttributedString *str)  - (void)viewWillMoveToWindow:(nullable NSWindow *)newWindow  { -    if(mHDRDisplay) self.wantsExtendedDynamicRangeOpenGLSurface = YES; -    //else self.wantsExtendedDynamicRangeOpenGLSurface = NO; +    if(mHDRDisplay) +    { +        self.wantsExtendedDynamicRangeOpenGLSurface = YES; +        NSLog(@"Wants Extended Dynamic Range OpenGL", nil); +    } +    /* +    else +    { +        self.wantsExtendedDynamicRangeOpenGLSurface = NO; +        NSLog(@"Wants Standard Color Range OpenGL", nil); +    } +    */  }  - (void)viewDidMoveToWindow @@ -257,27 +267,35 @@ attributedStringInfo getSegments(NSAttributedString *str)  	// Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6.  	// Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat.  	// 10.7 and 10.8 don't really care if we're defining a profile or not.  If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). -    NSOpenGLPixelFormatAttribute SDRAttrs[] = { + +	NSOpenGLPixelFormatAttribute SDRAttrs[] = { +        NSOpenGLPFANoRecovery,  		NSOpenGLPFADoubleBuffer, +		NSOpenGLPFAClosestPolicy, +		NSOpenGLPFAAccelerated,  		NSOpenGLPFASampleBuffers, 0,  		NSOpenGLPFASamples, 0, -		NSOpenGLPFAStencilSize, 8,  		NSOpenGLPFADepthSize, 24, +		NSOpenGLPFAAlphaSize, 8, +		NSOpenGLPFAColorSize, 32,  		NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,  		0      }; -	 -	 + +      NSOpenGLPixelFormatAttribute HDRAttrs[] = { -    NSOpenGLPFADoubleBuffer, -    NSOpenGLPFASampleBuffers, 0, -    NSOpenGLPFASamples, 0, -    NSOpenGLPFAStencilSize, 8, -    NSOpenGLPFAColorFloat, -    NSOpenGLPFAColorSize, 64, -    NSOpenGLPFADepthSize, 24, -    NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core, -    0}; +        NSOpenGLPFANoRecovery, +        NSOpenGLPFADoubleBuffer, +        NSOpenGLPFAClosestPolicy, +        NSOpenGLPFAAccelerated, +        NSOpenGLPFASampleBuffers, 0, +        NSOpenGLPFASamples, 0, +        NSOpenGLPFAColorFloat, +        NSOpenGLPFAColorSize, 64, +        NSOpenGLPFADepthSize, 24, +        NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core, +        0 +    };  	NSOpenGLPixelFormat *pixelFormat = nil; @@ -293,6 +311,7 @@ attributedStringInfo getSegments(NSAttributedString *str)          }          else          { +            NSLog(@"pixel format created successfully for HDR Display", nil);              mHDRDisplay = YES;          }      } @@ -326,6 +345,8 @@ attributedStringInfo getSegments(NSAttributedString *str)          self.window.colorSpace = extended_ns_color_space;          CGColorSpaceRelease(color_space_extended); + +        NSLog(@"Extended color space applied for HDR Display", nil);      }  	//for retina support diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 503f2760a8..d9cf46a4af 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14417,7 +14417,7 @@        <key>Type</key>        <string>F32</string>        <key>Value</key> -      <integer>1.5</integer> +      <integer>1.0</integer>      </map>      <key>MPHDRGamma</key>      <map> @@ -14439,7 +14439,7 @@        <key>Type</key>        <string>F32</string>        <key>Value</key> -      <integer>1.5</integer> +      <integer>1.0</integer>      </map>      <key>MPColorPrecision</key>      <map> diff --git a/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl index d878ab053e..66d86eec1f 100644 --- a/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl @@ -2,7 +2,7 @@ out vec4 frag_color;  uniform sampler2D diffuseMap;  uniform sampler2D bloomExtractORM; // orm -uniform sampler2D bloomExtractEmissive; // emissive +//uniform sampler2D bloomExtractEmissive; // emissive  uniform sampler2D bloomExtractEmissive2; // emissive 2  uniform float bloomExtractBrightness = 0.9; @@ -15,6 +15,12 @@ void main()  {      vec4 col = texture(diffuseMap, vary_texcoord0.xy); +    if(col.a > 0.001) +    { +        discard; +        return; +    } +      //int valid = 0;      //float brightness = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));      float brightness = dot(col.rgb, vec3(0.3, 0.5, 0.2)); @@ -25,14 +31,16 @@ void main()          return;      } +    /*      vec3 emi = texture(bloomExtractEmissive, vary_texcoord0.xy).rgb;      if(emi.r + emi.g + emi.b > 0.01)      {          discard;          return;      } +    */ -    emi = texture(bloomExtractEmissive2, vary_texcoord0.xy).rgb; +    vec3 emi = texture(bloomExtractEmissive2, vary_texcoord0.xy).rgb;      if(emi.r + emi.g + emi.b > 0.01)      {          discard; diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 42cc333829..83fe1c505f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -27,12 +27,10 @@ out vec4 frag_color;  uniform sampler2D diffuseMap; -uniform float mpHDRBoost = 1.0; -  in vec2 vary_texcoord0;  in vec4 vertex_color;  void main()  { -    frag_color = mpHDRBoost * vertex_color*texture(diffuseMap, vary_texcoord0.xy); +    frag_color = vertex_color*texture(diffuseMap, vary_texcoord0.xy);  } diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 33325e352f..984f8ee25e 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -204,7 +204,7 @@ bool LLViewerDynamicTexture::updateAllInstances()      llassert(bake_target.getHeight() >= (U32) LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT);      preview_target.bindTarget(); -    preview_target.clear(); +    //preview_target.clear();      LLGLSLShader::unbind();      LLVertexBuffer::unbind(); @@ -249,7 +249,7 @@ bool LLViewerDynamicTexture::updateAllInstances()      // ORDER_LAST is baked skin preview, ORDER_RESET resets appearance parameters and does not render.      bake_target.bindTarget(); -    bake_target.clear(); +    //bake_target.clear();      result = false;      ret = false; diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 2ddb749141..5b63f96e1e 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -223,12 +223,11 @@ void LLReflectionMapManager::update()          resume();      } -    static LLCachedControl<S32> sDetail(gSavedSettings, "RenderReflectionProbeDetail", -1); -    static LLCachedControl<S32> sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3); -    static LLCachedControl<U32> sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 256U); -    static LLCachedControl<S32> sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1); - -    static LLCachedControl<F32> sProbeUpdateSlowDown(gSavedSettings, "MPRenderProbeSlowDown", 0.f); +    S32 sDetail = gSavedSettings.getS32("RenderReflectionProbeDetail"); +    S32 sLevel = gSavedSettings.getS32("RenderReflectionProbeLevel"); +    U32 sReflectionProbeCount = gSavedSettings.getU32("RenderReflectionProbeCount"); +    S32 sProbeDynamicAllocation = gSavedSettings.getS32("RenderReflectionProbeDynamicAllocation"); +    F32 sProbeUpdateSlowDown = gSavedSettings.getF32("MPRenderProbeSlowDown");      bool realtime = sDetail >= (S32)LLReflectionMapManager::DetailLevel::REALTIME; @@ -293,11 +292,12 @@ void LLReflectionMapManager::update()      initReflectionMaps(); -    static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true); +    bool render_hdr = gSavedSettings.getBOOL("RenderHDREnabled");      U32 color_fmt = render_hdr ? GL_R11F_G11F_B10F : GL_RGB8; -    static LLCachedControl<U32> MPColorPrecision(gSavedSettings, "MPColorPrecision", 0); +    U32 MPColorPrecision = gSavedSettings.getU32("MPColorPrecision"); +      if(MPColorPrecision == 1)      {          color_fmt = GL_RGB8; @@ -413,8 +413,8 @@ void LLReflectionMapManager::update()      mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f); -    static LLCachedControl<F32> sDefaultUpdatePeriod(gSavedSettings, "RenderDefaultProbeUpdatePeriod", 2.f); -    static LLCachedControl<F32> sMPUpdatePeriod(gSavedSettings, "MPRenderProbeUpdatePeriod", 2.f); +    F32 sDefaultUpdatePeriod = gSavedSettings.getF32("RenderDefaultProbeUpdatePeriod"); +    //F32 sMPUpdatePeriod = gSavedSettings.getF32("MPRenderProbeUpdatePeriod");      for (unsigned int i = 0; i < mProbes.size(); ++i)      { @@ -561,16 +561,7 @@ void LLReflectionMapManager::update()          sUpdateCount++;          mUpdatingProbe = probe; -            if(probe->mCompletedCount < 2) -            { -                probe->mNextUpdateTime = gFrameTimeSeconds + fmax( ((F32)sMPUpdatePeriod / 2.0), 0.25); -            } -            else -            { -                probe->mNextUpdateTime = gFrameTimeSeconds + fmax( (F32)sMPUpdatePeriod, 0.25); -            } - -        doProbeUpdate(); +            doProbeUpdate();          }      } @@ -779,26 +770,14 @@ void LLReflectionMapManager::doProbeUpdate()      LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;      llassert(mUpdatingProbe != nullptr); -    static LLCachedControl<bool> mp_progressive(gSavedSettings, "MPRenderProbeProgressive", false); -      if(mUpdatingFace < 6)      { -        updateProbeFace(mUpdatingProbe, mUpdatingFace, mp_progressive); -    } -    else if(mp_progressive) -    { -        if(isRadiancePass()) -        { -            //updateProbeRadiance(mUpdatingProbe); -        } -        else updateProbeIrradiance(mUpdatingProbe); +        LL_WARNS() << "updating face " << mUpdatingFace << LL_ENDL; +        updateProbeFace(mUpdatingProbe, mUpdatingFace);      }      else      { -        if(isRadiancePass()) -        { -            updateProbeRadiance(mUpdatingProbe); -        } +        if(isRadiancePass()) updateProbeRadiance(mUpdatingProbe);          else updateProbeIrradiance(mUpdatingProbe);      } @@ -814,8 +793,23 @@ void LLReflectionMapManager::doProbeUpdate()          mUpdatingFace = 0;          if (isRadiancePass())          { +            F32 sMPUpdatePeriod = gSavedSettings.getF32("MPRenderProbeUpdatePeriod"); +              mUpdatingProbe->mComplete = true;              mUpdatingProbe->mCompletedCount++; + +            LL_WARNS() << "Probe updated (" << mUpdatingProbe->mCompletedCount << ")" << LL_ENDL; + +            if(mUpdatingProbe->mCompletedCount < 5) +            { +                //probe->mNextUpdateTime = gFrameTimeSeconds + fmax( ((F32)sMPUpdatePeriod / 2.0), 0.25); +                mUpdatingProbe->mNextUpdateTime = gFrameTimeSeconds + 1.0; +            } +            else +            { +                mUpdatingProbe->mNextUpdateTime = gFrameTimeSeconds + fmax( (F32)sMPUpdatePeriod, 0.10); +            } +              mUpdatingProbe = nullptr;              mRadiancePass = false;          } @@ -843,13 +837,14 @@ void LLReflectionMapManager::doProbeUpdate()  // The next six passes render the scene with both radiance and irradiance into the same scratch space cube map and generate a simple mip chain.  // At the end of these passes, a radiance map is generated for this probe and placed into the radiance cube map array at the index for this probe.  // In effect this simulates single-bounce lighting. -void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool progressive) +void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)  {      // hacky hot-swap of camera specific render targets      gPipeline.mRT = &gPipeline.mAuxillaryRT;      mLightScale = 1.f; -    static LLCachedControl<F32> max_local_light_ambiance(gSavedSettings, "RenderReflectionProbeMaxLocalLightAmbiance", 8.f); +    F32 max_local_light_ambiance = gSavedSettings.getF32("RenderReflectionProbeMaxLocalLightAmbiance"); +      if (!isRadiancePass() && probe->getAmbiance() > max_local_light_ambiance)      {          mLightScale = max_local_light_ambiance / probe->getAmbiance(); @@ -990,14 +985,6 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, b          gGL.getTexUnit(diffuseChannel)->unbind(LLTexUnit::TT_TEXTURE);          gReflectionMipProgram.unbind();      } - -    if(progressive) -    { -        if(isRadiancePass()) updateProbeRadianceOnFace(probe, face, sourceIdx); -    } - -    //  if(isRadiancePass()) updateProbeRadianceOnFace(probe, face, sourceIdx); -    //  else updateProbeIrradianceOnFace(probe, face, sourceIdx);  }  // ===================== IRRADIANCE ================================ @@ -1026,7 +1013,7 @@ void LLReflectionMapManager::updateProbeIrradiance(LLReflectionMap* probe)      mMipChain[0].bindTarget("irradiance", 0); -    mMipChain[0].clear(0); +    mMipChain[0].clear();      gIrradianceGenProgram.bind(); @@ -1157,140 +1144,6 @@ void LLReflectionMapManager::updateProbeRadiance(LLReflectionMap* probe)      //mTexture->unbind();  } -// ================== PER FACE ======================= - -void LLReflectionMapManager::updateProbeIrradianceOnFace(LLReflectionMap* probe, U32 face, S32 sourceIdx) -{ -    LL_PROFILE_GPU_ZONE("probe irradiance gen"); - -    static LLStaticHashedString sMipLevel("mipLevel"); -    static LLStaticHashedString sRoughness("roughness"); -    static LLStaticHashedString sWidth("u_width"); - -    gGL.setColorMask(true, false); -    LLGLDepthTest depth(GL_FALSE, GL_FALSE); -    LLGLDisable cull(GL_CULL_FACE); -    LLGLDisable blend(GL_BLEND); - -    static LLStaticHashedString sSourceIdx("sourceIdx"); - -    //LL_WARNS() << "IRRADIANCE" << LL_ENDL; - -    mMipChain[0].bindTarget("irradiance", 0); -    //mMipChain[0].clear(); - -            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); - -            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 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]); - -                    F32 mat[16]; -                    frame.getOpenGLRotation(mat); -                    gGL.loadMatrix(mat); - -                    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 -            } - -        mMipChain[0].flush(); - -        gIrradianceGenProgram.unbind(); -        mTexture->unbind(); -} - -void LLReflectionMapManager::updateProbeRadianceOnFace(LLReflectionMap* probe, U32 face, S32 sourceIdx) -{ -    LL_PROFILE_GPU_ZONE("probe radiance gen"); -    static LLStaticHashedString sMipLevel("mipLevel"); -    static LLStaticHashedString sRoughness("roughness"); -    static LLStaticHashedString sWidth("u_width"); - -    gGL.setColorMask(true, false); -    LLGLDepthTest depth(GL_FALSE, GL_FALSE); -    LLGLDisable cull(GL_CULL_FACE); -    LLGLDisable blend(GL_BLEND); - -    static LLStaticHashedString sSourceIdx("sourceIdx"); - -    mMipChain[0].bindTarget("radiance", 0); -    mMipChain[0].clear(0); - -    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); - -    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)); - -        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); - -            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"); -            //mMipChain[0].clear(0); -        } - -        if (i != mMipChain.size() - 1) -        { -            res /= 2; -        } -    } - -    gRadianceGenProgram.unbind(); -    mMipChain[0].flush(); -    mTexture->unbind(); -} -  void LLReflectionMapManager::reset()  {      mReset = true; @@ -1390,7 +1243,7 @@ void LLReflectionMapManager::updateUniforms()      LLEnvironment& environment = LLEnvironment::instance();      LLSettingsSky::ptr_t psky = environment.getCurrentSky(); -    static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); +    bool should_auto_adjust = gSavedSettings.getBOOL("RenderSkyAutoAdjustLegacy");      F32 minimum_ambiance = psky->getReflectionProbeAmbiance(should_auto_adjust);      bool is_ambiance_pass = gCubeSnapshot && !isRadiancePass(); @@ -1706,8 +1559,8 @@ void LLReflectionMapManager::renderDebug()  void LLReflectionMapManager::initReflectionMaps()  { -    static LLCachedControl<U32> ref_probe_res(gSavedSettings, "RenderReflectionProbeResolution", 128U); -    U32 probe_resolution = nhpo2(llclamp(ref_probe_res(), (U32)64, (U32)512)); +    U32 ref_probe_res = gSavedSettings.getU32("RenderReflectionProbeResolution"); +    U32 probe_resolution = nhpo2(llclamp(ref_probe_res, (U32)64, (U32)512));      bool shouldInit = mTexture.isNull() || mReflectionProbeCount != mDynamicProbeCount || mProbeResolution != probe_resolution || mReset; @@ -1731,7 +1584,7 @@ void LLReflectionMapManager::initReflectionMaps()              mTexture->getWidth() != mProbeResolution ||              mReflectionProbeCount + 2 != mTexture->getCount())          { -            static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true); +            bool render_hdr = gSavedSettings.getBOOL("RenderHDREnabled");              if (mTexture)              { diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index b874bb1c17..c12a87cade 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -210,15 +210,11 @@ private:      void doProbeUpdate();      // update the specified face of the specified probe -    void updateProbeFace(LLReflectionMap* probe, U32 face, bool progressive = false); +    void updateProbeFace(LLReflectionMap* probe, U32 face);      void updateProbeIrradiance(LLReflectionMap* probe);      void updateProbeRadiance(LLReflectionMap* probe); -    void updateProbeIrradianceOnFace(LLReflectionMap* probe, U32 face, S32 sourceIdx); -    void updateProbeRadianceOnFace(LLReflectionMap* probe, U32 face, S32 sourceIdx); - -      // list of active reflection maps      std::vector<LLPointer<LLReflectionMap> > mProbes; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 5183370076..ac0147002e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1687,10 +1687,6 @@ void render_ui_3d()      gUIProgram.bind();      gGL.color4f(1.f, 1.f, 1.f, 1.f); -    static LLCachedControl<bool> hdrDisplay(gSavedSettings, "MPHDRDisplay"); -    static LLCachedControl<F32> hdrUIBoost(gSavedSettings, "MPHDRUIBoost"); -    if(hdrDisplay) gUIProgram.uniform1f(LLShaderMgr::MP_HDR_BOOST, (GLfloat)hdrUIBoost); -      // Coordinate axes      static LLCachedControl<bool> show_axes(gSavedSettings, "ShowAxes");      if (show_axes()) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b3295651c2..35f33e64cb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1978,7 +1978,6 @@ LLViewerWindow::LLViewerWindow(const Params& p)      // Initialize OpenGL Renderer      LLVertexBuffer::initClass(mWindow, gSavedSettings.getU32("MPVertexBufferMode")); -      LL_INFOS("RenderInit") << "LLVertexBuffer initialization done." << LL_ENDL ;      if (!gGL.init(true))      { @@ -5056,7 +5055,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei                      mWorldViewRectRaw.set(0, image_height, image_width, 0);                      LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() );                      LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); -                    scratch_space.bindTarget("", 0); +                    scratch_space.bindTarget();                  }                  else                  { @@ -5323,7 +5322,7 @@ bool LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_          {              mWorldViewRectRaw.set(0, image_height, image_width, 0); -            scratch_space.bindTarget("", 0); +            scratch_space.bindTarget();          }          else          { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 800ed79d8a..84b83357b2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -356,14 +356,12 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)      static LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);      static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);      static LLCachedControl<U32> MPColorPrecision(gSavedSettings, "MPColorPrecision", 0); +    static LLCachedControl<bool> MPHDRDisplay(gSavedSettings, "MPHDRDisplay", false);      bool hdr = has_hdr() && gGLManager.mGLVersion > 4.05f; -    if (!hdr || MPColorPrecision < 2) -    { -        norm = GL_RGB10_A2; -        emissive = GL_RGB8; -    } +    if (!hdr || MPColorPrecision != 2) norm = GL_RGB10_A2; +    if (!hdr || (!MPHDRDisplay && MPColorPrecision == 1)) emissive = GL_RGB8;      bool valid = true;      valid      = valid && target.addColorAttachment(orm);    // frag-data[1] specular OR PBR ORM @@ -874,15 +872,15 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_)      //allocate deferred rendering color buffers      GLuint deferredScreenFormat = GL_RGBA8; -    if((hdr || mHDRDisplay) && MPColorPrecision == 2) deferredScreenFormat = GL_RGBA16F; +    if((hdr && MPColorPrecision == 2)) deferredScreenFormat = GL_RGBA16F;      if (!mRT->deferredScreen.allocate(resX, resY, deferredScreenFormat, true)) return false;      if (!addDeferredAttachments(mRT->deferredScreen)) return false; -    GLuint screenFormat = GL_RGBA8; -    if(hdr || mHDRDisplay) screenFormat = GL_RGBA16F; +    GLuint screenFormat = GL_RGBA16F; +    if(!hdr && !mHDRDisplay && MPColorPrecision == 1) screenFormat = GL_RGB8; -    if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; +    if (!mRT->screen.allocate(resX, resY, screenFormat)) return false;      mRT->deferredScreen.shareDepthBuffer(mRT->screen); @@ -901,7 +899,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_)      if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots      {          GLuint UIFormat = GL_RGBA8; -        if(mHDRDisplay && MPColorPrecision == 2) UIFormat = GL_RGBA16F; +        //if(mHDRDisplay && MPColorPrecision == 2) UIFormat = GL_RGBA16F;          if (RenderUIBuffer)          { @@ -914,7 +912,15 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_)          if (RenderFSAAType > 0)          {              GLuint AAFormat = GL_RGBA8; -            if(mHDRDisplay && MPColorPrecision == 2) AAFormat = GL_RGBA16F; +            if(mHDRDisplay && MPColorPrecision == 2) +            { +                LL_WARNS() << "AA SET TO GL_RGBA16F" << LL_ENDL; +                AAFormat = GL_RGBA16F; +            } +            else +            { +                LL_WARNS() << "AA SET TO GL_RGBA8" << LL_ENDL; +            }              if (!mFXAAMap.allocate(resX, resY, AAFormat)) return false;              if (RenderFSAAType == 2) @@ -3891,10 +3897,6 @@ void render_hud_elements()      gGL.color4f(1, 1, 1, 1);      LLGLDepthTest depth(GL_TRUE, GL_FALSE); -    static LLCachedControl<bool> HDRDisplay(gSavedSettings, "MPHDRDisplay"); -    static LLCachedControl<F32> hdrUIBoost(gSavedSettings, "MPHDRUIBoost"); -    if(HDRDisplay) gUIProgram.uniform1f(LLShaderMgr::MP_HDR_BOOST, (GLfloat)hdrUIBoost); -      if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))      {          gViewerWindow->renderSelections(false, false, false); // For HUD version in render_ui_3d() @@ -7362,7 +7364,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst)          if(mHDRDisplay)          {              shader.uniform1f(LLShaderMgr::GAMMA, (GLfloat)mp_hdr_gamma); -            shader.uniform1f(LLShaderMgr::MP_HDR_BOOST, (GLfloat)mp_hdr_boost); +            shader.uniform1f(LLShaderMgr::MP_HDR_BOOST, 1.0);          }          renderTriangle(); @@ -7686,14 +7688,14 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src)              edge_shader.bind();              edge_shader.uniform4fv(sSmaaRTMetrics, 1, rt_metrics); -            S32 channel = edge_shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); +            S32 channel = edge_shader.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE); +              if (channel > -1)              {                  if (!use_sample)                  { -                    //src->bindTexture(0, channel, LLTexUnit::TFO_POINT); -                    //gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);                      src->bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); +                    gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);                  }                  else                  { @@ -8101,7 +8103,7 @@ bool LLPipeline::renderBloom(LLRenderTarget* src, LLRenderTarget* dst)      gBloomExtractProgram.bind();      gBloomExtractProgram.bindTexture(LLShaderMgr::DIFFUSE_MAP, &mRT->screen);      gBloomExtractProgram.bindTexture(LLShaderMgr::BLOOM_EXTRACT_ORM, &mRT->deferredScreen, false, LLTexUnit::TFO_POINT, 1); -    gBloomExtractProgram.bindTexture(LLShaderMgr::BLOOM_EXTRACT_EMISSIVE, &mGlow[1], false, LLTexUnit::TFO_POINT, 0); +    //gBloomExtractProgram.bindTexture(LLShaderMgr::BLOOM_EXTRACT_EMISSIVE, &mGlow[1], false, LLTexUnit::TFO_POINT, 0);      gBloomExtractProgram.bindTexture(LLShaderMgr::BLOOM_EXTRACT_EMISSIVE2, &mRT->deferredScreen, false, LLTexUnit::TFO_POINT, 3);      gBloomExtractProgram.uniform1f(LLShaderMgr::BLOOM_EXTRACT_BRIGHTNESS, 1.0 - mp_bloom_extract_brightness); @@ -8224,6 +8226,8 @@ void LLPipeline::renderFinalize()      LLRenderTarget* postHDRBuffer = &mRT->screen; +    generateSMAABuffers(&mRT->screen); +      if (hdr)      {          copyScreenSpaceReflections(&mRT->screen, &mSceneMap); @@ -10400,6 +10404,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)          LLVector3 split_exp = RenderShadowSplitExponent;          F32 da = 1.f-llmax( fabsf(lightDir*up), fabsf(lightDir*camera.getLeftAxis()) );          da = powf(da, split_exp.mV[2]); +          F32 sxp = split_exp.mV[1] + (split_exp.mV[0]-split_exp.mV[1])*da;          for (U32 i = 0; i < splits; ++i) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics3.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics3.xml index ddc00915a5..c7a1959853 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics3.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics3.xml @@ -1721,8 +1721,8 @@ height="16"  left_delta="150"  top_delta="-1"  initial_value="1.0" -increment="0.1" -min_val="0.8" +increment="0.05" +min_val="0.75"  max_val="2.0"  decimal_digits="2"  label_width="2"> @@ -1752,7 +1752,7 @@ Advanced settings:  <check_box  name="MultiTexCtrl"  control_name="RenderGLMultiThreadedTextures" -label="Multithreaded Textures" +label="Multithreaded Textures (needs restart)"  layout="topleft"  width="400"  height="16" @@ -1764,8 +1764,8 @@ initial_value="false"  <icon  name="mp_multitex_bullet" -tool_tip="Improves textures loading performance on certain hardware. But can be unstable." -image_name="mp_yellow_bullet" +tool_tip="Improves textures loading performance on certain hardware. But can be unstable!! Don't enable this on Linux and don't use it with Apple Multithreaded OpenGL activated." +image_name="mp_red_bullet"  follows="left|top"  width="16"  height="16" @@ -1776,7 +1776,7 @@ top_delta="-2"  <icon  name="mp_multitex_info_bullet" -tool_tip="Enables loading textures using multiple threads." +tool_tip="Enables loading textures using multiple threads. Use with extreme caution! it's unstable."  image_name="mp_info_bullet"  follows="left|top"  width="16" @@ -1873,7 +1873,7 @@ top_delta="-2"  <icon  name="mp_lowcolor_info_bullet" -tool_tip="Sets the internal color resolution. Improves the speed or quality." +tool_tip="Sets the internal color resolution. Influences the speed or quality. Set this to high if you want to use HDR Display."  image_name="mp_info_bullet"  follows="left|top"  width="16" @@ -1924,9 +1924,9 @@ Warning: HDR shows extreme luminosity contrast. Use carefully!  <check_box  name="HDRDisplayCtrl"  control_name="MPHDRDisplay" -label="HDR Display (Mac)" +label="HDR Display (Mac) - needs restart"  layout="topleft" -width="250" +width="400"  height="16"  left="20"  top_delta="32" @@ -1934,6 +1934,30 @@ initial_value="true"  >  </check_box> +<icon +name="mp_hdrd2_bullet" +tool_tip="Medium performance impact" +image_name="mp_yellow_bullet" +follows="left|top" +width="16" +height="16" +layout="topleft" +left_pad="5" +top_delta="-2" +/> + +<icon +name="mp_hdrd2_info_bullet" +tool_tip="Make sure your color profile is Apple XDR" +image_name="mp_info_bullet" +follows="left|top" +width="16" +height="16" +layout="topleft" +left_pad="5" +top_delta="0" +/> +  <text  name="mp_hdrd_gamma_lbl"  follows="left|top" @@ -1964,35 +1988,6 @@ label_width="2">  </slider>  <text -name="mp_hdrd_uiboost_lbl" -follows="left|top" -layout="topleft" -width="140" -height="18" -left="32" -top_pad="16" -font="SansSerifSmall" -> -UI Luminosity Boost -</text> - -<slider -control_name="MPHDRUIBoost" -follows="left|top" -layout="topleft" -width="200" -height="16" -left_delta="150" -top_delta="-1" -initial_value="1.0" -increment="0.1" -min_val="1.0" -max_val="1.4" -decimal_digits="2" -label_width="2"> -</slider> - -<text  follows="left|top"  layout="topleft"  top_pad="30" @@ -2045,7 +2040,7 @@ top_delta="0"  <check_box  name="MPAppleVBModeCtrl"  control_name="MPVertexBufferMode" -label="Megapahit Vertex Buffer Mode (needs restart)" +label="Alternative Vertex Buffer Mode (needs restart)"  layout="topleft"  width="400"  height="16" | 
