我是否错误地渲染了 BSP 树?

发布于 2024-12-27 07:52:49 字数 353 浏览 0 评论 0原文

我已将 BSP 树加载到内存中。我首先找出我所在的叶子。接下来,我解码 PVS。然后,我遍历该 PVS 中的每个区域,看看它是否位于我的视锥体内。

我被告知这是错误的渲染方式,我实际上应该通过遍历 BSP 树来进行从后到前的渲染。我到底该怎么做?我已经看到了许多不同的方法来做到这一点,这就是我问的原因。

例如,Quake 3 BSP 渲染显示: 遍历 BSP 以确定相机位于哪一片叶子中。 检索并解压缩该叶子的 PVS,迭代 PVS 并在 BSP 中标记叶子。 从近到远遍历 BSP 如果节点未标记,则跳过它。 针对相机平截头体测试节点边界框​​。 将当前的叶子添加到再现列表中

这仍然是当今的标准方式吗,或者至少对于更简单的游戏来说是这样。

I have a BSP tree loaded into memory. I first find out what leaf I am in. Next, I decode the PVS. Then, I run through each region in that PVS and see if it lies within my frustum.

I have been told that this is the incorrect way to render and that I should actually be doing a back to front rendering by traversing the BSP tree. How exactly do I do this? I have seen a number of different methods of doing this, that's why I ask.

For instance, the Quake 3 BSP rendering says:
Traverse the BSP to determine in which leaf the camera is positioned.
Retrieve and decompress the PVS for this leaf, iterate through PVS and mark leaves in the BSP.
Traverse the BSP near to far
If a Node is not marked, skip it.
Test the Node Boundary Box against the Camera Frustrum.
Add the current leaf to the rendition list

Is this still the standard way it is done today or at least for simpler games.

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

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

发布评论

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

评论(1

御弟哥哥 2025-01-03 07:52:49

正如 OrgnlDave 所说:

当你绘制图元时,放置在 z 缓冲区前面的像素将被绘制,并且程序着色器将被执行。但如果像素位于场景后面,则该像素将被拒绝。没有义务从前到后进行这样的绘制,但性能的提升是最糟糕的。

但是,如果您使用混合对象,则需要在每个实体对象之后绘制这个对象,并从后到前进行。因为您需要将颜色与紧随其后放置的对象混合。

As OrgnlDave said:

When you draw a primitive, the pixels placed in front of the z-buffer will be paint and the program shader will be executed. But if the pixel is behind the scene then the pixels is rejected. There is no obligation to made such of drawing, front to back, but the gain in performance is worst it.

However if you using blend object you will need to draw this one after every solid object and do it from back to front. Because you need to blend the color with the object placed just after.

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