简体   繁体   English

CUDA-将OpenGL渲染的图像复制到2D数组

[英]CUDA - copy OpenGL rendered image to 2D array

Is it possible, to render a scene using OpenGL and than somehow copy rendered image to, for example, 2D array using CUDA? 是否可以使用OpenGL渲染场景,然后以某种方式使用CUDA将渲染的图像复制到2D数组中? I'd need to place a result in bool picture[resX][resY] array, where true = coloured pixel, false = empty space. 我需要将结果放置在bool picture[resX][resY]数组中,其中true =彩色像素,false =空白。

Thanks is advance for any suggestions! 感谢您的任何建议!

You could render to a PBO in OpenGL and then subsequently map this to a CUDA texture. 您可以在OpenGL中渲染到PBO,然后将其映射到CUDA纹理。 Have a look at the OpenGL interop documentation for some pointers 看看OpenGL互操作文档中的一些指针

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM