Unity3D说明文档翻译-Using Lights

来源:互联网 发布:软件服务外包合同范本 编辑:程序博客网 时间:2024/04/30 13:37

Using Lights

使用灯光

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内非常易于使用--你只需简单地创建一个需要灯光类型(比如,从菜单游戏对象>灯光>点光源)并把它放到场景内你想要的地方.如果你激活场景显示光照(工具条上的太阳按钮)则你可以看到光照的预览,你可以如何移动和设置它们的参数.

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轴表明方向.一个投射光也有一个方向但因为它有一个限制范围,它的位置很重要.投射的形状参数,点光源和区域光可以通过检视面板或在场景内使用灯光的线框直接地调整.

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.

一个平行光通常代表太阳或一个对场景样子有很大影响的光照.光的方向需要稍微地指向向下但你通常将确保它也对场景内主要对象产生一个轻微的角度.例如,一个粗糙的立方体对象如果光照不是正面的照在某个面上,将会有更有趣的阴影和 看起来更有立体感.

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.

投射光和点光源通常表现人造光源因此它们的位置视场景对象而定.这些灯光的一个普遍缺陷是当你第一次添加它们到场景内时它们是否根本没有效果.这发生在当你调整灯光范围以适应场景时.一个灯光的范围受灯光亮度昏暗到0的限制.如果你设置,比如说,一个投射光基于圆锥着陆到地面上然而灯光只有一点或没有效果,直到另一个物体在它下面经过.如果你想水平几何结构被照亮则你需要扩大点光源和投射光以便它们穿过墙和地面.

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.

一个光源的颜色和强度(亮度)是你可以通过检视面板设置的属性.默认强度和白色适于普通灯光,用于给对象产生阴影,但你可能想改变属性以产生特殊效果.例如,一个发光的绿色力场可能要足够明亮以便时周围对象沐浴在绿光中;汽车前灯(特别是旧汽车)通常有一点轻微黄色而不是亮白色.这些效果最通常使用点光源或投射光,但你可能要改变一个平行光的颜色,比如说你的游戏设定在一个有红色太阳的遥远行星上.

 

0 0