Make the visibility/opacity of the composition guides in snapshot view configurable via debug setting, as per request

master
PanteraPolnocy 2025-10-10 08:19:01 +02:00
parent 2ab023156b
commit 9267076ebb
4 changed files with 18 additions and 1 deletions

View File

@ -359,6 +359,7 @@ public:
SNAPSHOT_BORDER_THICKNESS, // "border_thickness"
SNAPSHOT_GUIDE_COLOR, // "guide_color"
SNAPSHOT_GUIDE_THICKNESS, // "guide_thickness"
SNAPSHOT_GUIDE_VISIBILITY, // "guide_visibility"
SNAPSHOT_GUIDE_STYLE, // "guide_style"
SNAPSHOT_FRAME_RECT, // "frame_rect"
// </FS:Beq>

View File

@ -26650,6 +26650,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<real>1.0</real>
</map>
<key>FSSnapshotFrameGuideVisibility</key>
<map>
<key>Comment</key>
<string>The visibility/opacity of the composition guides (0.0 = invisible, 1.0 = fully visible)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.05</real>
</map>
<key>FSManipRotateJointUseNaturalDirection</key>
<map>
<key>Comment</key>

View File

@ -7,6 +7,7 @@ uniform vec3 border_color;
uniform float border_thickness; // in pixels
uniform vec3 guide_color;
uniform float guide_thickness; // in pixels
uniform float guide_visibility; // visibility/opacity of guides (0.0 - 1.0)
uniform float guide_style; // 0: no guide, 1: rule of thirds, 2: golden spiral
in vec2 vary_fragcoord;
@ -68,7 +69,7 @@ void main()
(tc.y > frame_rect_px.y + third_y - guide_thickness && tc.y < frame_rect_px.y + third_y + guide_thickness) ||
(tc.y > frame_rect_px.y + 2.0 * third_y - guide_thickness && tc.y < frame_rect_px.y + 2.0 * third_y + guide_thickness))
{
diff.rgb = mix(diff.rgb, guide_color, 0.5);
diff.rgb = mix(diff.rgb, guide_color, guide_visibility);
}
}
}

View File

@ -8101,6 +8101,7 @@ bool LLPipeline::renderSnapshotFrame(LLRenderTarget* src, LLRenderTarget* dst)
static LLCachedControl<LLColor3> guide_color(gSavedSettings, "FSSnapshotFrameGuideColor", LLColor3(1.f, 1.f, 0.f));
static LLCachedControl<F32> border_thickness(gSavedSettings, "FSSnapshotFrameBorderWidth", 2.0f);
static LLCachedControl<F32> guide_thickness(gSavedSettings, "FSSnapshotFrameGuideWidth", 2.0f);
static LLCachedControl<F32> guide_visibility(gSavedSettings, "FSSnapshotFrameGuideVisibility", 0.05f);
F32 guide_style = 1.f; // 0:off, 1:rule_of_thirds, others maybe in the future
if (!show_guides)
@ -8228,6 +8229,9 @@ bool LLPipeline::renderSnapshotFrame(LLRenderTarget* src, LLRenderTarget* dst)
shader->uniform1f(
LLShaderMgr::SNAPSHOT_GUIDE_THICKNESS,
(GLfloat)guide_thickness);
shader->uniform1f(
LLShaderMgr::SNAPSHOT_GUIDE_VISIBILITY,
(GLfloat)guide_visibility);
shader->uniform1f(
LLShaderMgr::SNAPSHOT_GUIDE_STYLE,
(GLfloat)guide_style);