如何使用 HLSL(适用于 Silverlight)创建简单的模糊滤镜?
如何使用 HLSL(用于 Silverlight)创建简单的高斯模糊滤镜?
为什么 - 我想为 Silverlight 创建一些复杂的滤镜,并且不想单独应用模糊滤镜和我的滤镜。
我需要什么?
我需要 HLSL 过滤器源。
How to create simple Gaussian Blur filter with HLSL (for Silverlight)?
Why - I want to create some complex filter for Silverlight and I do not want to apply blur filter and mine separately.
What do I need?
I need HLSL filter source.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能对你有帮助。您可以在Silverlight中编译和使用。Windows Presentation Foundation Pixel Shader效果库
This might help you. You can compile and use in Silverlight.Windows Presentation Foundation Pixel Shader Effects Library
WPF 像素着色器架构(以及一般的 HLSL 着色器)无法执行广义高斯模糊。问题是:HLSL 着色器中的滤波器内核的大小受到 HLSL 着色器中允许的操作数量的严格限制,并且高斯模糊滤波器需要任意大的滤波器内核。
无论如何,尚不清楚您是否愿意这样做。进行高斯模糊的正确方法是通过 2D 傅里叶变换进行卷积。 WPF 着色器不允许这样做。然而,那些非常勇敢的人可以尝试通过 WriteableBitmap 来做到这一点。
The WPF pixel shader architecture (and HLSL shaders in general) are not capable of doing generalized gaussian blur. The problem: the size of the filter kernel in an HLSL shader is strictly limited by the number of operations permitted in an HLSL shader, and a gaussian blur filter requires an arbitrarily large filter kernel.
It's not clear that you would want to do it this way anyway. The right way to do gaussian blur is with convolutions, via 2D Fourier transforms. WPF shaders don't permit this. However, those who are enormously brave could try doing it via a WriteableBitmap.
如果您向下滚动此处,您会发现一个示例 - 海报上写着这不适合害羞的人。 。
If you scroll down here you'll find a sample- poster says it's not for the shy...