【发布时间】:2015-10-26 08:37:06
【问题描述】:
我正在 PC 上开发一些 AR(增强现实),我有摄像头捕捉,检测到某些标记特征,并将内存转储到 GPU 以在图像上渲染虚拟对象。我使用食人魔引擎。
/** Convenience function that blits a pixelbox from memory to the entire
buffer. The source image is scaled as needed.
@param src PixelBox containing the source pixels and format in memory
@note Only call this function when the buffer is unlocked.
*/
mTexture->getBuffer()->blitFromMemory(mPixelBox);
对于 720P 图像输入,大约需要 100 毫秒,这对于渲染来说是不希望的。我有 i5-4460 @ 3.20GHz、16G 内存和 Geforce GTX 660 卡。
我知道 CPU 和 GPU 内存之间存在差距,但如果我只显示 720P 视频输入和 amcap,它只有 30fps。从 GPU 渲染的屏幕上是否出现任何内容?如何知道CPU和GPU显存的速度?
【问题讨论】:
-
不确定这与 cuda 有什么关系
-
这个 blitFromMemory 看起来像一个沉重的解决方案(缩放纹理......)。寻找一种更直接地加载纹理的方法,例如当它来自文件时。
-
如果你想在屏幕上渲染虚拟对象,你可能应该看看像 OpenGL 这样的图形库。