远距离 3D 对象渲染 [游戏] [英] Distant 3D object rendering [games]

查看:30
本文介绍了远距离 3D 对象渲染 [游戏]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

技术背后的基本前提是什么,例如 Oblivion(以及其他游戏,我敢肯定;我还没有玩过足够了解),其中当您从远处观看时,远处的物体会模糊地显示出来?例如,一英里外的一座大塔,你会看到它的模糊矩形从地平线上伸出……显然一个巨大的 3D 场景不能全部渲染,我知道在高度图的情况下只有近似算法用于降低远离相机的高度图质量,但对于特定对象,显示这些的最佳方式是什么?

What is the basic premise behind technology such as is found in Oblivion (and other games, I'm sure; haven't played enough to know), wherein objects from afar are vaguely shown when you view them from a distance? For example, a large tower is a mile away and you see the vague rectangle of it sticking up from the horizon... Obviously a giant 3D scene cannot all be rendered, and I know that in the case of heightmaps there are just approximation algorithms that are used to reduce the heightmap quality further away from the camera, but for specific objects, what is the best way to show those?

我在考虑可能是一种预渲染技术,在这种技术中,您可以选择景观周围的特定位置,然后制作一个程序,在该位置周围绘制所有高度图和 3D 模型并拍照.它会拍几张照片,然后当玩家靠近那个地点时,这些照片就会被用作天空盒.

I was thinking perhaps a pre-rendering technique, wherein you pick specific places around the landscape and then make a program that draws all of the heightmap and 3D models around that spot and takes a picture. It would take several pictures, and then when the player is near that spot, the pictures would be used as a skybox.

另一种更明显的技术是存储非常粗糙的 3D 模型,但是 3D 渲染系统如何专门选择渲染建筑物的粗糙模型,而不是其他不太重要的(可能是不可见的)的粗糙模型?-那个距离)物体?你将如何将这样的东西与你的高度图一起存储?也许按照设计,只有几个这样重要的地标,然后将它们的列表存储在一个小文件中,并在每一帧渲染小于 x 真正远距离的那些?

Another more obvious technique is to store really rough 3D models, but then how does the 3D rendering system specifically choose to render the rough model of the building and not the rough models of other less significant (and probably not-viewable-from-that-distance) objects? How would you store something like that along with your heightmap? Maybe by design, only have a few such significant landmarks and then just store the list of them in a small file, and on each frame render the ones that are less than x really-far-distance away?

我知道《光环》系列选择将游戏分为多个级别,然后每个级别都有不同的手工制作的天空盒.这就是我在第一个建议中想要的,但我不确定.我想我真的只是想收集我的想法中的其他想法或改进或问题,以便我可以用我有限的时间和知识来选择哪些原型.

I am aware that the Halo series chooses to divide the game into levels and then each level has a different hand-made skybox. This is kind of what I was going for in the first suggestion, but I'm not sure about it. I guess I'm really just trying to collect other ideas or refinements or issues in my ideas, so that I can choose which ones to prototype with my limited time and knowledge.

另一个相关主题是如何在远处显示山脉,因为它们将是高度图的一部分,而不是位于其顶部的 3D 模型,因此它们实际上无法获得粗略的版本,以及高度图的近似值算法可能会像那样从很远的距离把山搞砸(假设您甚至会尝试近似和渲染如此遥远的几何图形,而您可能不会这样做).如果您在答案中也涵盖了这一点,则可以加分.:)

Another related topic is how to display mountains at a distance, since they would be part of the heightmap and not 3D models on top of it, so they wouldn't really be able to have a rough version, and the heightmap approximation algorithm might screw up the mountain from a really far distance like that (assuming you would even try to approximate and render such distant geometry, which you probably would not). Bonus points if you cover this in your answer too. :)

谢谢!

附言我正在使用 OpenGL.我只是在寻找基本概念,但如果您选择发布示例代码,请使用 OpenGL 函数和术语!:)

P.S. I'm using OpenGL. I am just looking for the basic concepts but if you choose to post example code, please use OpenGL functions and terms! :)

感谢您的回答!出于文档目的,这里是我发现的另一个资源:Game Programming Gems 2 中的第 4.9 章介绍了将远景渲染到天空盒的概念:http://books.google.com/books?id=1-NfBElV97IC&lpg=PA416&ots=SOpnfijZly&dq=render%20distant%20to%20skybox&pg=PA416(不幸的是,预览只是本章的第一页......我一回到八月就必须从我大学的图书馆拿那本书)

Thanks for the answers! For documentation purposes here is another resource I found: Chapter 4.9 in Game Programming Gems 2 covers the concept of rendering distant scenery to a skybox: http://books.google.com/books?id=1-NfBElV97IC&lpg=PA416&ots=SOpnfijZly&dq=render%20distant%20to%20skybox&pg=PA416 (unfortunately that preview is only the first page of the chapter... I'll have to grab that book from my university's library as soon as I get back in August)

此外,在阅读这些内容后,我仍然认为 LOD 适用于距离仍然相当近的物体.如果对象甚至没有一个像素大,但您仍在将它们提供给显卡,那么无论是否使用 LOD,您都只是在浪费电力.除了绝对最大的遥远物体外,其他所有物体都是如此;在大多数情况下,一些高楼和一些山脉,但是从这么远的距离看不到小细节模型(灌木,甚至树木,岩石,任何其他风景……).所以我很喜欢渲染到天空盒的技术,当我到达这座桥时,我将通过它;而且我会确保对所有模型都使用 LOD,我只是不会渲染这样的距离.

Also after reading these things, I am still of the opinion that LOD is for objects that are at a still reasonably close distance. If the objects aren't even one pixel large, but you're still feeding them to the graphics card, you're just wasting power, whether using LOD or not. And that would be the case for everything but the absolute largest distant objects; a few tall buildings and some mountains, in most cases, but the small detail models (bushes, even trees, rocks, whatever other scenery...) would not be visible from such a distance. So I do like the render to skybox technique, and when I get to this bridge, that's how I'll cross it; and I'll make sure to use LOD for all models, I just won't render such a distance.

顺便说一下,我更倾向于 Oblivion 游戏的思路,所以答案可能取决于游戏类型.

I am, by the way, thinking more along the lines of an Oblivion game, so the answer may depend on the game genre.

推荐答案

一些技巧,包括你提到的那些:

A few techniques, including the ones you've mentioned:

  • 详细程度.以上概述.
  • Mipmapping.对于纹理.
  • 视野.通过选择适当的缩放级别来限制您的相机可以看到"的东西的数量.另请参阅视锥剔除.
  • 远剪裁平面.远方遮挡:大多数游戏使用雾、山脉或其他一些借口来严格限制您能看到多远.这可以使用八叉树或一些其他此类技术来实现.这可能基于整个对象、多边形或其他任何内容,并且通常设置为发生在上述山脉的正后方.
  • Arena/Levels/areas/whatever——同样,大多数游戏人为地限制你一次只能在一个竞技场玩;好处是显而易见的(你可以忽略所有其他领域的对象)
  • 预渲染 - 这就是您在上面建议的内容.对于远处的静态场景,在典型"视图中渲染场景并使其成为背景上的纹理,或者将其用于天空盒/反射贴图/等.

这个想法是在用户开始注意到之前尽可能多地丢弃细节.

The idea is to throw away as much detail as is possible before users start to notice.

有许多预先存在的工具包可以自动完成这些事情,但它们往往需要花钱.如果您正在查看一款严肃的应用,我建议您至少研究一下它们包含的解决方案.

There are a number of pre-existing toolkits that will do these things automatically, but they tend to cost money. If you're looking at a serious app, I would recommend at least researching the solutions they include.

这篇关于远距离 3D 对象渲染 [游戏]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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