diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl index 689929fe38f5252d22baa18c8a6d69a07af873f5..ff37f9e4b355c0f99a563abd82673b15dfbe901f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl @@ -82,7 +82,7 @@ void main() float L = lum(col); - float s = clamp(0.1/L, 0.5, 4.0); + float s = clamp(0.1/L, 0.5, 2.0); float prev = texture(exposureMap, vec2(0.5,0.5)).r; s = mix(prev, s, min(dt*2.0, 0.04)); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index cfd85628d50170de50845e3657e51cbb085b3aca..782f987f1cad1e5c25a6a945aee44f4d7ea27fff 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -79,6 +79,8 @@ #include <boost/bind.hpp> // for SkinFolder listener #include <boost/signals2.hpp> +// *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary. +constexpr BOOL USE_MIPMAPS = FALSE; void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) { @@ -1559,7 +1561,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, // connect this media_impl to the media texture, creating it if it doesn't exist.0 // This is necessary because we need to be able to use getMaxVirtualSize() even if the media plugin is not loaded. - LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture(mTextureId); + // *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary. + LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture(mTextureId, USE_MIPMAPS); if(media_tex) { media_tex->setMediaImpl(); @@ -2963,12 +2966,15 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA; mLock.lock(); // don't allow media source tear-down during update + const LLGLuint tex_name = media_tex->getGLTexture() ? media_tex->getGLTexture()->getTexName() : (LLGLuint)0; + if (!tex_name) + { + llassert(false); + return; + } + // wrap "data" in an LLImageRaw but do NOT make a copy LLPointer<LLImageRaw> raw = new LLImageRaw(data, media_tex->getWidth(), media_tex->getHeight(), media_tex->getComponents(), true); - - // Allocate GL texture based on LLImageRaw but do NOT copy to GL - LLGLuint tex_name = 0; - media_tex->createGLTexture(0, raw, 0, TRUE, LLGLTexture::OTHER, true, &tex_name); // copy just the subimage covered by the image raw to GL media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name); @@ -3007,10 +3013,10 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage() } llassert(!mTextureId.isNull()); - LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture( mTextureId ); + // *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary. + LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture( mTextureId, USE_MIPMAPS ); if ( mNeedsNewTexture - || media_tex->getUseMipMaps() || (media_tex->getWidth() != mMediaSource->getTextureWidth()) || (media_tex->getHeight() != mMediaSource->getTextureHeight()) || (mTextureUsedWidth != mMediaSource->getWidth()) @@ -3026,8 +3032,6 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage() // MEDIAOPT: check to see if size actually changed before doing work media_tex->destroyGLTexture(); - // MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work? - media_tex->reinit(FALSE); // probably not needed // MEDIAOPT: seems insane that we actually have to make an imageraw then // immediately discard it