Unity几个有用的游戏运动特效_第1页
Unity几个有用的游戏运动特效_第2页
Unity几个有用的游戏运动特效_第3页
Unity几个有用的游戏运动特效_第4页
Unity几个有用的游戏运动特效_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Unity几个有用的游戏运动特效本文摘要本文主要记录了我在开发格斗游戏时用到的几个运动特效,可以方便地表现武器挥动、运动模糊和其他一些特效。灵活使用可以大幅提升格斗游戏的视觉效果和感染力。有关Unity的其他话题也可以查阅我的其他文章。一、运动轨迹运动轨迹常常用于表现武器的挥舞效果,在提高速度感的同时又能让玩家看清楚招式动作,所以是常见的一种格斗特效。Unity中可以直接使用TrailRender来实现该效果。二、运动模糊运动模糊就是保留前几帧影像,形成一定的重影模糊效果,从而突出速度感。配合慢镜头使用往往能很好地表现运动高潮效果。运动模糊在Unity中是通过Motion Blur image effect脚本实现的。三、景深模糊景深模糊就是模拟人眼或望远镜的成像原理,对远离视线焦点的场景进行模糊,从而提高画面真实感,同时也迫使玩家注意焦点处发生的事情。虽然该特效在射击游戏中更为常见,但某些情况下也可以用在格斗游戏中。例如团队作战时以这种方式显示队友发生的重大事件,或者在主角被击倒时,从观众席使用此特效,都能给玩家带来更强烈的现场感。Unity中使用Depth of Field Image Effect脚本来实现。其他特效还有一种常用的特效,就是对移动目标使用残影。这种特效与运动轨迹不同之处在于拖在身后的不是简单的粒子效果,而是对象前几帧的影像;与运动模糊的区别在于它是单独对某个目标使用,而非整个屏幕。可惜我还没有找到Unity自带实现类似效果的方法,希望有了解的朋友不吝赐教。Trail RendererTheTrail Rendereris used to make trails behind objects in the scene as they move about.The Trail RendererInspectorPropertiesMaterialsAn array of materials used for rendering the trail. Particle shaders work the best for trails.SizeThe total number of elements in theMaterialarray.Element 0Reference to theMaterialused to render the trail. The total number of elements is determined by theSizeproperty.TimeLength of the trail, measured in seconds.Start WidthWidth of the trail at the objects position.End WidthWidth of the trail at the end.ColorsArray of colors to use over the length of the trail. You can also set alpha transparency with the colors.Color0toColor4The trails colors, initial to final.Min Vertex DistanceThe minimum distance between anchor points of the trail.AutoDestructEnable this to make the object be destroyed when the object has been idle forTimeseconds.DetailsThe Trail Renderer is great for a trail behind a projectile, or contrails from the tip of a planes wings. It is good when trying to add a general feeling of speed.When using a Trail Renderer, no other renderers on theGameObjectare used. It is best to create an empty GameObject, and attach a Trail Renderer as the only renderer. You can then parent the Trail Renderer to whatever object you would like it to follow.MaterialsTrail Renderers should use a material that has a ParticleShader. TheTextureused for the Material should be of square dimensions (e.g. 256x256 or 512x512).Trail WidthBy setting the TrailsStartandEnd Width, along with theTimeproperty, you can tune the way it is displayed and behaves. For example, you could create the wake behind a boat by setting theStart Widthto 1, and theEnd Widthto 2. These values would probably need to be fine-tuned for your game.Trail ColorsYou can cycle your trail through 5 different color/opacity combinations. Using colors could make a bright green plasma trail gradually dim down to a dull grey dissipation, or cycle through the other colors of the rainbow. If you dont want to change the color, it can be very effective to change only the opacity of each color to make your trail fade in and out at the head and/or tail.Min Vertex DistanceTheMin Vertex Distancevalue determines how far the object that contains the trail must travel before a segment of the trail is solidified. Low values like 0.1 will create trail segments more often, creating smoother trails. Higher values like 1.5 will create segments that are more jagged in appearance. There is a slight performance trade off when using lower values/smoother trails, so try to use the largest possible value to achieve the effect you are trying to create.Hints Use Particle Materials with the Trail Renderer. Trail Renderers must be laid out over a sequence of frames, they cant appear instantaneously. Trail Renderers rotate to display the face toward the camera, similar to otherParticle Systems.Motion Blur image effectMotion Blurimage effect enhances fast-moving scenes by leaving motion trails of previously rendered frames.Like allimage effects, Motion Blur is only available in Unity Pro. Make sure to have thePro Standard Assets installed.Motion Blur effect applied to the rotating sceneBlur AmountHow much of the previous frames to leave in the image. Higher values make longer motion trails.Extra BlurIf checked, this makes motion trails more blurry, by applying some extra blur to previous frames.Tips: Motion Blur only works while in play mode because its time based.Hardware supportMotion Blur effect works all graphics cards that support rendering to a texture. E.g. GeForce2, Radeon 7000 and up. All image effects automatically disable themselves when they can not run on an end-users graphics card.Depth of Field Image EffectTheDepth of Fieldimage effect is a common post effect simulating camera lens systems. This results in sharp and unsharp areas based on each pixels depth in comparison to a defined focal point.As with the otherimage effects, this effect is only available in Unity Pro. Make sure to have thePro Standard Assets installed.Example for Depth of Field. Note how the camera focuses on the screen center (Focus on Centerenabled).PropertiesQualityThe quality level. Chose between Low (but fast), Medium (no halos, but low quality foreground blur) and High (properly blurs foreground objects). This setting has a big impact on overall performance.Focal DistanceThe distance to the focal point from the camera position in world space. This value will be automatically calculated ifFocus on CenterorFocus on Thisis enabled.Focal SizeIncreases the focal area if 0.Start CurveDefines the intensity curve for the foreground blur.End CurveDefines the intensity curve for the background blur.Focal FalloffGlobal tweaking that affects start and end curves.Center focusSpecify this to automatically focus on whatever the center of the camera is looking at. The script will automatically read out the depth buffer and calculate a proper focal distance.Object focusSpecify this to automatically focus on whatever transform object has been dropped here. A proper focal distance will be automatically calculated.BokehEnable fake bokeh simulations. This will make bright objects bleed in a circular manner over neighbouring pixels.Bokeh CutoffThe threshhold for the bokeh simulation.Background BlurSettings for background blurring (most common usage of Depth of Field).Blur iterationsThe smoothness of the unsharp areas.Blur SpreadThe blur distance for the

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论