当前位置:   article > 正文

Unity 之 Visual Effect_unity visual effect

unity visual effect

Halo:耀斑,光晕

Halos用于在空气中留下小尘埃颗粒的印象。

Properties

Property:Function:
Color光晕颜色
Size光晕大小

Details

Y您可以添加光晕组件到一个Light object,然后设置它的大小和颜色属性,以提供所需的发光效果. 一个Light 也可以单独的设置光晕,在不添加hole组件的前提下,打开灯光的 Draw Halo 属性.但是这样不怎么灵活

Hints

  • 通过设置 Graphics 下的 Light Halo 选择自己的shader,来表现自定义的halo

A Light with a separate Halo Component

 

 

 

Lens Flare:镜头光晕

Lens Flares 模拟光线在镜头内的折射效果 它们用来代表亮光 ,只是为了给你的场景增加一点气氛
.

 最简单添加一个镜头光晕的方法就是打开Light的 光晕属性. Unity在标准资源包里包含了很多内置的光晕效果4

也可以给空物体添加flare组件,自定义个镜头挂光晕

Enable the Fx button to view Lens Flares in the Scene View

  通过上述按钮查看光晕效果

Properties

Property:Function:
FlareThe Flare to render. 光斑定义了镜头光斑外观的所有方面
Color一些耀斑可以着色,以更好地适应你的场景的情绪。
Brightness镜头光晕的大小和亮度。
Fade Speed耀斑消退的快慢。
Ignore Layers选择不隐藏耀斑的遮罩层,。
Directional如果设置,照明弹将沿着游戏对象的正Z轴方向.它会看起来好像无限远,不会跟踪对象的位置,只有Z轴的方向。

Details

添加flare组件能更精准的控制镜头光晕的表现

Camera摄像机必须有Flare Layer 组件才能看见镜头光晕,这是默认自带的,你不需要设置 (this is true by default, so you don’t have to do any set-up).

Hints

  • 谨慎使用镜头光斑。.
  • 如果你使用一个非常明亮的镜头光晕,确保它的方向适合你的场景的主要光源。.
  • 创建自己的 Flares,需要创建一些 Flare Assets,先模仿我们自带的光晕,再创建自己的
  • Lens Flares 可以被 Colliders 挡住

 

Flare

FlareLens Flare组件里面的选项. The Flare 它本身结合了纹理文件和一些信息来表现flare.

有一些 Standard Assets package. 自带的flare
.

The Flare Inspector

Properties

Property:Function:
Elements耀斑中包含的图像的数量
        Image Index使用的哪个图片 See the Flare Textures section below for more information.
        PositionThe Element’s offset along a line running from the containing GameObject’s position through the screen center. 0 = GameObject position, 1 = screen center.
        SizeThe size of the element.
        ColorColor tint of the element.
        Use Light ColorIf the Flare is attached to a Light, enabling this will tint the Flare with the Light’s color.
        RotateIf enabled, bottom of the Element will always face the center of the screen, making the Element spin as the Lens Flare moves around on the screen.
        ZoomIf enabled, the Element will scale up when it becomes visible and scale down again when it isn’t.
        FadeIf enabled, the Element will fade in to full strength when it becomes visible and fade out when it isn’t.
Flare Texture Flare’s Elements使用的材质. It must be arranged according to one of the TextureLayout options.
Texture LayoutHow the individual Flare Element images are laid out inside the Flare Texture (see Texture Layouts below for furth

 

Line Renderer

Line Renderer组件在三维空间中获取一个由两个或多个点组成的数组,并在每个点之间绘制一条直线. Line Renderer 因此,一个单一的线渲染器组件可以用来绘制任何东西,从简单的直线到复杂的螺旋. 这条线总是连续的;如果你需要画两条或更多完全独立的线,你应该使用多个GameObjects,每个都有自己的线渲染器。

T线渲染器不会渲染一个像素宽的线,它渲染的线总是面向摄像机.

 

Properties

属性当中有很多一看就懂的,就不说了,重要的都用黑体加粗了

PropertyFunction
Cast Shadows是否投射阴影 See Renderer.shadowCastingMode in the Scripting API reference documentation to learn more.
Receive ShadowsIf enabled, the line receives shadows.
Motion VectorsSelect the Motion Vector type to use for this Line Renderer. See Renderer.motionVectorGenerationMode in the Scripting API reference documentation to learn more.
MaterialsThese properties describe an array of Materials used for rendering the line. The line will be drawn once for each material in the array.
Light Parameters添加一个Lightmap Parameters 能够和 global illumination system.交互
Positionslinerender中各个点的位置
Use World Space如果启用,这些点将被视为世界空间坐标,而不受附加该组件的GameObject转换的约束。
Loop使其能够连接该行的第一个和最后一个位置。这就形成了一个闭环
Width宽度
Color颜色.
Corner Vertices此属性指示在绘制线条中的角时使用多少额外的顶点。增加这个值使线条角看起来更圆
End Cap Vertices线结尾处应该用多少顶点来结束,点越多,越圆滑
Alignment View :面向Camera
Local :面向自己Transform component
.
Texture Mode控制纹理如何应用到线条上.  Stretch拉伸纹理覆盖整条线, Wrap 重复纹理覆盖整条线.  Tiling重叠的次数
Shadow Bias隐形偏移,沿着光的方向移动阴影
Generate Lighting DataIf enabled (the box is checked), the Line geometry is built with Normals and Tangents included. This allows it to use Materials that use the scene
lighting, for example via the Standard Shader
, or by using a custom shader
.
Sorting LayerName of the Renderer’s sorting layer.
Order in LayerThis Renderer’s order within a sorting layer.
Light ProbesProbe-based lighting interpolation
mode.
Reflection ProbesIf enabled and reflection probes are present in the Scene, a reflection Texture is picked for this Line Renderer and set as a built-in Shader uniform variable.
  1. 对line render使用Particle Shader的Material.最好

Hints.

  • View:当你移动相机时,线条可能会出现旋转  Local :取消这个.
  • 线渲染器应该是游戏对象上唯一的渲染器。..

Line Renderer example setup

 

Trail Renderer:拖尾

Properties

Property:Function:
Cast ShadowsDetermines whether the trail casts shadows, whether they should be cast from one or both sides of the trail, or whether the trail should only cast shadows and not otherwise be drawn. See Renderer.shadowCastingMode in the Scripting API reference documentation to learn more.
Receive ShadowsIf enabled, the trail receives shadows.
Motion VectorsSelect the Motion Vector type to use for this Trail Renderer. See Renderer.motionVectorGenerationMode in the Scripting API reference documentation to learn more.
MaterialsThese properties describe an array of Materials used for rendering
the trail. Particle Shaders
work best for trails.
Lightmap ParametersReference a Lightmap Parameters Asset here to enable the trail to interact with the global illumination system.
Time拖尾的生命周期
Min Vertex Distance拖尾的最小距离 (see Minimum vertex separation below).
AutoDestruct过了生命周期是否自动销毁
WidthDefine a width value and a curve to control the width of your trail at various points between its start and end. The curve is applied from the beginning to the end of the trail, and sampled at each vertex. The overall width of the curve is controlled by the width value.
ColorDefine a gradient to control the color of the trail along its length.
Corner Vertices此属性指示在路径中绘制角时使用多少额外的顶点。增加这个值使轨迹角看起来更圆
End Cap Vertices线结尾处应该用多少顶点来结束,点越多,越圆滑
AlignmentSet to View to make the Trail face the camera
, or Local to align it based on the orientation of its Transform component
.
Texture ModeControl how the Texture is applied to the Trail. Use Stretch to apply the Texture map along the entire length of the trail, or use Wrap to repeat the Texture along the length of the Trail. Use the Tiling parameters in the Material to control the repeat rate.
Generate Lighting DataWhen enabled, the trail geometry includes Normals and Tangents. This allows the trail to use Materials that use the scene lighting, for example via the Standard Shader
, or by using a custom shader.
Light ProbesProbe-based lighting interpolation
mode.
Shadow BiasMove shadows along the direction of the light to remove shadowing artifacts caused by approximating a volume with billboarded geometry.
Sorting LayerName of the Renderer’s sorting layer.
Order in LayerThis Renderer’s order within a sorting layer.
Reflection ProbesIf enabled and reflection probes are present in the Scene, a reflection Texture is picked for this Trail Renderer and set as a built-in Shader uniform variable.

 

Billboard Renderer

 Billboard Renderer 渲染BillboardAssets, 要么是来自预先准备好的资产(比如 SpeedTree) or 来自自定义创建的文件 (例如,在运行时使用脚本或自定义编辑器创建).

Billboards are a level-of-detail (LOD) 用于在场景中较远的地方以更简单的方式绘制复杂的三维网格

Property:Function:
Cast ShadowsIf enabled, the billboard creates shadows when a shadow-casting Light shines on it.
     OnEnable shadows.
     OffDisable shadows.
     Two SidedAllow shadows to be cast from either side of the billboard (that is, backface culling is not taken into account).
     Shadows OnlyShow shadows, but not the billboard itself.
Receive ShadowsCheck the box to enable shadows to be cast on the billboard.
Motion VectorsCheck the box to enable rendering
of the billboard’s motion vectors into the Camera Motion Vector Texture. See Renderer.motionVectors in the Scripting API for more information.
Billboard如果你有一个预先制作的Billboard Asset,把它放在这里分配给这个Billboard Renderer.。
Light ProbesIf enabled, and if baked Light Probes are present in the Scene, the Billboard Renderer uses an interpolated Light Probe for lighting.
     OffDisable Light Probes.
     Blend ProbesThe lighting applied to the billboard is interpreted from one interpolated Light Probe.
     Use Proxy VolumeThe lighting applied to the Billboard Renderer is interpreted from a 3D grid of interpolated Light Probes.
Reflection ProbesIf enabled, and if Reflection Probes are present in the Scene, a reflection Texture is picked for this GameObject
and set as a built-in Shader
uniform variable.
     OffDisable Reflection Probes.
     Blend ProbesThe reflections applied to the billboard are interpreted from adjacent Reflection Probes, and do not take the the skybox
into account. This is generally used for GameObjects that are “indoors” or in covered parts of the Scene (such as caves and tunnels), because the sky is not visible and therefore wouldn’t be reflected by the billboard.
     Blend Probes and SkyboxThis works like Blend Probes, but also allows the skybox to be used in the blending. This is generally used for GameObjects in the open air, where the sky would always be visible and reflected.
     SimpleReflection Probes are enabled, but no blending occurs between probes when there are two overlapping volumes.

 

Billboard Asset

 Billboard Asset 一个更复杂的网格的预渲染图像集合 Billboard Renderer,为了在和Camera一定距离 的时候渲染它,通过LOD技术

最常见的方式产生一个Billboard Asset是在SpeedTree Modeler中创建文件,然后将它们导入Unity。也可以创建自己的Billboard Asset从脚本. See the API reference for BillboardAsset for further details.

 

Projector

Switch to Scripting

 Projector 允许你把一个 Material 投射到它的截面体内,材质球的 shader必须是特殊声明的,能够为projecting正确工作的, standard assets有提供的shader/Light and Projector/Multiply shaders.

Properties

Property:Function:
Near Clip Plane投影的近平面
Far Clip Plane投影的原平面
Field Of ViewT视场的角度。这只在投影仪不是Ortho Graphic的情况下使用。.
Aspect RatioThe Aspect Ratio of the Projector. This allows you to tune the height vs width of the Projector.
Is Ortho GraphicIf enabled, the Projector will be Ortho Graphic instead of perspective.
Ortho Graphic SizeThe Ortho Graphic size of the Projection. this is only used if Is Ortho Graphic is turned on.
MaterialThe Material that will be Projected onto Objects.
Ignore LayersObjects that are in one of the Ignore Layers will not be affected. By default, Ignore Layers is none so all geometry that intersects the Projector frustum will be affected.

Details

通过 projector 你可以:

  1. 生成一个 shadows.
  2. Make a real world projector on a tripod with another Camera
    that films some other part of the world using a Render Texture
  3. Create bullet marks.
  4. Funky lighting effects.

Note: 创建一个projector时,确保使用的材质球的贴图的 wrap模式 为 clamp.否则投影仪的纹理会被重复看到,你将不会得到想要的阴影效果。

Hints

  • Projector Blob shadows可以创造非常令人印象深刻的分裂细胞般的灯光效果.
  • 当没有 Falloff Texture 时,可以创造非常令人印象深刻的分裂细胞般的灯光效果. 解决方法是使用一个只有透明通道的Falloff 贴图具有最左边黑色像素列的纹理。

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/660477
推荐阅读
相关标签
  

闽ICP备14008679号