3D 渲染 - 这个问题叫什么?

发布于 2024-07-17 07:32:38 字数 423 浏览 10 评论 0原文

希望这次是一个明智的问题......

在图片中看到上半部分的纹理看起来不错,但是下半部分(在旋转更多之后)纹理正在破裂,你可以看到内部的形状? 多边形消失了?

这个问题叫什么? 我需要知道,以便我知道在修复它时要寻找什么!

顺便说一句,我是在 Papervision 中这样做的。 如果你有机会知道解决办法(或者如果可能的话),如果你能为我指明正确的方向,我将允许你自我感觉良好。

这叫什么?

多谢多谢!

hopefully a sensible question this time...

See in the picture how the top half has the textures looking ok, but then the bottom half (after it rotated a little more)the texture is breaking up, and you can see the inside of the shape? the polygons have dissappaered?

What is this problem called? I need to know so I know what to look for when fixing it!

Incidentally, I'm doing this in Papervision. If you per chance know the fix (or if it is possible), I will give you permission to feel extra good about yourself if you can point me in the right direction.

What is this called?

Thanks heaps!

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

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

发布评论

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

评论(5

深空失忆 2024-07-24 07:32:38

我们称之为“z-fighting” - 但更常见的术语是 z-ordering 或 z-buffer 问题。

我将尝试首先在没有图表的情况下解释问题。

3D 渲染器通过从后到前绘制多边形来工作。 它通过将每个多边形分配给离散数量的位置之一来实现这一点。 这适用于大多数场景。

当没有足够的槽位来决定哪个多边形在另一个多边形前面时,就会遇到问题。

要解决这个问题 - 这将取决于您的应用程序,但有许多事情应该是所有人共同的:

  1. 确保世界的边界框尽可能小。
  2. 增加显示器的颜色深度。 OpenGL 和 Direct3D 都可以将 z 槽的数量与显示器的分辨率联系起来。
  3. 增加三角形的数量/减小三角形的大小。 较小的三角形受此影响较小 - 但会降低性能,因为需要绘制更多三角形。

如果您在 Windows 上运行,则应将桌面设置为最高颜色分辨率。 您的应用程序可能会选择它作为默认使用。

可以在 OpenGL 和 Direct3D 渲染之间切换吗? 如果是这样,那么两者都尝试一下,其中一种可能会比另一种产生更好的结果。

We called it "z-fighting" - but a more common term is z-ordering or z-buffer problems.

I'll try and explain the problem without diagrams 1st.

3D renderers work by drawing the polygons from back to front. It does this by assigning each polygon to one of a discrete number of positions. This works for most scenes.

You get a problem when there aren't enough slots to be able to decide which polygon is in front of another.

To solve it - it will depend on your application, but there are a number of things which should be common to all:

  1. Make sure the bounding box of the world is as small as possible.
  2. Increase the colour depth of your display. Both OpenGL and Direct3D can tie the number of z slots to the resolution of the display.
  3. Increase the number/decrease the size of your triangles. Smaller triangles are going to be less affected by this - but will decrease the performance as there are more to draw.

If you are running on Windows you should set the desktop to the highest colour resolution. You application might pick that up as the default to use.

Can you switch between OpenGL and Direct3D rendering? If so then try both, one might give better results than the other.

若相惜即相离 2024-07-24 07:32:38

不知何故,似乎是 Z 缓冲区问题。 不过,我不熟悉你在那里使用的东西,所以我可能无法真正提供帮助。

Seems to be a Z buffer problem, somehow. I'm not familiar with what you're using there, though, so I probably can't really help.

小情绪 2024-07-24 07:32:38

在我看来,这更像是一个出了问题的贴花,而不是深度冲突。 Z-fight 通常有一些锯齿状的边缘。 该特定三角形的投影矩阵可能是错误的(考虑到问题的程度取决于相机位置)。

Looks to me more like a decal that went wrong rather than z-fighting. Z-fighting usually has some jagged edges. The projection matrix for that particular triangle might be wrong (considering that the extent of the problem depend on the camera position).

败给现实 2024-07-24 07:32:38

它称为线性映射,它是一种在多边形上映射纹理的方法。 但这种方法没有进行透视校正,这会导致极端角度下的纹理破裂。

线性映射
透视校正纹理映射

线性纹理映射(向上)和透视校正纹理映射(向下) )。

唯一的解决方法是添加更多多边形,这会影响性能(请参阅演示)。

It's called linear mapping, it's a way to map the textures on the polygon. But this method is not perspective corrected, which leads to broken textures at extreme angles.

Linear Mapping
Perspective Corrected texture mapping

Linear texture mapping (up) and perspective corrected texture mapping (down).

The only workaround is to add more polygons, which will hit performance (See this demo).

北方。的韩爷 2024-07-24 07:32:38

您是否有多个重叠的纹理和/或多边形?

从这里看来,这看起来像是当您拥有完全重合的曲面时遇到的问题,但浮点错误意味着您不能始终看到正确的曲面。

Do you have multiple overlayed textures and/or polygons?

From here it looks like the problem you get when you have exactly coincident surfaces, but floating point errors mean that you don't consistently see the right one.

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