Skip to content

feat: rewrite glass effect with three-stage pipeline - #1160

Closed
Groveer wants to merge 1 commit into
linuxdeepin:master-backup-20260717from
Groveer:agent/git-commit/8d92ac69
Closed

feat: rewrite glass effect with three-stage pipeline#1160
Groveer wants to merge 1 commit into
linuxdeepin:master-backup-20260717from
Groveer:agent/git-commit/8d92ac69

Conversation

@Groveer

@Groveer Groveer commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Rewrites treeland's glass effect shader and adds a three-stage rendering pipeline for improved visual quality and shadow overflow.

Changes

  • Shader rewrite (misc/shaders/liquidglass.frag): SDF-based refraction algorithm (rounded-rect SDF → surface height profile → Snell displacement → specular → inner shadow → inner rim → tint → alpha). Outer shadow removed from shader.
  • Three-stage pipeline (GlassEffect.qml): blur MultiEffect → glass ShaderEffect → shadow MultiEffect. Stage 2 uses opacity: 0 + layer.enabled for texture sampling. Stage 3 uses autoPaddingEnabled for shadow overflow beyond item bounds.
  • DConfig update (org.deepin.dde.treeland.user.json): Removed obsolete keys; added glassSpecularOpacity, glassTintOpacity, glassShadow with new defaults.
  • RoundBlur.qml: Removed obsolete property references.
  • Test updates: Added shadow/ior/thickness render difference tests; removed obsolete highlight/dispersion/light-angle tests.
  • Demo app: Updated test_glass helper and Main.qml control panel.

Parameter defaults

Parameter Default
bezelWidth 60
thickness 50
ior 3.0
specularOpacity 0.55
tintOpacity 0.08
shadow 0.5

WM-84

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Groveer, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Groveer

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1. Rewrite liquidglass.frag with SDF-based refraction algorithm
   (rounded-rect SDF, surface height profile, Snell displacement)
2. Add three-stage rendering pipeline in GlassEffect.qml:
   blur MultiEffect → glass ShaderEffect → shadow MultiEffect
3. Move outer shadow from shader to MultiEffect (Stage 3) with
   autoPaddingEnabled for shadow overflow beyond item bounds
4. Simplify glass parameters to 7 knobs: bezelWidth, thickness,
   ior, specularOpacity, tintOpacity, shadow, radius
5. Update DConfig: remove obsolete keys, add glassSpecularOpacity,
   glassTintOpacity, glassShadow with new default values
6. Update RoundBlur.qml to remove obsolete property references
7. Update test_glass helper and Main.qml for new parameter set
8. Add shadow/ior/thickness render difference tests, remove
   obsolete highlight/dispersion/light-angle tests

Log: Rewrote glass effect shader and added three-stage rendering
pipeline with MultiEffect-based outer shadow

Influence:
1. Test glass effect rendering with various parameter combinations
2. Verify glass effect toggle between liquid glass and traditional blur
3. Test backdrop blur with rounded corners in windows and panels
4. Verify lockscreen RoundBlur still works with glass disabled
5. Test DConfig parameter changes take effect at runtime

feat: 重写玻璃效果并添加三阶段渲染管线

1. 重写 liquidglass.frag,采用基于 SDF 的折射算法
   (圆角矩形 SDF、表面高度剖面、Snell 位移)
2. 在 GlassEffect.qml 中添加三阶段渲染管线:
   模糊 MultiEffect → 玻璃 ShaderEffect → 阴影 MultiEffect
3. 将外阴影从 shader 移至 MultiEffect(第三阶段),
   通过 autoPaddingEnabled 实现阴影溢出 item 边界
4. 精简玻璃参数为 7 个:bezelWidth、thickness、
   ior、specularOpacity、tintOpacity、shadow、radius
5. 更新 DConfig:移除过时 key,新增 glassSpecularOpacity、
   glassTintOpacity、glassShadow 并使用新默认值
6. 更新 RoundBlur.qml 移除过时属性引用
7. 更新 test_glass helper 和 Main.qml 适配新参数集
8. 新增 shadow/ior/thickness 渲染差异测试,移除过时的
   highlight/dispersion/light-angle 测试

Log: 重写玻璃效果着色器并添加基于 MultiEffect 外阴影的
三阶段渲染管线

Influence:
1. 测试玻璃效果在不同参数组合下的渲染
2. 验证玻璃效果与传统模糊之间的切换
3. 测试窗口和面板中带圆角的背景模糊
4. 验证锁屏 RoundBlur 在 glass 禁用时仍正常工作
5. 测试 DConfig 参数变更在运行时生效
@Groveer
Groveer force-pushed the agent/git-commit/8d92ac69 branch from 7682455 to 8399292 Compare July 16, 2026 13:30
@Groveer Groveer changed the title feat: align liquid glass effect with WebGL reference feat: rewrite glass effect with three-stage pipeline Jul 16, 2026
@Groveer
Groveer marked this pull request as ready for review July 16, 2026 14:02

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Groveer, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-bot

deepin-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.8.15
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1163

@zccrs

zccrs commented Jul 21, 2026

Copy link
Copy Markdown
Member

#1187 在这里做了

@zccrs zccrs closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants