From 85a7020e4903e83701c3f1ccbc9a14bd84c9368b Mon Sep 17 00:00:00 2001 From: Rye Cogtail Date: Fri, 13 Sep 2024 16:26:23 -0400 Subject: Raise resolution of local baked texture preview from 512 to 2048 --- indra/newview/lldynamictexture.cpp | 54 ++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 17 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index fe6cd4e37d..0b9f76e7f6 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -191,44 +191,42 @@ bool LLViewerDynamicTexture::updateAllInstances() return true; } - LLRenderTarget& bake_target = gPipeline.mAuxillaryRT.deferredScreen; - - if (!bake_target.isComplete()) + LLRenderTarget& preview_target = gPipeline.mAuxillaryRT.deferredScreen; + LLRenderTarget& bake_target = gPipeline.mBakeMap; + if (!preview_target.isComplete() || !bake_target.isComplete()) { llassert(false); return false; } - llassert(bake_target.getWidth() >= LLPipeline::MAX_BAKE_WIDTH); - llassert(bake_target.getHeight() >= LLPipeline::MAX_BAKE_WIDTH); + llassert(preview_target.getWidth() >= LLPipeline::MAX_PREVIEW_WIDTH); + llassert(preview_target.getHeight() >= LLPipeline::MAX_PREVIEW_WIDTH); + llassert(bake_target.getWidth() >= LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH); + llassert(bake_target.getHeight() >= LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT); - bake_target.bindTarget(); - bake_target.clear(); + preview_target.bindTarget(); + preview_target.clear(); LLGLSLShader::unbind(); LLVertexBuffer::unbind(); bool result = false; bool ret = false ; - for( S32 order = 0; order < ORDER_COUNT; order++ ) - { - for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin(); - iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter) + auto update_func = [&](LLViewerDynamicTexture* dynamicTexture, LLRenderTarget& renderTarget, S32 width, S32 height) { - LLViewerDynamicTexture *dynamicTexture = *iter; if (dynamicTexture->needsRender()) { - llassert(dynamicTexture->getFullWidth() <= S32(LLPipeline::MAX_BAKE_WIDTH)); - llassert(dynamicTexture->getFullHeight() <= S32(LLPipeline::MAX_BAKE_WIDTH)); + llassert(dynamicTexture->getFullWidth() <= width); + llassert(dynamicTexture->getFullHeight() <= height); glClear(GL_DEPTH_BUFFER_BIT); - gGL.color4f(1,1,1,1); - dynamicTexture->setBoundTarget(&bake_target); + gGL.color4f(1.f, 1.f, 1.f, 1.f); + dynamicTexture->setBoundTarget(&renderTarget); dynamicTexture->preRender(); // Must be called outside of startRender() result = false; if (dynamicTexture->render()) { - ret = true ; + ret = true; result = true; sNumRenders++; } @@ -237,9 +235,31 @@ bool LLViewerDynamicTexture::updateAllInstances() dynamicTexture->setBoundTarget(nullptr); dynamicTexture->postRender(result); } + }; + + // ORDER_FIRST is unused, ORDER_MIDDLE is various ui preview + for(S32 order = 0; order < ORDER_LAST; ++order) + { + for (LLViewerDynamicTexture* dynamicTexture : LLViewerDynamicTexture::sInstances[order]) + { + update_func(dynamicTexture, preview_target, LLPipeline::MAX_PREVIEW_WIDTH, LLPipeline::MAX_PREVIEW_WIDTH); } } + preview_target.flush(); + + // ORDER_LAST is baked skin preview, ORDER_RESET resets appearance parameters and does not render. + bake_target.bindTarget(); + bake_target.clear(); + result = false; + ret = false; + for (S32 order = ORDER_LAST; order < ORDER_COUNT; ++order) + { + for (LLViewerDynamicTexture* dynamicTexture : LLViewerDynamicTexture::sInstances[order]) + { + update_func(dynamicTexture, bake_target, LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH, LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT); + } + } bake_target.flush(); gGL.flush(); -- cgit v1.2.3 From 870ffbd55b4ffdfad27edf8824de0c9cbc577a80 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 17 Sep 2024 12:43:47 -0500 Subject: Suppress mapBuffer warnings. (#2584) --- indra/newview/lldynamictexture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/lldynamictexture.cpp') diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 0b9f76e7f6..33325e352f 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -200,8 +200,8 @@ bool LLViewerDynamicTexture::updateAllInstances() } llassert(preview_target.getWidth() >= LLPipeline::MAX_PREVIEW_WIDTH); llassert(preview_target.getHeight() >= LLPipeline::MAX_PREVIEW_WIDTH); - llassert(bake_target.getWidth() >= LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH); - llassert(bake_target.getHeight() >= LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT); + llassert(bake_target.getWidth() >= (U32) LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH); + llassert(bake_target.getHeight() >= (U32) LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT); preview_target.bindTarget(); preview_target.clear(); -- cgit v1.2.3