summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2021-08-30 19:51:25 -0700
committerCallum Prentice <callum@lindenlab.com>2021-08-30 19:51:25 -0700
commit3648447235137596b0f1ee48da1af998028d27c5 (patch)
tree084a7ddb38d8a3ec73e9fb77d028c2113ef4da20 /indra/newview
parenta29b1960c66ce533f4b7277631f6aaf93c8b1b28 (diff)
SL-15918 Experimental feature to perform multiple render passes and reduce missing content - fixed
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llfloater360capture.cpp16
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llviewerwindow.h2
4 files changed, 31 insertions, 6 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5c140fb724..3f5c12447e 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -16721,6 +16721,17 @@
<key>Value</key>
<integer>75</integer>
</map>
+ <key>360CaptureNumRenderPasses</key>
+ <map>
+ <key>Comment</key>
+ <string>Number of times to render the scene while taking a snapshot</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>2</integer>
+ </map>
<key>ResetUIScaleOnFirstRun</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index 265f6dc866..30acf36be8 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -192,8 +192,8 @@ void LLFloater360Capture::changeInterestListMode(bool send_everything)
}
if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response)
-{
- LL_INFOS("360Capture") <<
+ {
+ LL_INFOS("360Capture") <<
"InterestList capability responded: \n" <<
ll_pretty_print_sd(response) <<
LL_ENDL;
@@ -563,6 +563,15 @@ void LLFloater360Capture::capture360Images()
"negx", "negz", "negy",
};
+ // number of times to render the scene (display(..) inside
+ // the simple snapshot function in llViewerWindow.
+ // Note: rendering even just 1 more time (for a total of 2)
+ // has a dramatic effect on the scene contents and *much*
+ // less of it is missing. More investigation required
+ // but for the moment, this helps with missing content
+ // because of interest list issues.
+ int num_render_passes = gSavedSettings.getU32("360CaptureNumRenderPasses");
+
// time the encode process for later optimization
auto encode_time_total = 0.0;
@@ -596,7 +605,8 @@ void LLFloater360Capture::capture360Images()
// call the (very) simplified snapshot code that simply deals
// with a single image, no sub-images etc. but is very fast
- gViewerWindow->simpleSnapshot(mRawImages[i], mSourceImageSize, mSourceImageSize);
+ gViewerWindow->simpleSnapshot(mRawImages[i],
+ mSourceImageSize, mSourceImageSize, num_render_passes);
// encode each image and write to disk while saving how long it took to do so
auto t_start = std::chrono::high_resolution_clock::now();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 81e19e9fe2..b67842d7a1 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -5160,7 +5160,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
return ret;
}
-BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_height)
+BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_height, const int num_render_passes)
{
gDisplaySwapBuffers = FALSE;
@@ -5202,7 +5202,11 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
const bool do_rebuild = true;
const F32 zoom = 1.0;
const bool for_snapshot = TRUE;
- display(do_rebuild, zoom, subfield, for_snapshot);
+
+ for (int i = 0; i < num_render_passes; ++i)
+ {
+ display(do_rebuild, zoom, subfield, for_snapshot);
+ }
glReadPixels(
0, 0,
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index dd1a32edef..713cc51bf7 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -358,7 +358,7 @@ public:
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 simpleSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height);
+ BOOL simpleSnapshot(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 isSnapshotLocSet() const;