使用 opencl 将软件渲染到 opengl 2d 视图上
我想构建一个小型软件渲染库,因为我喜欢体素的想法,以及可能的其他替代渲染方法。请叫我天真。
在 win7 系统上使用带有代码块的 vanilla c++,但具有跨平台的意图。使用glfw进行窗口管理。
我的计划是使用 gpgpu 进行 opencl(并行)计算,然后使用 OpenGL(在 2D 视图中)进行跨平台上下文管理和帧显示。
因此,使用 gpgpu 进行加速计算,但由我来定义这些计算的用途。并要求 OpenGL 在屏幕上绘制我的结果。
有没有更简单的跨平台方法将我自己的渲染图显示到屏幕上?
这个提议的方法很棒吗?
I want to build a little software rendering library, because I like the idea of voxels, and the possible other alternative methods of rendering. Call me naive.
Using vanilla c++, with codeblocks, on a win7 system but with cross-platform intent. Using glfw for window management.
My plan is to use the gpgpu for opencl (parallel) calcs, then using OpenGL (in 2D view) for cross-platform context management and frame display.
Thus using the gpgpu for accelerated calcs, but leaving it up to me to define what those calcs are for. And asking OpenGL to just draw my results on screen.
Is there any easier cross platform way of putting my own renderings to screen?
Is this proposed method awesome, or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正在开发的 glfw3 可以访问本机 opengl 上下文。您可以使用它来创建互操作 opengl 上下文。不过我自己还没有尝试过。
glfw3, which is under development has access to native opengl contexts. you can use that to create an interop opengl context. I haven't tried it yet myself though.
有没有更简单的方法?
也许吧,但据我所知没有。
OpenCL 支持 OpenGL 互操作,这使得您想要做的事情变得非常快。
(我自己用过它,它很快,但可能没有我想要的那么快,但我以一种低效的方式使用它)
这很棒吗?也许吧,但请记住,opencl 无法使用 opengl 可以使用的所有硬件,因此如果可能,请使用 opengl 进行图形处理。
Is there any easier way?
Maybe, but none that I'm aware of.
OpenCL supports OpenGL interop, which makes what you're trying to do very fast.
(i've used it myself, and it was fast, but maybe not as fast as I would have liked, but I used it in a inefficient way)
Is this awesome? Maybe, but remember that opencl can't use all the hardware that opengl can, so if possible, use opengl for graphics.