Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

feat(ui-mig): G1.2 window background as the design's radial gradient with grain

Veyra Goal Agent10f000e89b3f
diff --git a/docs/UI_FULL_GOAL_PLAN_2026-09-26.md b/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
index 0f8867f0..5e298b00 100644
--- a/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
+++ b/docs/UI_FULL_GOAL_PLAN_2026-09-26.md
@@ -10,7 +10,7 @@
| 阶段 | 状态 | 最后标签 | 备注 |
|---|---|---|---|
| G0 工具与基线 | 完成 | checkpoint/ui-mig-g0.7 | 设计参考 `design-ref/`、对比 `compare/`、动效曲线 `goal/g0.5/`、缓动测试 `veyra_qml_easing_tests`(构建目录 `build/qt-probe-20260926`)、门槛基线 `goal/g0.7/`(B 阶段性能对比用 `goal/g0.7/perf`) |
-| G1 基础(缓动/背景/字体/图标/组件动效) | 进行中 | checkpoint/ui-mig-g1.1 | G1.1 完成(Qt 6.8.3 BezierSpline 上限 10 段,spring 已降段);下一步 G1.2 背景 |
+| G1 基础(缓动/背景/字体/图标/组件动效) | 进行中 | checkpoint/ui-mig-g1.2 | G1.1 缓动、G1.2 背景完成(Qt 6.8.3:BezierSpline ≤10 段;CurveRenderer 不能用 fillItem);下一步 G1.3 字体 |
| G2 外壳 | 未开始 | | |
| G3 四主屏 | 未开始 | | |
| B1 小项 + 桥接补齐 | 未开始 | | |
diff --git a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md b/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
index 6dd125e7..0136724a 100644
--- a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
+++ b/docs/UI_MIGRATION_EXECUTION_2026-09-25.md
@@ -44,6 +44,7 @@
| G0.6 | 缓动单元测试 `veyra_qml_easing_tests` | 完成(修前失败,符合预期) | `checkpoint/ui-mig-g0.6` | `tests/qml/QmlEasingTests.cpp` 通过 QML 读回 NumberAnimation 的曲线,与 CSS `linear()` / `cubic-bezier` 求值比较(容差 0.01)。修前三条曲线类型均为 0(Linear),最大误差 spring 0.81、springSoft 0.76、easeOut 0.53(`goal\g0.6\before-fix.txt`)。构建目录改为 `build\qt-probe-20260926`:旧目录 CMake 不再写 `rules.ninja`,根因是 936 代码页下 include-probe 前缀乱码(与 WORKLOG 0.0.4 同一故障),`build-qt-probe.ps1` 现以 65001 调用并加 `-Out` |
| G0.7 | 全部门槛基线 | 完成 | `checkpoint/ui-mig-g0.7` | 证据 `goal/g0.7/`。构建 exit 0、stage 0;哈希 17/17 same;性能与 perf-baseline 同量级,提交 fps 全同,plain-1080 gpuReady P95 1.57→2.68ms(本轮未动引擎,按本轮基线记录);delivery PASS;单元 pass=44 fail=33 skip=3 与基线一致 |
| G1.1 | 缓动曲线改 6 值段 | 完成 | `checkpoint/ui-mig-g1.1` | 证据 `goal/g1.1/`。Theme `linearEasing()` 把 CSS linear() 停靠点逐段转三次段;veyra_qml_easing_tests 三曲线全过(spring 10 段误差 0.0068、springSoft/easeOut 0.0000)。Qt 6.8.3 缺陷:BezierSpline ≥11 段销毁时堆损坏(C++ 无 QML 复现,n≤10 正常),spring 删 28.4%/38.5% 两个停靠点降到 10 段,测试加段数上限检查(12 段版被判 FAIL,记录 12seg-caught.txt)。动效采样 dock 峰值 10.59 vs 设计 10.17、开关 14.6 vs 14.6;页面切换仍无过渡,属 G2.2 |
+| G1.2 | 窗口背景径向渐变 + 颗粒 | 完成 | `checkpoint/ui-mig-g1.2` | 证据 `goal/g1.2/`。先试 QML RadialGradient(形状对,但 7..28 级梯度量化成可见圆环,a/b/c 与拉伸图);改为 `tools/qt_probe/make-backdrop.py` 浮点计算 app.css .vy 渐变并一次抖动生成 `backdrop.png`,`VBackdrop.qml` 以 Shape fillItem 圆角裁切。Qt 6.8.3 CurveRenderer + fillItem 访问冲突(qml.exe 最小复现),改 GeometryRenderer + 4x 多重采样。六个采样块均值与设计差 ≤0.1 级、颗粒 std 0.18–0.55(设计 0.29–0.66);拉伸对比图无圆环。f-min 与改前逐像素一致,f-pro/f-node 仅背景像素变化 |
## 发现并修复的 bug
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 5de876a1..cd39c792 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -6579,3 +6579,12 @@ release. 5090 live acceptance, 15-second hitch and user flicker remain unresolve
命令:`scripts/build-qt-probe.ps1 -Targets veyra_qml_easing_tests` / `veyra_qml_ui` exit 0;
`tools/qt_probe/run-easing-tests.ps1` failures=0 exit=0(after-fix.txt);`tools/qt_probe/motion-sample.ps1 -Out goal/g1.1`:
dock 峰值 QML 10.59 / 设计 10.17,开关 14.6 / 14.6,曲线图已看;page 仍无过渡(G2.2)。
+
+- G1.2 背景(证据 `E:/项目/Veyra/logs/ui-qml-migration-20260925/goal/g1.2/`):
+ a:Shape + RadialGradient(椭圆经 fillTransform 压扁)形状对,拉伸 8 倍可见同心圆环(8 位量化);
+ b/c:叠加 160px 平铺噪声(alpha 0..2)均值对上但圆环仍在。
+ d:`tools/qt_probe/make-backdrop.py` 按 app.css .vy 以浮点计算渐变、三角分布抖动一次,生成 `qml/Veyra/backdrop.png`(1280x800,拉伸使用,
+ 渐变为盒相对故形状保持);`qml/Veyra/VBackdrop.qml` 用 Shape fillItem 取窗口圆角与 1px 描边,Main.qml 替换原线性渐变 Rectangle。
+ Qt 6.8.3 缺陷:Shape.CurveRenderer + fillItem 进程访问冲突(`tmp/.../min/Bd.qml` qml.exe exit -1073741819,GeometryRenderer exit 0),故用 GeometryRenderer + layer.samples 4。
+ 验证:`shoot-all.ps1 -Frames f-home,f-min,f-pro,f-node` + `compose-compare.ps1`,看图;六个 40px 采样块 RGB 均值与设计差 ≤0.1 级,拉伸图无圆环;
+ f-min 与 G1.2 前逐像素一致(该屏黑画面为既有差距,G3 处理),f-pro/f-node 仅背景像素变化。
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 70ff30d6..ea2ca3c1 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -76,17 +76,10 @@ Window {
// Background: pure black in cinema mode (the picture is the window), the
// three-stop gradient otherwise - the prototype's .vy / .vy.cine split.
- Rectangle {
+ VBackdrop {
id: backdrop
anchors.fill: parent
- radius: Theme.rWindow
- gradient: Gradient {
- GradientStop { position: 0.0; color: Theme.bgInner }
- GradientStop { position: 0.45; color: Theme.bgMid }
- GradientStop { position: 1.0; color: Theme.bgOuter }
- }
- border.width: 1
- border.color: root.cinema ? "transparent" : Theme.stroke
+ strokeColor: root.cinema ? "transparent" : Theme.stroke
}
// The one host item for the native video window; main.cpp finds it by name.
diff --git a/qml/Veyra/VBackdrop.qml b/qml/Veyra/VBackdrop.qml
new file mode 100644
index 00000000..a165db94
--- /dev/null
+++ b/qml/Veyra/VBackdrop.qml
@@ -0,0 +1,39 @@
+import QtQuick
+import QtQuick.Shapes
+
+// The window background, .vy in app.css: an elliptical radial gradient under a fine
+// grain. backdrop.png is that gradient computed in float and dithered once
+// (tools/qt_probe/make-backdrop.py). A QML RadialGradient was tried first: the shape
+// matched but on a 7..28 level ramp it quantised into visible rings (G1.2 evidence).
+// The CSS gradient is relative to the box, so stretching the image keeps its shape.
+// The Shape only gives it the window's rounded corners and the 1px stroke.
+Shape {
+ id: backdrop
+ property int radius: Theme.rWindow
+ property color strokeColor: Theme.stroke
+ // fillItem crashes the CurveRenderer in Qt 6.8.3 (access violation, reproduced
+ // with qml.exe); the geometry renderer is fine, with multisampling for the corners.
+ preferredRendererType: Shape.GeometryRenderer
+ layer.enabled: true
+ layer.samples: 4
+
+ Image {
+ id: fill
+ visible: false
+ width: backdrop.width
+ height: backdrop.height
+ source: "backdrop.png"
+ smooth: true
+ }
+
+ ShapePath {
+ strokeWidth: 1
+ strokeColor: backdrop.strokeColor
+ fillItem: fill
+ PathRectangle {
+ x: 0.5; y: 0.5
+ width: backdrop.width - 1; height: backdrop.height - 1
+ radius: backdrop.radius
+ }
+ }
+}
diff --git a/qml/Veyra/backdrop.png b/qml/Veyra/backdrop.png
new file mode 100644
index 00000000..1c18bfdf
Binary files /dev/null and b/qml/Veyra/backdrop.png differ
diff --git a/qml/Veyra/qmldir b/qml/Veyra/qmldir
index 1935b247..97260222 100644
--- a/qml/Veyra/qmldir
+++ b/qml/Veyra/qmldir
@@ -3,6 +3,7 @@ singleton Theme 1.0 Theme.qml
VAccordion 1.0 VAccordion.qml
VSubGroup 1.0 VSubGroup.qml
DialogHost 1.0 DialogHost.qml
+VBackdrop 1.0 VBackdrop.qml
VButton 1.0 VButton.qml
VCard 1.0 VCard.qml
VDot 1.0 VDot.qml
diff --git a/tools/qt_probe/make-backdrop.py b/tools/qt_probe/make-backdrop.py
new file mode 100644
index 00000000..4294f356
--- /dev/null
+++ b/tools/qt_probe/make-backdrop.py
@@ -0,0 +1,25 @@
+# Generates qml/Veyra/backdrop.png, the window background (G1.2), from app.css .vy:
+# background: radial-gradient(120% 90% at 12% 0%, #17171C 0%, #0C0C10 45%, #070709 100%)
+# .vy::after: fractal noise at opacity .045, mix-blend-mode overlay
+# The gradient is relative to the box (ellipse radii 1.2 w and 0.9 h, centre 0.12 w, 0),
+# so one image stretched to the window keeps the design's shape at any size.
+# Qt's own gradients quantise to 8 bits and show rings on a 7..28 ramp; here the
+# gradient is computed in float and dithered once, which is also what the grain does
+# in the design (measured there: flat areas std 0.3..0.66 level, mean ~+0.9).
+# Fixed seed, reproducible.
+import sys
+import numpy as np
+from PIL import Image
+W, H = 1280, 800
+stops = [(0.0, (0x17, 0x17, 0x1C)), (0.45, (0x0C, 0x0C, 0x10)), (1.0, (0x07, 0x07, 0x09))]
+y, x = np.mgrid[0:H, 0:W].astype(np.float64) + 0.5
+r = np.sqrt(((x - 0.12 * W) / (1.2 * W)) ** 2 + (y / (0.9 * H)) ** 2)
+r = np.clip(r, 0, 1)
+img = np.zeros((H, W, 3))
+for c in range(3):
+ img[..., c] = np.interp(r, [s[0] for s in stops], [s[1][c] for s in stops])
+rng = np.random.default_rng(20260926)
+grain = rng.random((H, W)) + rng.random((H, W)) - 1.0 # triangular, -1..1
+img += 0.9 + 0.55 * grain[..., None]
+out = np.clip(np.round(img), 0, 255).astype(np.uint8)
+Image.fromarray(out, 'RGB').save(sys.argv[1] if len(sys.argv) > 1 else 'qml/Veyra/backdrop.png', optimize=True)