Unity 自带光晕组件学习

今天把viking village拿出来看了下,毕竟是3年前的工程,效果确实赶不上现在的《死亡之书》等2018版本的工程,有几个插件平时没有用到,学习了下

光晕组件:Lens Flare(镜头炫光)


注意:一定要放到足够高的地方,并在视野内,与天空盒的太阳光处重合


工程面板中创建LensFare,并将太阳光贴图放入其中


回到场景中查看效果


文档介绍:

Lens Flare

Lens Flares simulate the effect of lights refracting inside camera lens. They are used to represent really bright lights or, more subtly, just to add a bit more atmosphere to your scene.

The easiest way to setup a Lens Flare is just to assign the Flare property of the Light. Unity contains a couple of pre-configured Flares in the Standard Assets package.

Otherwise, create an empty GameObject with GameObject->Create Empty from the menu bar and add the Lens Flare Component to it with Component->Effects->Lens Flare. Then choose the Flare in the Inspector.

To see the effect of Lens Flare in the Scene View, check the Effect drop-down in the Scene View toolbar and choose the Flares option.

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

Properties

Property:Function:
FlareThe Flare to render. The flare defines all aspects of the lens flare’s appearance.
ColorSome flares can be colorized to better fit in with your scene’s mood.
BrightnessHow large and bright the Lens Flare is.
Fade SpeedHow quickly or slowly the flare will fade.
Ignore LayersSelect masks for layers that shouldn’t hide the flare.
DirectionalIf set, the flare will be oriented along positive Z axis of the game object. It will appear as if it was infinitely far away, and won’t track object’s position, only the direction of Z axis.

Details

You can directly set flares as a property of a Light Component, or set them up separately as Lens Flare component. If you attach them to a light, they will automatically track the position and direction of the light. To get more precise control, use this Component.

Camera has to have a Flare Layer Component attached to make Flares visible (this is true by default, so you don’t have to do any set-up).

Hints

  • Be discrete about your usage of Lens Flares.
  • If you use a very bright Lens Flare, make sure its direction fits with your scene’s primary light source.
  • To design your own Flares, you need to create some Flare Assets. Start by duplicating some of the ones we provided in the the Lens Flares folder of the Standard Assets, then modify from that.
  • Lens Flares are blocked by Colliders. A Collider in-between the Flare GameObject and the Camera will hide the Flare, even if the Collider does not have a Mesh Renderer. If the in-between Collider is marked as Trigger it will block the flare if and only if Physics.queriesHitTriggers is true.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Deveuper

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值