Using Lights 使用光照 光照系列6

Using Lights 使用光照

本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.3版本
参考链接:https://docs.unity3d.com/Manual/UsingLights.html

Lights are very easy to use in Unity - you simply need to create a light of the desired type (eg, from the menu GameObject > Light > Point Light) and place it where you want it in the scene. If you enable scene view lighting (the “sun” button on the toolbar) then you can see a preview of how the lighting will look as you move light objects and set their parameters.
灯光在Unity中非常容易使用——你只需要创建一个你想要的类型的灯光(例如,从菜单GameObject > light > Point light),并将它放置在你想要的场景中。如果启用场景视图照明(工具栏上的“sun”按钮),则可以预览在移动光对象并设置它们的参数时,照明效果如何。
在这里插入图片描述
A directional light can generally be placed anywhere in the scene(except when it is using a Cookie) with the forward/Z axis indicating the direction. A spot light also has a direction but since it has a limited range, its position does matter. The shape parameters of spot, point and area lights can be adjusted from the inspector or by using the lights’ Gizmos directly in the scene view.
方向灯通常可以放置在场景的任何地方(除了使用Cookie时),前/Z轴表示方向。聚光灯也有方向,但由于它的范围有限,它的位置确实很重要。聚光灯、点灯和区域灯的形状参数可以通过inspector进行调整或者直接在场景视图中使用灯光的图标。
在这里插入图片描述
A spot light with Gizmos visible

Guidelines for Placing Lights 放置灯的指南

A directional light often represents the sun and has a significant effect on the look of a scene. The direction of the light should point slightly downwards but you will usually want to make sure that it also makes a slight angle with major objects in the scene. For example, a roughly cubic object will be more interestingly shaded and appear to “pop” out in 3D much more if the light isn’t coming head-on to one of the faces.
定向光通常代表太阳,对场景的效果有重要影响。光线的方向应该稍微向下,但是你通常会想要确保它与场景中的主要物体形成一个轻微的角度。例如,一个大约立方体的物体,如果光线没有正面照射到其中一个面,它的阴影会更有趣,而且在3D中会更“突出”。

Spot lights and point lights usually represent artificial light sources and so their positions are usually determined by scene objects. One common pitfall with these lights is that they appear to have no effect at all when you first add them to the scene. This happens when you adjust the range of the light to fit neatly within the scene. The range of a light is the limit at which the light’s brightness dims to zero. If you set, say, a spot light so the base of the cone neatly lands on the floor then the light will have little or no effect unless another object passes underneath it. If you want the level geometry to be illuminated then you should expand point and spot lights so they pass through the walls and floors.
聚光灯和点光源通常代表人造光源,所以它们的位置通常由场景对象决定。这些灯光的一个常见缺陷是,当你第一次把它们添加到场景中时,它们看起来一点效果都没有。当你调整光线的范围,使之与场景完美贴合时,效果就会发生。光的范围是指光的亮度变暗到零的范围。如果你设置一个聚光灯,让圆锥体的底部干净利落地落在地板上,那么除非另一个物体从下面经过,否则光线几乎没有效果。如果你想要水平几何体被照亮,那么你应该扩展点和聚光灯,让它们穿过墙壁和地板。

Color and Intensity 颜色和强度

A light’s color and intensity (brightness) are properties you can set from the inspector. The default intensity and white color are fine for “ordinary” lighting that you use to apply shading to objects but you might want to vary the properties to produce special effects. For example, a glowing green forcefield might be bright enough to bathe surrounding objects in intense green light; car headlights (especially on older cars) typically have a slight yellow color rather than brilliant white. These effects are most often used with point and spot lights but you might change the color of a directional light if, say, your game is set on a distant planet with a red sun.
光的颜色和强度(亮度)是你可以从检查器中设置的属性。默认的亮度和白色对于“普通”照明效果很好,您可以使用它来对对象应用着色,但是您可能想要改变属性来产生特殊效果。例如,一个发光的绿色力场可能足够亮,可以让周围的物体沐浴在强烈的绿光中;汽车前灯(尤其是老式汽车)通常是浅黄色而不是亮白色。这些效果通常与点光源和聚光灯一起使用,但是如果你的游戏设置在一个遥远的行星上,有一个红色的太阳,你可能会改变方向光的颜色。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值