Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guassian Blur(Win7 aeroglass, Mac/iOS UI blur) Feature #29

Open
sekkit opened this issue Apr 8, 2018 · 13 comments
Open

Guassian Blur(Win7 aeroglass, Mac/iOS UI blur) Feature #29

sekkit opened this issue Apr 8, 2018 · 13 comments
Labels
2.0 This will be fixed in GacUI 2.0

Comments

@sekkit
Copy link

sekkit commented Apr 8, 2018

Built-in blur effect would be cool.
With shader that can be achieved easily in Game Engines. But ordinary desktop's GUI depends on OS implementation.
Is it possible to implement high performance - high quality Blur effect just can be easily enabled by a xml tag?

@vczh
Copy link
Member

vczh commented Apr 11, 2018

I have not looked into that yet. The default engine is Direct2D, and everything is writing to a render target. If Direct2D enable you to blur something that has already been rendered to a render target, then your idea is doable. Do you have any idea?

@sekkit
Copy link
Author

sekkit commented Apr 13, 2018

How do you achieve crossplatform with D2D? Maybe you should reference NoesisGUI because it supports various render backend as well as Data-binding like WPF.
I think if u implement the UI lib with a set of stable backend APIs then it's possible to be crossplatform with the same codebase.
As for blur, if u get the render buffer and apply blur algorithm onto that bitmap, then it should be done. Shader might be a good way to go.
I don't know the difference between NoesisGUI and GacUI, sorry for that because I am only familiar with limited Game GUIs.

As a developer, I would like to have a slim GUI library which can switch difference themes(2k, xp, win7) in one line of code, also plenty ui effects to choose.

@vczh
Copy link
Member

vczh commented Apr 14, 2018

@sekkit if you take a look at iGac repo you will find out that I achieve cross platform by writing different renderers and windowing provider for each platform I want to support. But unfortunately the maintainer of iGac are not working so the progress doesn't catch up. I get some idea from WPF actually.

So for the blur feature, I need to solve it for each platform if I want to add it.

GacUI are going to be able to switch between themes by calling one function but it is not done yet. The good news is, all fundamental building blocks are done, I just need to write a recursive function to tell the control tree to switch the theme. The bad news is that, I didn't create those 2k xp and win7 themes. Maybe someday I will do that, or maybe users will create by themselves.

@vczh
Copy link
Member

vczh commented Apr 14, 2018

@sekkit you can track my progress by reading this file

By the way, for the blur feature, are you really want the native aeroglass in Win7, or just simulating aeroglass?

@sekkit
Copy link
Author

sekkit commented Apr 20, 2018

OS independent, 就是跨平台的aeroglass

@sekkit
Copy link
Author

sekkit commented Apr 20, 2018

FlashGet 3可以一键切Xp主题(内置的),很漂亮。
Win的主题除了Win8,10,其它都好看。Win10之后微软的GUI已经没有审美了。
如果没有内置的话,我感觉跟wpf比没啥区别,不同平台做个UI现在已经不是个难事, 哪怕是Electron都有不错的效果。
NeosisGUI,这个也是c++/xaml的,你要不也扩展下游戏领域~~

@vczh
Copy link
Member

vczh commented Apr 21, 2018

@sekkit 皮肤可以慢慢做,Windows游戏开发的话,Direct2D跟Direct3D10以上都是兼容的,算燃气可以直接用,换个window provider就好了。aeroglass肯定还是尽量寻求操作系统支持,据说Win8之后已经没有这个功能了。

@sekkit
Copy link
Author

sekkit commented Apr 21, 2018

glass8.eu -- AeroGlass Plugin for Win10
www.mactype.net -- freetype rendering for Windows

本质上就是个Gaussian Blur + 颜色混合吧,我觉得第三方能实现的话,其实就是个方法和效率的问题了。我都用QT实现过,有点卡。但是那个插件不卡。

如果装了Win7,那直接调DwmEnableComposition API好了,我说的是,在任何PC系统上,直接Show出Win7风格的效果~~~

因为本人做业余小项目一定会遇到这些问题,所以就提了下,当然这不是刚需。

image

顺便还可以加个TextShadow效果,这个用qt很容易实现,gac也可以弄一个。

image

image

MacOS like 磨砂效果~~QT弄的,GacUI也可以有。以上都是纯矢量的绘制,如果用位图来做性能应该会好点。

@vczh
Copy link
Member

vczh commented Apr 22, 2018

你怎么画的,真的是取背景图自己磨砂吗?说来这个算法还是Unity的面试题来着(逃

@sekkit
Copy link
Author

sekkit commented Apr 22, 2018

Nope. http://doc.qt.io/qt-5/graphicaleffects.html GUI直接有。自己实现的效率不一定好~
以前试过WPF在非Win7上实现磨砂效果,性能很差,这些消耗高的算法应该做在c++层吧

@vczh
Copy link
Member

vczh commented Apr 23, 2018

得用D3D写shader做,不能直接CPU坐的

@vczh vczh added the 2.0 This will be fixed in GacUI 2.0 label Apr 16, 2020
@roodkcab
Copy link
Member

maybe should use stackblur / boxblus instead of guassian blur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 This will be fixed in GacUI 2.0
Projects
None yet
Development

No branches or pull requests

3 participants