flustum在GPU上剔除

发布于 2025-01-21 13:33:22 字数 590 浏览 0 评论 0原文

我是一个3D计算机图形学习者,我想实现frustum culling以在GPU上工作。我已经使用软件渲染系统实现了它。这种摘要与多边形一起使用至少3个顶点,如果它在粉状之外,则在内部的圆环上添加了一个新点。 这是算法实现>。

而且,正如我想在GPU上实现该算法一样,我有几个问题:

  1. 我正在考虑用几何形式着色器实现froustum culling,但这似乎我无法cull uvs坐标,这是正确的?还是有一种方法可以通过,以某种方式通过这些紫外线的坐标,用几何形状着色器剔除它们,然后将它们传递到碎片着色器旁边?
  2. 我想在顶点着色器中实现它,但是我无法获得当前三角的所有顶点吗?也许我只是不太了解每张脸所有顶点的方法?我不只是一个一个顶点一个顶点吗?

也许我只是不知道在GPU上实现flustum淘汰的正确方法。可以有更好的算法来实现frustum culling吗?谢谢。

I am a 3D computer graphics learner and I want to implement frustum culling to work on the gpu. I've already implemented it with software rendering system. That culling worked with polygon with minimum of 3 vertices and, if it was outside the frustum, added a new point on the frustum inside. Here is algorithm implementation just in case.

And, as I want to implement that algorithm on the gpu, I have several questions with it:

  1. I was thinking to implement frustum culling with geometry shader, but that seems that I won't be able to cull UVs coordinates then, is it Right? Or there is a way to pass, somehow, those UV's coordinates, cull them in geometry shader, and pass them next to the fragment shader?
  2. I thought to implement it in vertex shader, but won't I be able to get all vertices for current triangle? Maybe I just don't quite know a way to corretly get all vertices per face? Wouldn't I just to cull only one by one vertex?

Maybe I just don't know the right way to implement frustum culling on gpu. Can there be a better algorithm to implement frustum culling? Thanks.

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

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

发布评论

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

评论(1

呢古 2025-01-28 13:33:22

我相信您已经实施的是'剪裁'

' frustum culling '通常是指您整体上丢弃隐形元素的技术,我相信这不是您在这里要求的。

返回剪辑,

默认情况下,图形API将在归一化的设备坐标空间中夹住多边形。例如,使用OpenGL,将在顶点着色器后自动剪辑2x2x2 Cube的侧面(0,0,0)。

I believe what you have implemented is 'clipping'.

'frustum culling' usually refers to a technique where you discard invisible elements as a whole and I believe that is not what you are asking here.

back to clipping,

Graphics API by default will clip polygons in normalized device coordinate space. For example with OpenGL, out side of 2x2x2 cube with center at (0,0,0) will be clipped automatically after the vertex shader.

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