在 WPF 中使用着色器进行水模拟
我正在寻找一种在 WPF 中实现水效果的方法,例如 李·惠特尼的博客。这是针对全屏应用程序,因此它应该依赖着色器才能利用 GPU。
到目前为止我已经找到了以下方法&代码示例:
- WPF : 这个例子不符合要求 模拟水滴,因为它呈现一个水波纹。 然而,由于使用着色器,它的执行速度快如闪电。我尝试添加 几层涟漪叠在一起,但看起来并不像 也对。
- Silverlight:此实现提供了正确的功能 模拟水滴及其相互作用的术语,而不是 渲染出一圈涟漪。然而它的表现根本不好。我 怀疑该示例可能根本不使用 GPU,但会计算每个 软件中位图的像素。我可能误解了代码 虽然我对 silverlight
- [C++] 不强:这个例子与 silverlight 例子类似。它 执行速度要快得多,但是当缩放到全高清尺寸时,它也会变得太快 慢的。与 silverlight 一样,在我看来,这个例子是 严重依赖软件计算。
- Windows Surface 似乎有类似的效果工具 池塘应用。天知道他们是怎么做到的。
有什么想法吗?
I am searching for a way to implement a water effect for in WPF like the one demonstrated on Lee Whitney's blog. This is for a full screen application so it should rely on shaders in order to utilize the GPU.
So far I have found the following methods & code examples:
- WPF: This example does not live up to the requirements of
simulating drops of water, as it renders one single water ripple.
However it performs lightning fast as it uses shaders. I tried to add
several layers of ripples on top of each other but that did not look
right either. - Silverlight: This implementation offers the right features in
terms of simulating drops and their interaction as opposed to
rendering one ripple. However it does not perform well at all. I
suspect the example may not use the GPU at all but calculates every
pixel of the bitmap in software. I may have misunderstood the code
though as I am not strong in silverlight - [C++]: This example is similar to the silverlight example. It
performs a lot faster, but when scaled to a full HD size it gets too
slow. As with silverlight it appears to me that the example is
relying heavily on software calculations. - Windows Surface appear to have a similar effect implement in their
pond application. God knows how they did it.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看这个令人惊奇的库。 http://perspectivefx.codeplex.com/
Take a look at this amazing lib. http://perspectivefx.codeplex.com/
不是真正的答案,但看看这个 WPF Shaders
我也在学习,找到了这个资源,希望对你有帮助。
Not really an answer, but look at this WPF Shaders
I'm learning too, and found this resource, hope this helps you.