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

分享用像素艺术和3D制作静态水体的经验

发布时间:2015-04-21 11:42:57 Tags:,,,

作者:Roque Rey

今天我们要讨论的是《Okhlos》中的第四个世界Altantis中的水体,以及我们如何用Unity制作这种效果。

在此我们不讨论流体模拟之类的效果,只会提到制作这款游戏水纹效果方面的一些经验。我们在其中融合了像素美术和低多边形美术,还使用了阴影,HDR,bloom效果及许多“新”特效。

《Okhlos》中的水纹构图非常简单:就是一个平面。

waterplane(from gamecareerguide)

waterplane(from gamecareerguide)

这是一个高于实际水平线的平面,所以游戏中的单位、建筑和敌人不会与之交互。地面负责处理所有物理元素,所以它仍然要处理其本身的所有碰撞。水体只是地面的一个网眼子集。

水体已经有了一个透明/扩散素材,我们并没有减少纹理的不透明性,只是在素材背景对其进行更改。这让我们拥有更多控制权,我们只要在更改的时候直接对最终面貌进行处理。我们只需在Unity内部完成这些操作,无需在每次更改的时候输出纹理。

matprop(from gamecareerguide)

“Agua”在西班牙语中就是水的意思(from gamecareerguide)

从水在其他对象中的运行情况来看,所有在河和容器中的水都是用2DToolkit制作而成,这更有利于制作水流的动画效果,也让我们的操作更具灵活性。

agua(from gamecareerguide)

agua(from gamecareerguide)

从上图可见,几乎所有的水流都是用子画面制作而成。我们逐帧地制作水流动画。2DToolkit在这方面具有极便利的管道。我们仍然需要输出子画面,但能够极快更改它们的大小,形状和方向,我们几乎也可以立即看到最终效果。

waterfountain2(from gamecareerguide)

这个喷泉有8个不同的子画面动画(from gamecareerguide)

这种方法的唯一问题在于我们必须更改对象中水的素材,以便将其与平面水体区别出来。这里的水具有Additive Vertex色材,这也正是它看起来闪闪发亮的原因。

瀑布效果的水是一个子画面动画集,但其中的涟渏则是用Unity的粒子系统制作而成。

waterflowsm(from gamecareergudie)

waterflowsm(from gamecareergudie)

这实际上是一种相当简单的特效,它其实是一个不时循环的粒子。

captura(from gamecareerguide)

captura(from gamecareerguide)

经过一些调整我们就可以将这种效果运用于角色。我们只需将Emission从Time更改为Distance,将模拟空间更改至本地状态。

waterripplescharacter(from gamecareerguide)

waterripplescharacter(from gamecareerguide)

这样就成了。如果你想为自己的游戏添加静态水体,就可以采用这个方法。虽然它还不甚完美,但至少能证明它对此类游戏极为管用。(本文由游戏邦编译,转载请注明来源,或咨询微信zhengjintiao)

Adding Static Water with Pixel Art and 3D

- Roque Rey

In today’s post we’ll be talking about the water in Okhlos’ fourth world, Atlantis, and how we went about making it using Unity.

Mind you, we won’t be talking about fluids simulation or anything like that – these will just be a few notes about our experience developing water for the game. Do keep in mind as you read on, that in Okhlos, we try to blend pixel art with a low poly aesthetic, but we also use shadows, HDR, bloom, and lots of “new” effects – just because we can!

The composition of the water in Okhlos is quite simple: it’s a plane.

The water is above the actual ground of the game… duh.

It’s a plane above the actual ground of the level, so the units, buildings, and enemies never interact with it. The ground is the one that posseses all the physics components, so it still handles all the collisions itself. The water is just a mesh child of the ground.

The water has a transpartent/diffuse material, and there isn’t much more to it than that. We don’t reduce the opacity of the texture, we just change it in the materials settings. This gives us much more control, and, since we’re working directly on the final look as we make changes, we can just do it all within Unity instead of having to export out a texture for every tweak we want to make.

“Agua” in spanish means water

As far as water within other objects goes, all the water in streams and containers was made in 2DToolkit, which makes animating it so much easier and gives us far more versatility.

As you can see from the picture above, almost all the water streams for the objects are made using sprites. We animate them frame by frame. 2DToolkit has an incredibly useful pipeline for this kind of work. We still need to export the sprites, but we change their sizes, shapes, and orientations very quickly, and we can see the results almost immediately.

This fountain has 8 different sprite animations, just to illustrate the versatility of our system.

The only real problem we had with this approach was that we had to change the material of the water within the objects to differentiate it from the water plane. The water has an Additive Vertex color material, which is why it almost seems to glow.

The cascading water, as we mentioned before, is a sprite animation, but the ripples are produced using Unity’s particle system.

It’s actually a pretty simple effect, it’s just a looping particle that throws instances every now and then.

With just a few tweaks we can apply the effect to a character. We just need to change the Emission from Time to Distance, and the simulation space to local.

So, there you have it. If you want to add static water to your game this can be a good approach. It’s far from perfect, but it has proven to be quite useful for a game like ours.

And, as always, any feedback is welcome! (source:gamecareerguide


上一篇:

下一篇: