diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-08-27 09:45:06 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-08-27 09:45:06 +0800 |
| commit | 7d8156bc6d4dd66eb2eacb34d5e9160a687b15be (patch) | |
| tree | 08e737eb135cc88f293197a0f8eb22cc62351b3e /indra/newview | |
| parent | a8636720129952c10cf49ab80da21bf8b340b96c (diff) | |
| parent | d5f5fc3bb496176a9ccf91c09bb25948a8ac6a94 (diff) | |
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 88 | ||||
| -rw-r--r-- | indra/newview/pipeline.h | 7 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_snapshot_local.xml | 54 |
4 files changed, 84 insertions, 73 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 488b551e36..ceea381e06 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5104,6 +5104,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei // if not showing ui, use full window to render world view updateWorldViewRect(!show_ui); + gResizeScreenTexture = false; // Copy screen to a buffer // crop sides or top and bottom, if taking a snapshot of different aspect ratio @@ -5135,8 +5136,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei F32 scale_factor = 1.0f ; if (!keep_window_aspect || (image_width > window_width) || (image_height > window_height)) { - if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) && - (image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui) + if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) && LLPipeline::sRenderDeferred && !show_ui) { U32 color_fmt = type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH ? GL_DEPTH_COMPONENT : GL_RGBA; if (scratch_space.allocate(image_width, image_height, color_fmt, true)) @@ -5144,7 +5144,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei original_width = gPipeline.mRT->deferredScreen.getWidth(); original_height = gPipeline.mRT->deferredScreen.getHeight(); - if (gPipeline.allocateScreenBuffer(image_width, image_height)) + if (gPipeline.allocateScreenBuffer(image_width, image_height, 1)) { window_width = image_width; window_height = image_height; @@ -5417,7 +5417,7 @@ bool LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_ U32 color_fmt = GL_RGBA; if (scratch_space.allocate(image_width, image_height, color_fmt, true)) { - if (gPipeline.allocateScreenBuffer(image_width, image_height)) + if (gPipeline.allocateScreenBuffer(image_width, image_height, 1)) { mWorldViewRectRaw.set(0, image_height, image_width, 0); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9b104f363a..74b865c630 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -229,7 +229,7 @@ const F32 ALPHA_BLEND_CUTOFF = 0.598f; const F32 DEFERRED_LIGHT_FALLOFF = 0.5f; const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; -const U32 SHADOWS_RESX = 512; +const U32 SHADOWS_RESX = 768; const U32 SHADOWS_RESY = 512; extern S32 gBoxFrame; @@ -767,16 +767,16 @@ void LLPipeline::resizeScreenTexture() releaseScreenBuffers(); releaseSunShadowTargets(); releaseSpotShadowTargets(); - allocateScreenBuffer(resX,resY); + allocateScreenBuffer(resX, resY); gResizeScreenTexture = false; } } } -bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) +bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 snapshot_) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; - eFBOStatus ret = doAllocateScreenBuffer(resX, resY); + eFBOStatus ret = doAllocateScreenBuffer(resX, resY, snapshot_); return ret == FBO_SUCCESS_FULLRES; } @@ -788,7 +788,7 @@ void LLPipeline::renderTriangle() } -LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) +LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY, U32 snapshot_) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; // try to allocate screen buffers at requested resolution and samples @@ -799,8 +799,11 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) // refresh cached settings here to protect against inconsistent event handling order refreshCachedSettings(); + mHDRBuffers = false; + if(mHDRDisplay && !snapshot_) mHDRBuffers = true; + eFBOStatus ret = FBO_SUCCESS_FULLRES; - if (!allocateScreenBufferInternal(resX, resY)) + if (!allocateScreenBufferInternal(resX, resY, snapshot_)) { //failed to allocate at requested specification, return false ret = FBO_FAILURE; @@ -811,14 +814,14 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) while (resY > 0 && resX > 0) { resY /= 2; - if (allocateScreenBufferInternal(resX, resY)) + if (allocateScreenBufferInternal(resX, resY, snapshot_)) { return FBO_SUCCESS_LOWRES; } releaseScreenBuffers(); resX /= 2; - if (allocateScreenBufferInternal(resX, resY)) + if (allocateScreenBufferInternal(resX, resY, snapshot_)) { return FBO_SUCCESS_LOWRES; } @@ -831,7 +834,7 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) return ret; } -bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) +bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 snapshot_) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; @@ -852,14 +855,14 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) mRT = &mAuxillaryRT; U32 res = mReflectionMapManager.mProbeResolution * 4; //multiply by 4 because probes will be 16x super sampled - allocateScreenBufferInternal(res, res, 1); + allocateScreenBufferInternal(res, res, snapshot_); if (RenderMirrors) { mHeroProbeManager.initReflectionMaps(); res = mHeroProbeManager.mProbeResolution; // We also scale the hero probe RT to the probe res since we don't super sample it. mRT = &mHeroProbeRT; - allocateScreenBufferInternal(res, res, 2); + allocateScreenBufferInternal(res, res, snapshot_); } mRT = &mMainRT; @@ -870,12 +873,15 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) mRT->width = resX; mRT->height = resY; - F32 res_mod = fmin(RenderResolutionDivisor, 4.0); - - if (res_mod >= 0.5 && res_mod <= 4.0) + if(!snapshot_) { - resX = (U32)(floor((F32)resX / res_mod)); - resY = (U32)(floor((F32)resY / res_mod)); + F32 res_mod = fmin(RenderResolutionDivisor, 4.0); + + if (res_mod >= 0.5 && res_mod <= 4.0) + { + resX = (U32)(floor((F32)resX / res_mod)); + resY = (U32)(floor((F32)resY / res_mod)); + } } S32 shadow_detail = RenderShadowDetail; @@ -890,9 +896,10 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) if (!addDeferredAttachments(mRT->deferredScreen)) return false; GLuint screenFormat = GL_RGBA16F; - if(!hdr && !mHDRDisplay && MPColorPrecision == 1) screenFormat = GL_RGB10_A2; + if(!hdr || ( !mHDRBuffers && MPColorPrecision == 1 )) screenFormat = GL_RGB10_A2; - if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; + //if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; + if (!mRT->screen.allocate(resX, resY, screenFormat)) return false; mRT->deferredScreen.shareDepthBuffer(mRT->screen); @@ -906,12 +913,11 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) } //allocateShadowBuffer(resX, resY); - if(type_ == 0) allocateShadowBuffer(SHADOWS_RESX, SHADOWS_RESY); + allocateShadowBuffer(SHADOWS_RESX, SHADOWS_RESY); if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots { GLuint UIFormat = GL_RGBA8; - //if(mHDRDisplay && MPColorPrecision == 2) UIFormat = GL_RGBA16F; if (RenderUIBuffer) { @@ -924,7 +930,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) if (RenderFSAAType > 0) { GLuint AAFormat = GL_RGBA8; - if(mHDRDisplay && MPColorPrecision != 1) + if(mHDRBuffers && MPColorPrecision != 1) { AAFormat = GL_RGBA16F; } @@ -961,7 +967,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_) mPostPingMap.allocate(resX, resY, GL_RGBA); mPostPongMap.allocate(resX, resY, GL_RGBA); */ - if((hdr && MPColorPrecision == 2) || mHDRDisplay) + if((hdr && MPColorPrecision == 2) || mHDRBuffers) { mPostMaps[0].allocate(resX, resY, screenFormat); mPostMaps[1].allocate(resX, resY, screenFormat); @@ -5936,21 +5942,21 @@ void LLPipeline::setupHWLights() mSunDiffuse.setVec(psky->getSunlightColor()); mMoonDiffuse.setVec(psky->getMoonlightColor()); - if(!mHDRDisplay) - { - F32 max_color = llmax(mSunDiffuse.mV[0], mSunDiffuse.mV[1], mSunDiffuse.mV[2]); - if (max_color > 1.f) + if(!mHDRBuffers) { - mSunDiffuse *= 1.f/max_color; - } - mSunDiffuse.clamp(); + F32 max_color = llmax(mSunDiffuse.mV[0], mSunDiffuse.mV[1], mSunDiffuse.mV[2]); + if (max_color > 1.f) + { + mSunDiffuse *= 1.f/max_color; + } + mSunDiffuse.clamp(); - max_color = llmax(mMoonDiffuse.mV[0], mMoonDiffuse.mV[1], mMoonDiffuse.mV[2]); - if (max_color > 1.f) - { - mMoonDiffuse *= 1.f/max_color; - } - mMoonDiffuse.clamp(); + max_color = llmax(mMoonDiffuse.mV[0], mMoonDiffuse.mV[1], mMoonDiffuse.mV[2]); + if (max_color > 1.f) + { + mMoonDiffuse *= 1.f/max_color; + } + mMoonDiffuse.clamp(); } // prevent underlighting from having neither lightsource facing us @@ -7498,14 +7504,14 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) gDeferredPostGammaCorrectProgram; static LLCachedControl<F32> mp_hdr_gamma(gSavedSettings, "MPHDRGamma", false); - if(mHDRDisplay) shader = gHDRGammaCorrectProgram; + if(mHDRBuffers) shader = gHDRGammaCorrectProgram; shader.bind(); shader.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, false, LLTexUnit::TFO_POINT); //screensize isn't a uniform in the shader, we comment out for now //shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)src->getWidth(), (GLfloat)src->getHeight()); - if(mHDRDisplay) + if(mHDRBuffers) { shader.uniform1f(LLShaderMgr::GAMMA, (GLfloat)mp_hdr_gamma); shader.uniform1f(LLShaderMgr::MP_HDR_BOOST, 1.0); @@ -8261,7 +8267,7 @@ bool LLPipeline::renderBloom(LLRenderTarget* src, LLRenderTarget* dst) static LLCachedControl<F32> mp_bloom_nonmetal(gSavedSettings, "MPBloomExtractNonMetal", 0.2); F32 clampValue = 1.0; - if(mHDRDisplay) clampValue = 11.0; + if(mHDRBuffers) clampValue = 11.0; LLGLDepthTest depth(GL_FALSE, GL_FALSE); LLGLDisable blend(GL_BLEND); @@ -8389,11 +8395,11 @@ void LLPipeline::renderFinalize() bool apply_cas = false; static LLCachedControl<F32> cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.0f); - if (cas_sharpness > 0.0f && gCASProgram.isComplete() && gCASLegacyGammaProgram.isComplete() && !mHDRDisplay) apply_cas = true; + if (cas_sharpness > 0.0f && gCASProgram.isComplete() && gCASLegacyGammaProgram.isComplete() && !mHDRBuffers) apply_cas = true; U16 activeRT = 0; - if (hdr && !mHDRDisplay) + if (hdr && !mHDRBuffers) { copyScreenSpaceReflections(&mRT->screen, &mSceneMap); @@ -8412,7 +8418,7 @@ void LLPipeline::renderFinalize() } else { - if(mHDRDisplay) copyScreenSpaceReflections(&mRT->screen, &mSceneMap); + if(mHDRBuffers) copyScreenSpaceReflections(&mRT->screen, &mSceneMap); gammaCorrect(&mRT->screen, &mPostMaps[activeRT]); } diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 60804eee9e..76a02dde6c 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -114,7 +114,7 @@ public: //allocate the largest screen buffer possible up to resX, resY //returns true if full size buffer allocated, false if some other size is allocated - bool allocateScreenBuffer(U32 resX, U32 resY); + bool allocateScreenBuffer(U32 resX, U32 resY, U32 snapshot_ = 0); typedef enum { FBO_SUCCESS_FULLRES = 0, @@ -124,7 +124,7 @@ public: private: //implementation of above, wrapped for easy error handling - eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY); + eFBOStatus doAllocateScreenBuffer(U32 resX, U32 resY, U32 snapshot_ = 0); void renderTriangle(); public: @@ -132,7 +132,7 @@ public: //attempt to allocate screen buffers at resX, resY //returns true if allocation successful, false otherwise //type 0 = screen, 1 = probe, 2 = mirror - bool allocateScreenBufferInternal(U32 resX, U32 resY, U32 type_ = 0); + bool allocateScreenBufferInternal(U32 resX, U32 resY, U32 snapshot_ = 0); bool allocateShadowBuffer(U32 resX, U32 resY); // rebuild all LLVOVolume render batches @@ -830,6 +830,7 @@ public: U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback bool mHDRDisplay; + bool mHDRBuffers; protected: bool mRenderTypeEnabled[NUM_RENDER_TYPES]; 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 fb88b752ae..1c08ede6e7 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" @@ -51,31 +51,35 @@ name="CurrentWindow" value="[i0,i0]" /> <combo_box.item - label="320x240" - name="320x240" - value="[i320,i240]" /> - <combo_box.item - label="640x480" - name="640x480" - value="[i640,i480]" /> - <combo_box.item - label="800x600" - name="800x600" - value="[i800,i600]" /> - <combo_box.item - label="1024x768" - name="1024x768" - value="[i1024,i768]" /> - <combo_box.item - label="1280x1024" - name="1280x1024" - value="[i1280,i1024]" /> + label="screen 720p" + name="1280x720" + value="[i1280,i720]" /> <combo_box.item - label="1600x1200" - name="1600x1200" - value="[i1600,i1200]" /> + label="screen 1080p" + name="1920x1080" + value="[i1920,i1080]" /> + <combo_box.item + label="landscape 1024p" + name="1536x1024" + value="[i1536,i1024]" /> + <combo_box.item + label="portrait 1024p" + name="1024x1536" + value="[i1024,i1536]" /> + <combo_box.item + label="MPx2 1400x1050" + name="1400x1050" + value="[i1400,i1050]" /> + <combo_box.item + label="MPx4 2800x2100" + name="2800x2100" + value="[i2800,i2100]" /> + <combo_box.item + label="square 1024p" + name="1024x1024" + value="[i1024,i1024]" /> <combo_box.item - label="2048x2048" + label="square 2048p" name="2048x2048" value="[i2048,i2048]" /> <combo_box.item |
