为什么OpenGL的有远剪裁平面,什么成语是用来对付呢? [英] Why does OpenGL have a far clipping plane, and what idioms are used to deal with this?

查看:481
本文介绍了为什么OpenGL的有远剪裁平面,什么成语是用来对付呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在学习的OpenGL,以及一个话题一直困扰我的是远剪裁平面。虽然我能理解近裁剪平面背后的原因,以及侧裁剪平面(这不会有任何实际效果,因为他们之外的对象永远不会无论如何渲染),远剪裁平面看来只能是一个烦恼。

I've been learning OpenGL, and the one topic that continues to baffle me is the far clipping plane. While I can understand the reasoning behind the near clipping plane, and the side clipping planes (which never have any real effect because objects outside them would never be rendered anyway), the far clipping plane seems only to be an annoyance.

由于这些落后的OpenGL已经明显经过想到这,我知道一定有我丢失的东西。为什么OpenGL的有远剪裁平面?更重要的是,因为你不能将其关闭,有什么推荐的成语和实践借鉴的东西,在巨大的距离时使用(对于对象,如星上千家单位之外的空间游戏,天空盒等)?你希望只是为了让裁剪面很远的地方,还是有更好的解决方案?如何在产品软件这样做?

Since those behind OpenGL have obviously thought this through, I know there must be something I am missing. Why does OpenGL have a far clipping plane? More importantly, because you cannot turn it off, what are the recommended idioms and practices to use when drawing things at huge distances (for objects such as stars thousands of units away in a space game, a skybox, etc.)? Are you expected just to make the clipping plane very far away, or is there a more elegant solution? How is this done in production software?

推荐答案

的唯一原因是深度 - precision。因为你只有位的深度缓存数量有限,你也可以只重新present深度有限的吧。

The only reason is depth-precision. Since you only have a limited number of bits in the depth buffer, you can also just represent a finite amount of depth with it.

不过,您可以设置远平面到无穷远:请参见这个。它只是将不能很好地工作与深度缓冲 - 你会看到有很多的文物,如果您有遮挡远

However, you can set the far plane to infinitely far away: See this. It just won't work very well with the depth buffer - you will see a lot of artifacts if you have occlusion far away.

所以,因为这是围绕深度缓冲区,你不会有处理进一步外卖的东西出了问题,只要你不使用它。例如,常用的方法是渲染场景中的砖,每只能使用深度缓冲区内(对所有的东西在一个平板),但某种形式的画家算法的外部(为砖,让你画最远1第一)

So since this revolves around the depth buffer, you won't have a problem dealing with further-away stuff, as long as you don't use it. For example, a common technique is to render the scene in "slabs" that each only use the depth buffer internally (for all the stuff in one slab) but some form of painter's algorithm externally (for the slabs, so you draw the furthest one first)

这篇关于为什么OpenGL的有远剪裁平面,什么成语是用来对付呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆