使用 opencl 将软件渲染到 opengl 2d 视图上

发布于 2024-11-18 10:44:14 字数 310 浏览 10 评论 0原文

我想构建一个小型软件渲染库,因为我喜欢体素的想法,以及可能的其他替代渲染方法。请叫我天真。

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一百个冬季 2024-11-25 10:44:14

正在开发的 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.

明媚殇 2024-11-25 10:44:14

有没有更简单的方法?
也许吧,但据我所知没有。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文