游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

概述游戏的现代体积渲染技术(1)

发布时间:2013-11-19 17:18:36 Tags:,,,,

作者:Stoyan Nikolov

几个月以前,索尼公布了他们即将推出的MMO游戏《EverQuest Next》。让我非常兴奋的是,他们选择把游戏世界立体化。我一直对体积渲染技术充满兴趣,所以借本系列,我将解释为什么这种技术最适用于当下的游戏以及近未来的游戏。

在这个系列文章中,我将介绍一些算法的细节以及它们的实际用法。

本系列的第一篇文章将介绍体积渲染的概念以及它给游戏带来的最大好处。

体积渲染是著名的算法家族中的一员,其作用是把一系列3D样本投射为2D图像。它广泛运用于各个领域如医学成像(核磁共振成像、CRT可视化)、工业、生物学、地球物理学,等等。它在游戏中使用得并没有那么多,案例包括《Delta Force》、《Outcast》、《C&C Tiberian Sun》等游戏。体积渲染技术的使用一直在萎缩,直到最近,它才被人们“再发现”,重新在游戏中流行起来。

sample_asteroid(from gamedev)

sample_asteroid(from gamedev)

我们通常对游戏的网格模型的表面有兴趣,却很少关注它的内部结构—-在医疗运用方面是相反的。极少软件选择体积渲染,而是普遍使用多边形网格模型表现法。然而,体积渲染有两个对现代游戏越来越重要的特点—-可破坏性和程序生成法。

游戏如《我的世界》已经表明,玩家非常喜欢按自己的方式创造自己的世界。另一方面,游戏如《红色派系》的玩法重点是对周边环境的破坏。这两款游戏,尽管非常不同,但基本上都需要相同的技术。

可破坏性(游戏邦注:当然也包括可构造性)是游戏设计师们积极寻找的属性。

修改网格模型的办法之一是把它变成传统的多边形模型。这是一种相当复杂的做法。中间件解决方案如NVIDIA Apex可以解决多边形网格模型的可破坏性问题,但通常仍然需要设计师做其他工作,且构造性问题基本上没有解决。

minecraft-fantasy-castle(from gamedev)

minecraft-fantasy-castle(from gamedev)

体积渲染正是在这方面派上大用场。网格模型的表现法是一种比三角形集合体更加自然得多的3D网格体素(立体象素)。这个立体物已经包含了关于对象形状的重要信息,且它的修改接近于现实世界的情况:要么添加立体物,要么从另一个立体物中减去立体物。使用Zbrush就是类似的过程。

体素自身可以包含数据,但它们通常定义一个距离域—-那意味着每一个体素都编码一个值,以表明焦点离网格模型表面的距离是多少。体素也包含材质信息。因为这种定义,作用于体素网格模型之上的体素构造几何法(CSG)变得非常烦琐。我们可以在网格模型上自由地添加或减去任何立体物。这使建模过程更加灵活。

程序生成法是另一个具有诸多优点的特性。首先,它可以节省大量人力和时间。关卡设计师可以程序生成地形,然后微调,而不是从无到有制作每一个乏味的细节。当需要制作大量场景—-如MMORPG游戏时,你就会发现这种节省是多么重要。因为新一代游戏机的内存更大,性能更好了,玩家会要求更多更好的内容。只有使用程序内容生成法,游戏开发者才能让未来的游戏满足玩家的各种需求。

总之,程序生成法意味着我们使用具有比较少的输入参数的数学函数来制作网格模型。至少美工不需要雕刻模型的最初版本。

使用程序生成法,开发者还可以获得比较高的压缩比,从而节省大量下载资源和硬盘空间。我们已经看到程序生成材质的巨大优势,所以为什么不把它运用于3D网格呢?

体积渲染技术的使用不局限于网格模型。现在它的使用已经扩展到其他方面,比如:

全局光照(看虚幻引擎4的强大效果)

液体模似

用于视觉效果的通用图形处理器(GPGPU)Ray Marching

在本系列的下一篇文章中,我将详细介绍现代体积渲染算法,我认为它在现在和未来的游戏中大有潜力。

本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

Overview of Modern Volume Rendering Techniques for Games – Part 1

By Stoyan Nikolov

A couple of months ago Sony revealed their upcoming MMO title EverQuest Next. What made me really excited about it was their decision to base their world on a volume representation. This enables them to show amazing videos like this one. I’ve been very interested in volume rendering for a lot of time and in this series I’d like to point at the techniques that are most suitable for games today and in the near future.

In this series I’ll explain the details of some of the algorithms as well as their practical implementations.

This first post introduces the concept of volume rendering and what are its greatest benefits for games.

Volume rendering is a well known family of algorithms that allow the projection of a set of 3D samples onto a 2D image. It is used extensively in a wide range of fields as medical imaging (MRI, CRT visualization), industry, biology, geophysics etc. Its usage in games however is relatively modest with some interesting use cases in games like Delta Force, Outcast, C&C Tiberian Sun and others. The usage of volume rendering faded until recently, when we saw an increase in its popularity and a sort of “rediscovery”.

A voxel-based scene with complex geometry

In games we usually are interested just in the surface of a mesh – its internal composition is seldom of interest – in contrast to medical applications. Relatively few applications selected volume rendering in place of the usual polygon-based mesh representations. Volumes however have two characteristics that are becoming increasingly important for modern games – destructibility and procedural generation.

Games like Minecraft have shown that players are very much engaged by the possibility of creating their own worlds and shaping them the way they want. On the other hand, titles like Red Faction place an emphasis on the destruction of the surrounding environment. Both these games, although very different, have essentially the same technology requirement.

Destructibility (and of course constructability) is a property that game designers are actively seeking.

One way to achieve modifications of the meshes is to apply it to the traditional polygonal models. This proved to be a quite complicated matter. Middleware solutions like NVIDIA Apex solve the polygon mesh destructibility, but usually still require input from a designer and the construction part remains largely unsolved.

Minecraft unleashed the creativity of users

Volume rendering can help a lot here. The representation of the mesh is a much more natural 3D grid of volume elements (voxels) than a collection of triangles. The volume already contains the important information about the shape of the object and its modification is close to what happens in the real world. We either add or subtract volumes from one another. Many artists already work in a similar way in tools like Zbrush.

Voxels themselves can contain any data we like, but usually they define a distance field – that means that every voxel encodes a value indicating how far we are from the surface of the mesh. Material information is also embedded in the voxel. With such a definition, constructive solid geometry (CSG) operations on voxel grids become trivial. We can freely add or subtract any volume we’d like from our mesh. This brings a tremendous amount of flexibility to the modelling process.

Procedural generation is another important feature that has many advantages. First and foremost it can save a lot of human effort and time. Level designers can generate a terrain procedurally and then just fine-tune it instead of having to start from absolute zero and work out every tedious detail. This save is especially relevant when very large environments have to be created – like in MMORPG games. With the new generation of consoles with more memory and power, players will demand much more and better content. Only with the use of procedural generation of content, the creators of virtual worlds will be able to achieve the needed variety for future games.

In short, procedural generation means that we create the mesh from a mathematical function that has relatively few input parameters. No sculpting is required by an artist at least for the first raw version of the model.

Developers can also achieve high compression ratios and save a lot of download resources and disk space by using procedural content generation. The surface is represented implicitly, with functions and coefficients, instead of heightmaps or 3D voxel grids (2 popular methods for surface representations used in games). We already see huge savings from procedurally generated textures – why shouldn’t the same apply for 3D meshes?

The use of volume rendering is not restricted to the meshes. Today we see some other uses too. Some of them include:

- Global illumination (see the great work in Unreal Engine 4)

- Fluid simulation

- GPGPU ray-marching for visual effects

In the next posts in the series I’ll give a list and details on modern volume rendering algorithms that I believe have the greatest potential to be used in current and near-future games.(source:gamedev)


上一篇:

下一篇: