WPF 高性能绘图 - 我应该按画笔颜色分组吗?
在 Direct2D 中,他们建议将相似的事物绘制在一起,以避免不必要的 GPU 状态更改。为此,他们还在幕后进行了一些绘图操作重新排序。
我必须绘制很多可以具有两种颜色之一的矩形。我正在考虑分两次绘制,一次用于第一种颜色的矩形,另一次用于具有另一种颜色的矩形。
您知道这是否会提高渲染速度吗?我现在的速度还没有那么快。我绘制到从 DrawingVisual 获得的 DrawingContext 中。
In Direct2D they recommend drawing similar things together, to avoid unnecessary GPU state changes. They also do some drawing operation reordering behind the scene just for that.
I have to draw a lot of rectangles which can have one of two colors. I'm thinking of doing the drawing in two passes, one for the rectangles with the first color and another for the ones with the other color.
Do you have any idea if this will improve the rendering speed? The speed I have right now is not that great. I draw into a DrawingContext obtained from a DrawingVisual.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真的不知道按画笔分组会产生什么效果,但是您应该首先检查一些事情:
阅读:http://msdn.microsoft.com/en-us/magazine/ dd483292.aspx
I really don't know what effect grouping by brush will have, but there are some things you should check first:
Read: http://msdn.microsoft.com/en-us/magazine/dd483292.aspx