Как открыть lighting в unity
Lighting Window
The Lighting Window (menu: Window > Lighting) is the main control point for Unity’s Global Illumination (GI) features. Although GI in Unity gives good results with default settings, the window’s properties allow you to adjust many aspects of the GI process to customise your scene or optimise for quality, speed and storage space as you need. This window also contains lighting-related settings that were available under the Render Settings in Unity versions prior to 5.0. These include ambient light, halos, cookies and fog.
Обзор
The controls of the Lighting window are divided among three tabs:
The Object tab lets you choose subsets of the objects in your scene and change settings for them. This is very useful for selecting which objects should participate in the GI computations and also for applying settings consistently to groups of objects.
The Scene tab has settings that apply to the scene overall rather than individual objects. These settings control lighting effects and also optimisation options.
The Lightmaps tab shows the lightmap asset files generated by the GI process.
The tabs are described in full detail below.
Regardless of which tab is selected, the window also has an Auto checkbox near the bottom. If enabled, this allows the lightmap data to be updated while you edit the scene (although you should note that the update usually take a few seconds rather than happening instantaneously). If Auto is disabled then the Build button to the right of the checkbox becomes active; use the button to trigger lightmap updates as you need them. The Build button also has a dropdown menu with an option to clear the baked data from the scene (without clearing the GI Cache).
Below the Auto checkbox is a small panel showing lightmap statistics.
Object Tab
The Object tab lets you select groups of objects and apply settings to them.
At the top of the tab is a set of Scene Filter buttons that let you limit the hierarchy view to specific types of objects: Lights, Renderers, Terrains. Selecting All will show the hierarchy view as normal.
If you select any of the other buttons then the hierarchy view will be limited to showing just those object types. This is essentially just a quick way to access the standard hierarchy view filter for the most common cases.
Note that the filter does not affect which object is currently selected, so it is possible to have, say, a terrain object selected even when the hierarchy is filtered to show only lights.
The relevance of the filter buttons is that each of the three object types has its own set of properties, each described in detail below.
Lights
For a light object, the Object tab essentially shows the same information as the light component’s standard inspector panel. The properties that specifically affect GI are Baking and Bounce Intensity.
Baking allows you to choose if the light should be baked if Baked GI is selected. Mixed will also bake it, but it will still be present at runtime to give direct lighting to non-static objects. Realtime works both for Precomputed Realtime GI and when not using global illumination.
Bounce Intensity allows you to vary the intensity of indirect light (ie, light that is bounced from one object to another. The value is a multiple of the default brightness calculated by the GI system; if you set Bounce Intensity to a value greater than one then bounced light will be made brighter, while a value less than one will make it dimmer. This is useful, for example, when a dark surface in shadow (such as the interior of a cave) needs to be rendered brighter in order to make detail visible. Or alternatively, if you want to use Precomputed Realtime GI in general, but want to limit a single light to give direct light only, you can set its Bounce Intensity to 0.
Renderers
For Renderers, the following properties are available:
| Свойство: | Функция: |
|---|---|
| Lightmap Static | This indicates to Unity that the object’s location is fixed and so it should participate in the GI. If an object is not marked as Lightmap Static then it can still be lit using Light Probes. |
| Scale in Lightmap | This value affects the number of pixels in the lightmap texture that are used for this object. With the default value of 1.0, the number of lightmap pixels used for the object is only dependent on its surface area (ie, same number of pixels per unit area for all objects). A value greater than 1.0 increases the number of pixels (ie, the lightmap resolution) used for this object while a value less than 1.0 decreases it. You can use this property to optimise lightmaps so that important and detailed areas are more accurately lit. For example, an isolated building with flat, dark walls might look fine with a low lightmap scale (less than 1.0) while a collection of colourful motorcycles displayed close together might warrant a high scale value. |
| Preserve UVs | Unity can recalculate the UV coordinates used for the realtime lightmap texture so as to improve its storage and performance characteristics. Please note that the recalculation process will sometimes make misjudgements about discontinuities in the original UV mapping. For example, an intentionally sharp edge may be misinterpreted as a continuous surface, resulting in artifacts where the seam should be. If Preserve UVs is enabled then the lightmapping UVs from the object will be translated to the lightmap to retain the effect intended by the artist. If Preserve UVs is switched off then Unity will calculate the realtime lightmap UVs based on the baked UVs so as to join adjacent “charts” and compact the lightmap as much as possible. This calculation is based on the two settings below (max distance and max angle). The realtime charts are packed with a half pixel border around them. This ensures that we get no leaking when rendering from them. |
| Auto UV Max Distance | Enlighten automatically generates simplified UVs by merging UV charts. Charts will only be simplified if the worldspace distance between the charts is smaller than this value. |
| Auto UV Max Angle | Enlighten automatically generates simplified UVs by merging UV charts. Charts will only be merged if the angle between the charts is smaller than this value. |
| Important GI | This tells Unity that light reflected or emitted from the object is likely to affect other objects in a noticeable way. This ensures that subtle illumination effects created by this object are not optimised away. |
| Advanced Parameters | Allows you to choose or create a set of Lightmap Parameters for the current object selection. |
Terrains
For Terrains, the properties are a subset of those available for renderers.
| Свойство: | Функция: |
|---|---|
| Lightmap Static | This indicates to Unity that the object’s location is fixed and so it should participate in the GI. If an object is not marked as Lightmap Static then it can still be lit using Light Probes. |
| Scale in Lightmap | This value affects the number of pixels in the lightmap texture that are used for this object. With the default value of 1.0, the number of lightmap pixels used for the object is only dependent on its surface area (ie, same number of pixels per unit area for all objects). A value greater than 1.0 increases the number of pixels (ie, the lightmap resolution) used for this object while a value less than 1.0 decreases it. You can use this property to optimise lightmaps so that important and detailed areas are more accurately lit. |
| Advanced Parameters | Allows you to choose or create a set of Lightmap Parameters for the current object selection. The default parameter set for Terrains is the Very Low Resolution built-in set. |
Scene Tab
The Scene tab contains settings that apply to the scene overall as opposed to individual objects. Note that Precomputed Realtime GI and Baked GI features can be enabled or disabled by clicking the checkboxes next to their names in the Scene tab.
The Build button will start the lighting build process. The button can expand into a dropdown where you can clear the baked data. This isn’t the same as clearing the GICache.
Lightmaps Tab
The final tab provides an easy way to set and locate the lightmap asset file used for the scene.
If you click the filename in the Lightmap Snapshot box, the Project view will show you the asset file. If you click the small pip next to the box, an object selection window will appear to let you select a different lightmap. If you rename the folder where the current lightmap asset is located and then set the Lightmap Snapshot property to None, a new file will be created the next time you build the lightmap. Using multiple files like this is a good way to test out GI settings and compare different sets of parameters.
The image below the Lightmap Snapshot box shows a preview of the lightmap. This is only available when Baked lights are used; the preview will be blank for Realtime lights.
Lightmapping Quickstart (Введение в карты освещения)
Это введение в карты освещения в Unity. Для получения подробностей смотрите in-depth description of lightmapping in Unity.
Unity располагает встроенным инструментом для создания карт освещения: это Beast от Illuminate Labs. Он полностью интегрирован в Unity. Это значит, что Beast запекает карты освещения для вашей сцены, основываясь на том, как ваша сцена настроена в Unity, какие содержит меши, материалы, текстуры и источники света. Это также значит, что карты освещения теперь являются неотъемлемой частью рендеринга — после их создания вам не придётся ничего больше делать, они автоматически применятся к объектам.
Подготовка сцены к запеканию карт освещения
Выбор ____Window__ – Lightmapping__ из меню откроет окно Lightmapping:
Scene View и Game View будут обновлены — теперь ваша сцена оснащена картами освещения!
Настройка запекания карт освещения
Окончательный вид вашей сцены зависит во многом от настройки освещения и настроек запекания карт освещения. Рассмотрим для примера некоторые основные настройки, которые помогут улучшить качество освещения.
This is a basic scene with a couple of cubes and one point light in the centre. The light is casting hard shadows and the effect is quite dull and artificial.
В Unity Pro можно сделать ещё один шаг вперёд, активировав Global Illumination (глобальное освещение) и добавив Sky Light (свет от небесного свода). Во вкладке Bake задайте параметру Bounces значение 1, а параметру Sky Light Intensity — значение 0.5. В результате получится намного болеее мягкое освещение с эффектами смешивания — намного красивее, и это всего лишь три куба и один источник света!
Подробности о картах освещения
Для получения подробностей о различных настройках, связанных с картами освещения, смотрите in-depth description of lightmapping in Unity.
The Lighting window
The Lighting window (menu: Window > Rendering The process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
See in Glossary > Lighting) is the main control point for Unity’s lighting features. You can use the Lighting window to adjust settings related to the lighting in your Scene, and to optimise your precomputed lighting data for quality, bake time, and storage space.
Related APIs
Lighting window layout
The Lighting window contains the following elements:
The Scene tab
The Scene A Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary tab displays information about the Lighting Settings Asset that is assigned to the active Scene. If no Lighting Settings Asset is assigned to the active Scene, it displays information about the default LightingSettings object.
The Scene tab is divided into two sections:
Lighting Settings Asset controls
Use the controls in this section to assign a Lighting Settings Asset to the active Scene, or to create a new Lighting Settings Asset.
| Property: | Function: |
|---|---|
| Lighting Settings | The Lighting Settings Asset assigned to the active Scene. |
| New Lighting Settings | Click this button to generate a new Lighting Settings Asset in your Project, and automatically assign the new Lighting Settings Asset to the active Scene. |
Lighting Settings
Use this section to view and edit the properties of the Lighting Settings Asset or LightingSettings object assigned to the current Scene. See Lighting Settings Asset.
Workflow settings
This section contains settings that help you debug your Scene.
The Environment tab
The Environment tab contains settings related to environmental lighting effects for the current Scene. The contents depend on the render pipeline that your Project uses.
Built-in Render Pipeline and Universal Render Pipeline
In the Built-in Render Pipeline and URP, the Environment tab is divided into two sections:
Environment
The Environment section contains lighting-related settings and controls that apply to the environmental lighting in the current scene, such as the Skybox, diffuse lighting and reflections.






