Particle Systems – 特效流程学习

之前想学习一下特效相关,看到有篇比较好的特效介绍文章:

https://80.lv/articles/learning-fx-workflow/

是一位资深特效对整个工作流程的描述文档,做了一下简要的翻译,并没有做精翻,而是主要翻译了个人感兴趣的相关章节,其它的部分做归纳或概括性翻译;

以下为原文和翻译


入门

Where do I start when looking for something new to make? The good old gathering of reference and inspiration is the first thing that comes along. During this, there could be several questions you ask yourself: How complex will this effect be? What purpose does this effect serve?What style shall I go for? What target platform does it need to hit? What type of motion do I want? During the gathering of inspiration and reference, next to inspiration from other FX, look for visual cues and motion that look interesting. Look outside your subject type and search an interesting hook that you can incorporate into your effect. Seeing how silk moves in the wind, or how seeing what a wave does when it crashes onto a rock for example. In the end, real life will always be the best form of inspiration, no matter the style and subject matter you are working in.

不管你做的项目是什么风格,真实世界永远是最好的灵感来源;

After you feel the reference is in a good place, the blockout/ concepting phase comes. During this phase, you mainly focus on getting a feel for the major motion and actions that need to happen. This also allows you to gauge what type of resources you will need. Although this will most likely change throughout your project, you can get a good idea of the scope, and you will able to answer a lot of the questions beforehand. After this, I’d personally like to create a document that outlines all of the elements I think I might need. This doc will also be kept as a feedback tracker so you know what you still need to fix and what you might want to add. Then make sure you’ve got everything in a good place so you can start with production.

体会好参考资料后,草稿设计阶段就到了;想好大效果,制作相关需求文档;

概念设计图

Personally, I like to start by building all the elements first individually. Meshes are overall pretty quick to make so I will do those first. Then the textures will follow, after these are in place I start with the production of the shaders, and a rough setup of the particle systems. I’d like to see it as a gradual expansion of your building blocks to make the bigger pieces with.

开始独立制作各个元素,首先是模型,然后是贴图,之后是材质、粒子系统;

学习过程

When you are planning to start with the learning process, start with getting to know your tools you are working with first. The biggest learning process comes from understanding the underlying principles of FX and gradually applying them to projects over time. Start small and find something you would like to improve on and keep your goals deliberate. I feel the aspects one can focus on when you are in process of learning VFX could be broken down into the following.

当开展学习进程时,熟悉工具;最重要的是理解特效的理念,并逐渐将其应用于项目。从小处着手,找到一些你想要改进的东西,并保持目标的深思熟虑;我觉得当你正在学习VFX时可以把关注的方面分解为以下内容;

Meshing: Meshes in VFX will most of the time be used as a carrier, and used for a movement that cannot be easily achieved with flat cards. Learn what you can do with the UVs of your mesh. And what it can do for you to reach a certain effect. Learn how resource heavy they can be: what is too many polys and what is too few, how can I make sure my meshes do not cause unnecessary overdraw.

模型:模型在特效中模型是载体,能完成面片所完成不了的移动等效果;巧用模型的UV动画来达成特定的效果;以及顾及优化;

Dynamics: FX is all about the movement of the natural phenomena (and also the unnatural ones, of course). Get to know what causes these phenomena to happen, and see how they work, behave, and interact with each other. It is all part of understanding your subject matter. Do however apply these principles from an animation point of view. Because sometimes something might look right, but might not always feel right within your effect. In terms of software to recommend: Houdini is stronger than ever and still keeps on growing, but it is one of the hardest programs to learn and master. But start to identify what you will be using it for first. Like a said before: start small! Engines also allow for the use of some basic physics as well, but these will most likely be approximations.

动力学:理解自然现象中运动原因,了解导致这些现象发生的原因,并了解它们如何相互作用,表现和相互作用;然而,从动画的角度来看,应用这些原则;因为有时看起来可能是正确的,但在你的效果中可能并不总是正确;推荐使用Houdini;

Textures: For textures, make sure that you get good values into your texture. See what combines well, reads well, and see if it can work well with gradient mapping and erosion.

贴图:确保输入了正确的数值,表现了正确的效果;

Shaders: This aspect can go really deep if you would like to, but to in the beginning familiarise yourself with the node based editors and see what each function does. Most depth will come from how flexible you would like your shaders to be: do I want all energy based effects to be controlled from one shader? Will I simply split them up by subject? In any case, look for ways to build functionality into your shaders that allow for reuse. Instancing materials will always be better than creating a new one.

材质:熟悉节点,编写的时候考虑其灵活性,多多使用材质函数和材质球实例;

Design: The design behind your effect is one of the most important factors that can make or break it. In the game context, it is essential that the effect communicates to the player what purpose it serves to the gameplay. It also is the keystone that gives your effect visual appeal. Graphic design is a great inspiration source for this, and most of its principles could be directly applied to FX. It is all about communicating visually, evoking an emotional response, and also leading the eye.

设计:效果背后的设计是可以决定它的最重要因素之一;在游戏环境中,效果必须是向玩家传达它为游戏玩法服务的目的;它也是提供视觉吸引力的基石,平面设计是一个很好的灵感来源,其大部分原则可以直接应用于FX;一切都是关于视觉交流,唤起情绪反应,并引领视觉;

Animation: FX is all about animating energy. The 12 principles of animation pretty much apply to effects as well. These principles help you with creating more believable and realistic looking effects. Whether you are working on stylised FX or realistic these rules will still apply.

动画:特效的本质就是蕴含在动画中的能量;动画的12准则也同样适用,这些准则让你可以创造更真实可信的效果;这点无论是在风格化还是写实效果上都适用;

Implementation: Be sure to get to know the implementation process by knowing how it works and learn how to do it yourself. Unreal’s Blueprint system allows for a great starting point. This could, for example, be applied to how to make bullets. If an effect is triggered by a key-press or if you want to attach an effect to a certain bone, just to name a few. Understanding how the implementation process works, allows you to understand what type of aspects you need to take into account. In case you need to hand stuff over to someone who will be responsible for integration, you will make their lives just a bit easier.

实施:一定要懂得实现的过程,并学习如何自己实现;虚幻的蓝图系统非常有用;

Cascade

Cascade (Unreal Engine’s particle editor) is a modular emitter based system that is used to create your particle systems in. Although Niagarajust came around the corner, it will still be a good tool to start with to get an idea of the core concepts or if you feel that Niagara is too intimidating to start off with right away. Cascade exists of a list of rulesets that comprise the particle system itself. You have the option to create the standard emitters. mesh emitters, ribbon emitters, and trail emitters, and GPU emitters. The window that shows your list of emitters also gives you a representation of how the particle system in question is sorted. The 1st emitter in the list will be the last one the get rendered. Each module within your emitter contains a set amount of rules that can be changed to your liking. What each module will contain is a list of points within your timeline that run from 0 to 1.

Cascade是虚幻引擎中基于模块化发射器的粒子编辑系统;虽然Niagara已经出现,但Cascade仍然是一个能快速实现创意的工具(假如你还没用熟Niagara的话);

(这里讲到了粒子的emitter data type,文章结尾有相关介绍文档)

If it is possible to change the distribution type of a certain parameter within your module, that parameter can be accessed via blueprint, sequencer, or in-engine. In the engine, this would allow you created subtle variations of a particle system if you need that. This is so you don’t have to make a new system for every instance you want to have a similar looking system with a slight difference in behavior.

模块中的某些参数可以通过不同的distribution type与blueprint、sequencer或in-engine沟通,这样可以让同一个粒子系统通过参数控制就有不同的效果;

把 distribution设置成Particle Parameter就可以在运行时修改这些参数

The preview window allows you to visualize the number of particles per emitter, visualize your bounds, how the system will look in motion plus check your collisions and light influence. Every module within your emitter allows you to visualize the area where the particles will spawn from. This allows you to check how the emitters are in relation to each other.

预览窗口可以让你视觉化的观察每个粒子发射器的情况;

This window allows you to edit your curves. Clicking the button next to the module allows you to visualize that module’s curve in the window. Pressing the yellow square in this window will allow you to hide this curve in the window. The x, y, and z (the red, green, and blue squares) curve can be toggled of separately if they show up next to the yellow square. Then you can edit them separately if you want to. Pressing CTRL on the curve allows you to add a point to the curve.

这个窗口是曲线编辑器,点击模块上的曲线编辑按钮可以在曲线编辑器中修改相关参数;

制作过程

Like mentioned a bit earlier, the way I’d personally like to approach the creation of effects is to first assess what type of elements you need for your effect(s), and make those first. During the meshing process, I mostly use Maya and ZBrush for all the sculpting work. The meshes, in this case, are for the most part pretty simple. For all of the meshes that I would like use scrolling textures on, I make sure to layout my UV island within the full 0 to 1 space. But if there is a texture that needs to loop over a mesh with a break in it (like a bullet of the trail, for example), I will scale it down a little so no noticeable looping is present.

之前提到过,个人习惯在制作开始时,搞清所要表现的元素;在Mesh制作阶段,使用Maya或ZB等建模软件来制作这些模型(大部分情况下都很简单);UV一般都撑满整个UV空间,有些情况下还要避免接缝问题;

In case you want to add a gradient to your mesh, it could be one via a shader. But a handier way is to add some vertex color to your mesh. This can then be multiplied on top of your textures to get the same fade out effect. Vertex colors also allow you to control how a certain part of a mesh should behave. For example, a soap bubble, or controlled deformation of a steel barrel that is getting crushed. For certain instances, you might want to spawn particles on a certain surface or part of a surface. In this case, turn it into a skeletal mesh, and then skin the area you want to spawn particles from to that bone or bones. Then the skin weights will be used as a mask where particles will be spawned from on that particular surface.

假如想做一个渐变的效果,当然可以在材质中去做;但还有更方便的方法就是使用模型的顶点色做;可以通过材质把顶点色叠加在贴图上完成同样的效果;用这种方法还能控制模型特定部分的特定行为;如肥皂泡或正在坍塌变形的金属架等;在某些情况下,假如想在某个面或部分面上生成(Spawn)粒子,那么可以转换模型为Skeletal Mesh,然后给要生成粒子的相关区域绑定骨骼,这样可以使用蒙皮的权重值作为Mask,来控制粒子的生成位置范围;

For the textures, I’d like to use a combination of Photoshop, Substance Designer, and Substance Painter. Photoshop is used to create all of the hand painted elements, and Substance Designer is used for most of the tileable noises and simple elements that I would like to use within the scene. For the texturing of the assets, I’d like to use a combination of both Designer and Painter. I will always use channel packing. In this case, it will be categorized by element or subject if possible. For example, different types of trails, or an element that requires multiple textures that work together to get the desired effect. The textures will then be tested to see if they read and work well within the engine, I also check how they work together with gradient mapping and adjust them accordingly to get to the desired result.

贴图制作则一般使用 Photoshop, Substance Designer, 和Substance Painter等软件;比如偏手绘的部分多使用Photoshop,要处理四方连续这样的噪点图的话使用Substance Designer比较多;

Then the shaders will be built. Most of them have been outlined in the planning phase, but I’d still like to keep the setup pretty rough and get the elements I will be using in. The setup will evolve down the line and will be adjusted if I think something does not work well or requires a different setup to get to the desired result. I’d like to build most of these shaders myself. But over time, I have learned a lot of techniques and setups from other resources and people that I’d like to incorporate when needed.

然后就是编写材质的时候了;材质大多在计划阶段就规划好了;细节相关在这个阶段调整和添加;

Then I will construct the particle systems with the elements I have. Construct it layer by layer. Get the behavior down for each emitter and tweak it until you get the motion you want. Then build on top of that with another emitter and make them work right the previous element. Once all the emitters are implemented, adjust and tweak if needed. Also regularly check how costly your shader complexity is, and check if you have no unnecessary overdraw. I’d like to keep the final optimization until the end, once I know all the elements work well together. Once that point is reached, check and see how far you can scale back your elements, all the while maintaining the original look of the effect as closely as possible. This will all be a balance of fidelity versus the optimal cost of your effect.

之后就是构建粒子系统了,把相关的元素一个个的添加上去,每一个emitter都仔细校调到满意为止;调完一个emitter再添加新的,继续调整其与之前emitter的协调;所有必要的emitters都添加完毕后,再整体调整;不要忘了经常检查材质复杂度,保证没有多余的overdraw;

Animating your textures can be done in a multitude of ways. The approaches will vary on a case to case basis, but here a some of the ways one can animate them. Shaders will always be at the hearts of this. But it will be a matter of what method you will use that will do most of the heavy lifting, and how flexible you want you would like to make your shaders. You also have the possibility to access particle parameters outside of the particle system and animate them that way. Dynamic parameters allow you to animate up to 4 different parameters. That can be fed directly into Cascade. Every parameter you create within your particle system that has a System-Update function can be animated (in blueprints, sequencer and C++ for example). Parameter collections are a set of values that can be accessed to be changed during runtime. This parameter collection can be fed directly to the right parameter within your shader. But can also be accessed via Sequencer and Blueprints.

贴图动画有好几种制作方法;使用何种方法根据具体情况来;但无论如何,材质都是核心;可以通过接口参数来控制粒子系统,制作贴图动画功能;比如Dynamic parameters就提供了4个不同的接口参数(RGBA),UE4中就可以通过blueprints或sequencer来直接控制这些参数;还有Parameter collections可以提供在运行状态时可更改的一组数据集合;而Parameter collections可以在材质中使用,并可以通过blueprints或sequencer来控制;

一种测试贴图动画的方法

For scrolling textures, I’d like to combine them together in the shader by means of addition, subtraction, and adjustments to get interesting shapes. In case I’d like to erode a texture over the particle’s lifetime, I will test this in both in Photoshop/Substance and within the engine as well. I’d like to check if the erosion happens in an interesting fashion and make sure the values of the texture contrasty enough to allow the texture to be eroded smoothly. If you would like to get more control over how a certain element needs to be manipulated over its lifetime, the Dynamic Parameter will help you out the most with that. It allows you to break up the constant movement of these elements and allows you to adjust it to your liking within Cascade itself.

可以利用一些数学运算(addition、subtraction等)来做出有趣的形状来辅助贴图动画;在粒子的生命周期中想要更多的控制某个元素,可以多多使用Dynamic Parameter;

利用Dynamic Parameter控制渐变的幂指数参数,然后通过Cascade来操作Dynamic Parameter

优化

You have been working on something amazing, but then the age-old question comes: will it run? Overdraw can be one of the biggest contributors to make things run like a slideshow. You need to look at how one can create the largest amount of screen fidelity with the least amount of particles. Spawn only the particles you actually need and spawn them in such a way it all still feels like one coherent volume. Also, make sure you reduce wasted space in your particle cards. When possible, use trim textures to trim away some of the wasted space in your particle. One thing I also like to do quite a lot: If one fades away a particle by reducing the opacity of over its lifetime, check if the particle is completely faded out within its lifetime. If that is the case, quickly shrink it down to a scale of 0 after the particle has completely turned transparent.

效果好是一回事,但能不能良好的运行是另一回事;

例如粒子快结束生命周期的时候,把其大小逐渐缩减到0,减少半透明贴图的消耗

Also, make sure to not waste too much space within your textures itself. The less wasted space the less trimming one needs to do. If possible, see what you can create procedurally. UE4 offers options to create a wide variety of noises, shapes, and gradients.

不要浪费UV空间,或使用过多没必要的贴图;很多噪点图等可以在材质中过程化生成,UE4也提供了不少默认的相关贴图等;

左边的贴图在贴图利用率上并不理想,右边的才是理想的情况

Make sure that your particle emissions are within reason. Not too many and not too few, but this all will depend on how big they will show up on your screen. As your systems increase in size, the tick rate for these systems will increase as well. In this case, it would be how long it will take to update a particle system’s behavior. How much this particle will be reused within the same frame of the game can also be a factor to take into account.

确保粒子的合理性;

看上去一样,但左边的发射率更高

Setting bounds for your system will help to determine whether or not a particle should be culled. Also get into the habit of setting up LODs for your particle systems that will constantly active throughout the game. It might be the case that some of the elements in your system will not be visible from far away. So it will be a lot easier to just turn them off in your LODs.

根据裁剪的需要合理设置粒子系统的bounds;同样也要合理设置好LOD;


个人编写的一些其它相关参考文档:

Particle Systems – UE4中的粒子系统介绍Blueprints – UE4中蓝图与材质之间的交互

来源:知乎 www.zhihu.com

作者:MoonChildInSky

【知乎日报】千万用户的选择,做朋友圈里的新鲜事分享大牛。
点击下载