diff options
| author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-11-20 21:25:06 +0100 | 
|---|---|---|
| committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-11-21 12:41:40 +0100 | 
| commit | 70eda83fb08c5c4e8b0ea95868243d744c6e88e9 (patch) | |
| tree | 93c23cd9b9226c768a71b97ec58468adf5cdf7c4 | |
| parent | d6e7b5d73e2dd57ede568fe52ba2726ee861f9fa (diff) | |
SL-20563 Add 'No Post' option to Snapshot floater
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
| -rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llsnapshotlivepreview.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llviewerdisplay.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llviewermenufile.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.h | 4 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 6 | 
8 files changed, 34 insertions, 13 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b9025ef7cd..00b59f9a4d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -533,6 +533,17 @@        <key>Value</key>        <integer>0</integer>      </map> +    <key>RenderSnapshotNoPost</key> +    <map> +      <key>Comment</key> +      <string>Disable tone mapping and exposure correction when snapshot is being rendered</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map>      <key>AutomaticFly</key>      <map>        <key>Comment</key> diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 4806fe9625..ca2069cbfc 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -474,7 +474,7 @@ void LLFloaterSnapshotBase::ImplBase::onClickAutoSnap(LLUICtrl *ctrl, void* data  void LLFloaterSnapshotBase::ImplBase::onClickNoPost(LLUICtrl *ctrl, void* data)  {      BOOL no_post = ((LLCheckBoxCtrl*)ctrl)->get(); -    gSavedSettings.setBOOL("RenderDisablePostProcessing", no_post); +    gSavedSettings.setBOOL("RenderSnapshotNoPost", no_post);      LLFloaterSnapshotBase* view = (LLFloaterSnapshotBase*)data;      view->getPreviewView()->updateSnapshot(TRUE, TRUE); @@ -1008,7 +1008,7 @@ BOOL LLFloaterSnapshot::postBuild()  	getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));  	childSetCommitCallback("auto_snapshot_check", ImplBase::onClickAutoSnap, this); -    getChild<LLUICtrl>("no_post_check")->setValue(gSavedSettings.getBOOL("RenderDisablePostProcessing")); +    getChild<LLUICtrl>("no_post_check")->setValue(gSavedSettings.getBOOL("RenderSnapshotNoPost"));      childSetCommitCallback("no_post_check", ImplBase::onClickNoPost, this);      getChild<LLButton>("retract_btn")->setCommitCallback(boost::bind(&LLFloaterSnapshot::onExtendFloater, this)); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index b7a1832b17..2ff8f50277 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -559,6 +559,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)                                           mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),                                           gSavedSettings.getBOOL("RenderHUDInSnapshot"),                                           FALSE, +                                         gSavedSettings.getBOOL("RenderSnapshotNoPost"),                                           mSnapshotBufferType) )          {              raw = NULL ; @@ -718,6 +719,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )                  previewp->mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),                  gSavedSettings.getBOOL("RenderHUDInSnapshot"),                  FALSE, +                gSavedSettings.getBOOL("RenderSnapshotNoPost"),                  previewp->mSnapshotBufferType,                  previewp->getMaxImageSize()))          { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 04ca62e0ec..a936012781 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -100,6 +100,7 @@ BOOL gResizeShadowTexture = FALSE;  BOOL gWindowResized = FALSE;  BOOL gSnapshot = FALSE;  BOOL gCubeSnapshot = FALSE; +BOOL gSnapshotNoPost = FALSE;  BOOL gShaderProfileFrame = FALSE;  // This is how long the sim will try to teleport you before giving up. @@ -410,13 +411,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  		gResizeShadowTexture = FALSE;  	} +	gSnapshot = for_snapshot; +  	if (LLPipeline::sRenderDeferred)  	{ //hack to make sky show up in deferred snapshots  		for_snapshot = FALSE;  	} -	gSnapshot = for_snapshot; -  	LLGLSDefault gls_default;  	LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE, GL_LEQUAL); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e2791ba128..5461e0f362 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -863,8 +863,9 @@ class LLFileTakeSnapshotToDisk : public view_listener_t  		S32 width = gViewerWindow->getWindowWidthRaw();  		S32 height = gViewerWindow->getWindowHeightRaw(); -		bool render_ui = gSavedSettings.getBOOL("RenderUIInSnapshot"); -		bool render_hud = gSavedSettings.getBOOL("RenderHUDInSnapshot"); +		BOOL render_ui = gSavedSettings.getBOOL("RenderUIInSnapshot"); +		BOOL render_hud = gSavedSettings.getBOOL("RenderHUDInSnapshot"); +		BOOL render_no_post = gSavedSettings.getBOOL("RenderSnapshotNoPost");  		BOOL high_res = gSavedSettings.getBOOL("HighResSnapshot");  		if (high_res) @@ -884,6 +885,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t  									   render_ui,  									   render_hud,  									   FALSE, +									   render_no_post,  									   LLSnapshotModel::SNAPSHOT_TYPE_COLOR,  									   high_res ? S32_MAX : MAX_SNAPSHOT_IMAGE_SIZE)) //per side  		{ diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ba2b6e1c7c..ed671fe849 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -229,6 +229,7 @@ extern BOOL gDisplaySwapBuffers;  extern BOOL gDepthDirty;  extern BOOL gResizeScreenTexture;  extern BOOL gCubeSnapshot; +extern BOOL gSnapshotNoPost;  LLViewerWindow	*gViewerWindow = NULL; @@ -4875,16 +4876,16 @@ void LLViewerWindow::resetSnapshotLoc() const  	gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string());  } -BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type) +BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, BOOL no_post, LLSnapshotModel::ESnapshotLayerType type)  { -	return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, show_hud, do_rebuild, type); +	return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, show_hud, do_rebuild, no_post, type);  }  // Saves the image from the screen to a raw image  // Since the required size might be bigger than the available screen, this method rerenders the scene in parts (called subimages) and copy  // the results over to the final raw image.  BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height,  -    BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, S32 max_size) +    BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, BOOL no_post, LLSnapshotModel::ESnapshotLayerType type, S32 max_size)  {  	if (!raw)  	{ @@ -4901,6 +4902,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei  	}  	// PRE SNAPSHOT +	gSnapshotNoPost = no_post;  	gDisplaySwapBuffers = FALSE;      glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); // stencil buffer is deprecated | GL_STENCIL_BUFFER_BIT); @@ -5131,6 +5133,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei  	}  	gDisplaySwapBuffers = FALSE; +	gSnapshotNoPost = FALSE;  	gDepthDirty = TRUE;  	// POST SNAPSHOT diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 6e8a5b2f4e..ccef006a07 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -362,7 +362,7 @@ public:  	BOOL			saveSnapshot(const std::string&  filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL show_hud = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP);  	BOOL			rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE, -		BOOL show_ui = TRUE, BOOL show_hud = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE); +		BOOL show_ui = TRUE, BOOL show_hud = TRUE, BOOL do_rebuild = FALSE, BOOL no_post = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE);      BOOL			simpleSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, const int num_render_passes); @@ -380,7 +380,7 @@ public:      // special implementation of simpleSnapshot for reflection maps      BOOL			reflectionSnapshot(LLImageRaw* raw, S32 image_width, S32 image_height, const int num_render_passes); -    BOOL			thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); +    BOOL			thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, BOOL no_post, LLSnapshotModel::ESnapshotLayerType type);  	BOOL			isSnapshotLocSet() const;  	void			resetSnapshotLoc() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9266c84540..64d247a202 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -211,6 +211,7 @@ extern S32 gBoxFrame;  extern BOOL gDisplaySwapBuffers;  extern BOOL gDebugGL;  extern BOOL gCubeSnapshot; +extern BOOL gSnapshotNoPost;  bool	gAvatarBacklight = false; @@ -6791,7 +6792,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) {  	{  		LL_PROFILE_GPU_ZONE("gamma correct"); -        static LLCachedControl<bool> no_post(gSavedSettings, "RenderDisablePostProcessing", false); +        static LLCachedControl<bool> buildNoPost(gSavedSettings, "RenderDisablePostProcessing", false);  		LLGLDepthTest depth(GL_FALSE, GL_FALSE); @@ -6801,7 +6802,8 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) {          LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); -        LLGLSLShader& shader = no_post && gFloaterTools->isAvailable() ? gNoPostGammaCorrectProgram : // no post (no gamma, no exposure, no tonemapping) +        bool no_post = gSnapshotNoPost || (buildNoPost && gFloaterTools->isAvailable()); +        LLGLSLShader& shader = no_post ? gNoPostGammaCorrectProgram : // no post (no gamma, no exposure, no tonemapping)              psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f ? gLegacyPostGammaCorrectProgram :              gDeferredPostGammaCorrectProgram; | 
