使用VBO或着色器渲染BSP? OpenGL

发布于 2025-01-03 03:28:34 字数 115 浏览 1 评论 0原文

是否可以在着色器中渲染游戏中的 BSP 文件?着色器中是否可以有 VBO 还是需要在客户端渲染?

另外,对于 VBO,从当前的 PVS 和视锥体创建可见面数组,然后通过匹配纹理进行批量渲染是否有意义?

Is it possible to render BSP files from games from within shaders? Is it possible to have a VBO in a shader or does it need to be rendered client side?

Also for VBOs does it make sense to create an array of visible faces from your current PVS and frustum and then render then in batches by matching textures?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

压抑⊿情绪 2025-01-10 03:28:34

着色器不能直接引发渲染。它无法导致 OpenGL 渲染某些数据。着色器是渲染管道的一部分,并且该管道是单向的;不允许循环。

在基于 GL 4.x 的硬件中,着色器理论上可以以特定格式写入数据,这些数据将通过“间接”渲染函数之一读取。但客户端代码(CPU)仍然必须实际发出绘图命令。

使用像 OpenCL 这样的计算语言来做可见性的事情可能会更好。 OpenGL 着色器可以做到这一点,但它们的设计不够直观。 OpenCL 是一个通用计算系统,它被设计用来做这类事情。

A shader cannot directly provoke rendering. It cannot cause OpenGL to render some data. Shaders are part of the rendering pipeline, and that pipeline goes one way; it isn't allowed to loop.

In GL 4.x-based hardware, a shader could theoretically write data in a specific format that will be read via one of the "Indirect" rendering functions. But the client code, the CPU, still must actually issue the drawing command.

It's probably better to do visibility stuff in a compute language like OpenCL. OpenGL shaders are capable of it, but they're not well designed to make doing that intuitive. OpenCL is a general compute system, and it is designed to do that sort of thing.

無處可尋 2025-01-10 03:28:34

是否可以在着色器中渲染游戏中的 BSP 文件?

有了很多 PITA,在 OpenGL-4 类系统上就有可能实现。但为什么?一旦你开始朝这个方向思考,你就在做一些根本性错误的事情。我敢打赌,当前 GPU 上这种基于纯着色器的 BSP 渲染器的性能实际上优于 10 年前的 GeForce2 和编写良好的客户端代码。

请记住各位:在着色器中执行操作 =/= 高性能

OpenGL 从来没有、也永远不会成为一个独立的渲染引擎。它一直被认为是用于自定义编写的渲染器的后端光栅化器 API。

Is it possible to render BSP files from games from within shaders?

With a lot of PITA it may be possible on OpenGL-4 class systems. But, why? As soon as you start thinking in that direction you're doing something fundamentally wrong. And I'd bet, that such a pure-shader based BSP renderer on a current GPU was actually outperformed by a 10 year old GeForce2 and well written client side code.

Remember folks: Doing things in the shader =/= High performance

OpenGL never has been, and never will be a self-contained rendering engine. It's always been meant as the backend rasterizer API for a customly written renderer.

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