在 WPF 中创建高性能动画

发布于 2024-08-10 03:16:20 字数 356 浏览 4 评论 0原文

我遇到的情况是,需要应用许多带有透明度等效果的动画,但是当大约有 10 个动画正在运行时,我的应用程序就会减慢直至停止! :(

我还尝试使用 CompositionTarget.Rendering 事件使用逐帧手动动画来实现类似粒子的效果,这会在给定的帧速率下更改图像的 Source 属性。同样,这对于粒子的前几个实例来说效果很好屏幕上,但是当添加越来越多的内容时,我需要它保持性能明智,这对于任何应用程序来说始终是一个艰难的要求,

我想知道是否有人有在 WPF 中使用像素着色器进行动画或自定义可写位图进行动画的经验?

如果可能的话,我基本上需要将大部分动画处理交给 GPU...

您提供的任何帮助!

感谢 标记

I'm in a situation that requires many animations with effects like transparency to be applied but when there are about 10 of them running, my application slows down to a grinding halt! :(

I also, tried implementing a particle like effect using a frame by frame manual animation using the CompositionTarget.Rendering event, which changed an Image's Source property at a given framerate. Again, this works fine for the first few instances of the particles on the screen, but when more and more get added I need it to stay performance wise, which is always a tough ask for any application

I was wondering if anyone has any experience using pixel shaders in WPF for animations, or perhaps custom writeablebitmap's for animations?

I basically need to palm off most of the animation processing to the GPU if possible...

Thanks for any help you can give!

Cheers,
Mark

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑾兮 2024-08-17 03:16:20

如果您想要性能,您应该考虑使用 XNA。
然后,您可以将 XNA 项目添加到您的 WPF 应用程序中

If you want performance you should think about using XNA instead.
Then, you can add the XNA project into your WPF app

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文