在 WPF 中创建高性能动画
我遇到的情况是,需要应用许多带有透明度等效果的动画,但是当大约有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要性能,您应该考虑使用 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