遮挡算法集合

发布于 2024-07-15 08:24:05 字数 304 浏览 9 评论 0原文

遮挡算法在CAD和游戏行业是必需的。 我认为这两个行业的情况是不同的。 我的问题是:

  1. 这两个行业分别应用什么样的遮挡算法?
  2. 有什么区别?

我正在从事CAD软件开发,我们采用的遮挡算法是-将对象标识符设置为其颜色(整数),然后渲染场景,最后读取像素以找出可见对象。 性能不太好,所以我想在这里得到一些好的想法。 谢谢。


阅读完答案后,我想澄清一下,这里的遮挡算法意味着“遮挡剔除”——在将可见表面或实体发送到管道之前找出它们。

通过谷歌,我在

The occlusion algorithm is necessary in CAD and game industry. And they are different in the two industries I think. My questions are:

  1. What kind of occlusion algorithms are applied respectively in the two indurstries?
  2. and what is the difference?

I am working on CAD software development, and the occlusion algorithm we have adopted is - set the object identifier as its color (a integer) and then render the scene, at last, read the pixel to find out the visible objects. The performance is not so good, so I want to get some good ideas here. Thanks.


After read the anwsers, I want to clarify that the occlusion algorithms here means "occlusion culling" - find out visible surface or entities before send them into the pipeline.

With google, I have found a algorithm at gamasutra. Any other good ideas or findings? Thanks.

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

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

发布评论

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

评论(4

南街九尾狐 2024-07-22 08:24:05

在游戏中,遮挡是使用两个 3D 库之一在幕后完成的:DirectX 或 OpenGL。 具体来说,遮挡是使用 Z 缓冲区 完成的。 每个点都有一个 Z 分量,较近的点会遮挡较远的点。

遮挡算法通常由实现 DirectX 或 OpenGL 功能的专用 3D 图形处理芯片在硬件中完成。 使用 DirectX 或 OpenGL 的游戏程序将在 3D 空间中绘制对象,并让 OpenGL/DirectX 库在考虑投影和遮挡的情况下渲染场景。

In games occlusion is done behind the scene using one of two 3D libraries: DirectX or OpenGL. To get into specifics, occlusion is done using a Z buffer. Each point has a Z component, points that are closer occlude points that are further away.

The occlusion algorithm is usually done in hardware by a dedicated 3D graphics processing chip that implements DirectX or OpenGL functions. A game program using DirectX or OpenGL will draw objects in 3D space, and have the OpenGL/DirectX library render the scene taking into account projection and occlusion.

今天小雨转甜 2024-07-22 08:24:05

让我困惑的是,到目前为止,大多数答案只讨论图像顺序遮挡。
我对 CAD 不太确定,但在游戏中,遮挡从更高的级别开始,使用 BSP 树、八进制树和/或门户渲染来快速确定出现在视锥体内的对象。

It stuck me that most of the answers so far only discuss image-order occlusion.
I'm not entirely sure for CAD, but in games occlusion starts at a much higher level, using BSP trees, oct trees and/or portal rendering to quickly determine the objects that appear within the viewing frustum.

国际总奸 2024-07-22 08:24:05

您应该搜索的术语是隐藏表面删除

实时渲染通常利用一种简单的隐藏表面去除方法:背面剔除。 每个多边形都有一个“表面法线”点,该点是在距表面设定距离处预先计算的。 通过检查表面法线相对于相机的角度,您会知道表面背向,因此不需要渲染。

以下是一些交互式基于 Flash 的演示和说明

The term you should search on is hidden surface removal.

Realtime rendering usually takes advantage of one simple method of hidden surface removal: backface culling. Each poly will have a "surface normal" point that is pre-calculate at a set distance from the surface. By checking the angle of the surface normal with respect to the camera, you'd know that the surface is facing away, and therefore does not need to be rendered.

Here's some interactive flash-based demos and explanations.

尹雨沫 2024-07-22 08:24:05

硬件像素 Z 缓冲是迄今为止最简单的技术,但是在高密度对象场景中,您仍然可以尝试多次渲染同一像素,这在某些情况下可能会成为性能问题。 - 您当然需要确保您没有对数千个不可见的对象进行映射和纹理化。

我目前正在我的一个项目中思考这个问题,我发现这激发了一些想法:
http://www .cs.tau.ac.il/~dcor/Graphics/adv-slides/short-image-based-culling.pdf

Hardware pixel Z-Buffering is by far the simplest technique, however in high-density object scenes you can still be trying to render the same pixel multiple times, which may become a performance problem in some situations. - You certainly need to make sure that you're not mapping and texturing thousands of objects that just aren't visible.

I'm currently thinking about this issue in one of my projects, I've found this stimulated a few ideas:
http://www.cs.tau.ac.il/~dcor/Graphics/adv-slides/short-image-based-culling.pdf

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