GDI+像素级渲染性能
我正在制作一些基于算法的动画,该算法应该以 800 x 600 分辨率渲染场景。它本质上会以不低于 30 FPS 的速度重新绘制每个“帧”的每个像素。
这可能吗?
我想我会画位图。
谢谢
I am doing some animation based on an algorithm that is supposed to render a scene at 800 x 600 resolution. It will essentially be redrawing each pixel for every "frame" at, hopefully, no less than 30 FPS.
Would this be possible?
I guess I would be drawing bitmaps.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
大多数硬件上最快的位图像素格式是 32PArgb。当使用 Graphics::DrawImage() 未缩放时,在我的笔记本电脑上绘制 800x600 位图大约需要 8.5 毫秒。它具有不错的图形硬件。对于其他像素格式,该时间最多为 12 毫秒。
您无法预测渲染场景需要花费多少时间。这将设置您真正的 FPS 限制。 DirectX 和 XNA 等图形库将纹理位图存储在视频内存中以加快渲染速度,而您无法从 GDI+ 中获得这一点。
The fastest bitmap pixel format on most hardware is 32PArgb. A 800x600 bitmap takes about 8.5 milliseconds on my laptop when drawn unscaled with Graphics::DrawImage(). It has decent graphics hardware. This goes up to 12 msec for other pixel formats.
What you can't predict is how much time you'll burn rendering the scene. That's going to set your true FPS limit. Graphics libraries like DirectX and XNA store texture bitmaps in video memory to speed up the rendering, you won't get this from GDI+.
您还没有告诉我们您打算如何绘制场景(使用什么方法)。如果“像素级”渲染是指调用
SetPixel()
方法,那么您应该看看 http://supercomputingblog.com/graphics/using-lockbits-in-gdi/You haven't told us how you intend to draw the scene (using what method). If by "pixel level" rendering you mean calling
SetPixel()
method, you should take a look at things like http://supercomputingblog.com/graphics/using-lockbits-in-gdi/现代硬件的推动远远超出了这些需求。
The push of modern hardware is way, way, way in excess of those demands.