Skybox 与 Skysphere
两者之间有哪些优点和缺点。特别是对于 3D 游戏之类的东西。
What are some advantages and disadvantages between the two. Especially for something like a 3D game.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
天空盒和天空球在某种意义上几乎是等效的,您将获得相同的视觉效果 - 即看起来距离很远的漂亮背景。
不过,我通常会出于以下三个原因推荐天空盒:
关于最后一点,通过创建 90 度视场,配置渲染器来生成完全适合天空盒的光线追踪方形图像非常容易,例如在 POVRay 中,您将使用如下所示的内容:
我通常使用 1024*1024 或 2048*2048 方形纹理。
我能想到使用天空球的一个很好的理由是,如果您使用某种程序纹理方法,需要在(大约)单位球体上的点处生成。然而,我认为这是一个非常特殊的情况,对于大多数游戏应用程序来说不太可能是必需的。
Skyboxes and skyspheres are pretty much equivalent in the sense that you will get the same kind of visual effect - i.e. a nice background that appears to be at a long distance away.
However I'd normally recommend a skybox for the following three reasons:
Regarding the last point, it is pretty easy to configure a renderer to produce raytraced square images that exactly fit on a skybox by creating a 90 degree field of view, e.g. in POVRay you would use something like the following:
I typically use 1024*1024 or 2048*2048 square textures for this.
The one good reason I can think of to use a skysphere is if you are using some kind of procedural texture approach that requires generation at (approximately) the points on a unit sphere. I think that is a pretty special case however, and unlikely to be necessary for most gaming applications.
为天空盒制作纹理更容易。多边形数量也会减少(但这对于今天的卡片来说可以忽略不计)。
天空盒的唯一问题是立方体的边缘在某些条件下可能是可见的。
另一个与众不同的方面是:
这里有一个很好的描述和 OpenGL 示例。
It is easier to make textures for skybox. Also polygon count will be smaller (but this is negligible with today cards).
The only problem with skybox is that the edges of the cube may be visible under certain conditions.
Another aspect that makes a difference:
A good description and OpenGL sample is here.
天空球也非常酷,因为您可以使用任何墨卡托投影图来对其进行纹理处理,并且它根本没有失真。
a skysphere is also very cool cause you can use any mercator projection map to texture it, and it have no distortion at all.
天空盒的另一个优点是能够使用立方体贴图 - 另一方面,球体贴图不是硬件加速的(据我所知)。
Another advantage of skyboxes is being able to use a cubemaps for them - sphere mapping on the other hand is not hardware accelerated (afaik).
当您使用天空盒时,您很可能会使用盒纹理。该纹理也可用于反光材料。 Skyphere 纹理在这里使用起来并不容易。
when you are using a skybox, you most likely will use a box texture. This texture can also be used for reflective materials. Skyphere textures are not that easy to use here.