This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Лайтмаппинг

Lightmapping is a static global illumination technique using precalculated textures that store brightness and reflected color of lit surfaces. By using lightmapping you can avoid heavy computations of lighting in primarily static scenes.Лайтмаппинг - это метод статического глобального освещения с использованием предварительно рассчитанных текстур, которые сохраняют яркость и отраженный цвет освещенных поверхностей. Используя лайтмаппинг, вы можете избежать тяжелых вычислений освещения в основном в статичных сценах.

Lightmapping is the most efficient solution enabling to achieve realistic diffuse lighting and keep the high performance. It is capable of giving high-detailed global illumination combined with simulation of many light bounces. The number of bounces is the key aspect of creating realistic lighting in bright scenes. When you use lightmapping it doesn’t matter how many rays, bounces, or light sources are there, as everything is calculated once and then baked in textures.Лайтмаппинг - наиболее эффективное решение, позволяющее добиться реалистичного рассеянного освещения при сохранении высоких характеристик. Оно позволяет обеспечить высокодетальное глобальное освещение в сочетании с имитацией множества отражений света. Количество отскоков - ключевой аспект создания реалистичного освещения в ярких сценах. При использовании лайтмаппинга, количество лучей, отражений или источников света не имеет значения, поскольку все рассчитывается один раз, а затем запекается в текстурах. Текстуры эти затем просто проецируются на поверхности объектов придавая им реалистичный вид.

UNIGINE provides an integrated GPU-accelerated Lightmapper tool available in the Bake Lighting window.В UNIGINE есть интегрированный инструмент Lightmapper с GPU-ускорением, а находится он в окне Bake Lighting.

Current limitations:Текущие ограничения:

  • Lightmapping is available only for surfaces of Static Mesh objects.Лайтмаппинг доступен только для поверхностей объектов Static Mesh.
  • Only Non-Directional lightmaps are supported at the moment (normal maps are not taken into account).На данный момент поддерживаются только ненаправленные карты освещения (карты нормалей не учитываются).
  • Only global illumination is baked, direct lighting is to be provided by light sources.Запекается только глобальное освещение, прямое освещение должно обеспечиваться источниками света.

See AlsoСмотрите также#

  • Lightmaps baking is also available via code by using the BakeLighting Class.Запекание карт освещения также доступно через код с использованием класса BakeLighting.

Preparing The ContentПодготовка контента#

Proper and non-overlapping UV-coordinates of scenery are required for correct lightmapping. In the case your assets do not have these, automatic UV unwrapping on import is provided. The overall workflow is the following:Правильные и неперекрывающиеся UV-координаты декораций необходимы для правильного картографирования освещения. В случае, если у ваших ассетов их нет, можно воспользоваться автоматической UV-разверткой при импорте объектов.

In the Import Settings for FBX, CAD models and UNIGINE .mesh assets, select the UV Channel and Target Resolution to be used for lightmaps and, if needed, check UV channels to unwrap. Traditionally, the 0 UV channel is used for texturing and the 1 channel is for lightmapping.В Import Settings для FBX, моделей САПР и ресурсов UNIGINE .mesh выберите UV Channel и Target Resolution, которые будут использоваться для карт освещения, и, при необходимости, отметьте UV-каналы, которые нужно развернуть. Традиционно канал 0 UV используется для текстурирования, а канал 1 - для карты освещения.

The Lightmap Target Resolution parameter has the direct influence on the baking time and the final quality.Параметр Lightmap Target Resolution имеет прямое влияние на время запекания и конечное качество.

Примечание
Unwrapping thin polygon meshes intended to be used with double-sided materials applied, such as pieces of paper, banners or fabrics, may lead to visual artifacts when lightmapping. It is recommended to consider re-modeling such meshes by adding polygons for the other side of the model.Распаковка тонких полигональных сеток, предназначенных для использования с двусторонними материалами, такими как листы бумаги, баннеры или ткани, может привести к визуальным артефактам при картировании освещения. Рекомендуется рассмотреть возможность повторного моделирования таких мешей путем добавления полигонов для другой стороны модели.

For all surfaces intended to be lightmapped, the Lightmaps Parameters are needed to be adjusted:Для всех поверхностей, предназначенных для картографирования освещения, необходимо настроить Параметры карт освещения :

  1. Check Enabled to enable the feature.Установите флажок Enabled, чтобы включить эту функцию.
  2. Select the Bake Unique Texture, if you intend to use the integrated lightmapper.Выберите Bake Unique Texture, если вы собираетесь использовать интегрированный Lightmapper .
  3. Also, you can specify the lightmap Texture generated in a third-party software. Select the Use Custom Texture mode for this purpose.Кроме того, вы можете указать текстуру карты освещения, созданную в стороннем программном обеспечении. Для этого выберите режим Use Custom Texture.

For a surface to contribute to static GI, it must have the Lighting Mode set to Static or have the Cast Global Illumination option enabled in the Advanced Lighting Mode.Чтобы поверхность способствовала запеканию статического GI, на ней должна быть включена опция Cast Global Illumination.

For selective group-based shading when baking lightmaps, adjust the Viewport Masks. A surface will be visible for the lightmapper only if its Viewport Mask matches the Baking Viewport Masks of the Bake Lighting window.Для выборочного группового затенения при запекании карт освещения настройте Viewport Masks. Поверхность будет видна для Lightmapper, только если ее Viewport Mask совпадает с Baking Viewport Masks окна Bake Lighting.

Finally, set up light sources in the scene:Наконец, установите источники света в сцене:

  • For light sources that should contribute to lightmapping, select the Static mode, Dynamic lights will be ignored. Only indirect lighting from lights is baked into lightmaps, so light sources are to be kept enabled to provide direct lighting and specular highlights.Для источников света , которые должны способствовать составлению карт освещения, выберите режим Static. Индикаторы Dynamic игнорируются. В карты освещения запекается только непрямое освещение от источников света, поэтому источники света должны быть включены для обеспечения прямого освещения и зеркальных бликов.
  • For emissive surfaces (having Emission state in the material parameters enabled) also enable the Emission Bake GI option. Both direct and indirect (bounced) lighting from emissive materials is baked into lightmaps.Для излучающих поверхностей (с включенным состоянием Emission в параметрах материала) также включите опцию Emission Bake GI. Как прямое, так и непрямое (отраженное) освещение от излучающих материалов запекается в карты освещения.
  • Lighting from Voxel and Environment Probes is not considered.Освещение от Voxel и Environment Probes не рассматривается.

BakingЗапекание#

  1. Enable the Lightmap buffer: Rendering -> Buffers -> Lightmap.Включите буфер Lightmap: Rendering -> Buffers -> Lightmap.
  2. Open the Bake Lighting window.Откройте окно Bake Lighting.
  3. Enable Bake Lightmaps for Surfaces. Adjust the baking settings:
    • Set up the Baking Viewport Masks.Set up the Baking Viewport Masks.
    • Select the desired baking Quality. The Draft option provides the shortest baking time and is suitable for development iterations, while the Ultra quality engages the biggest possible number of light rays to be simulated and the best sampling resolution.Select the desired baking Quality. The Draft option provides the shortest baking time and is suitable for development iterations, while the Ultra quality engages the biggest possible number of light rays to be simulated and the best sampling resolution.
    • Adjust the Far Clipping Distance for simulated light rays.Adjust the Far Clipping Distance for simulated light rays.
    Set up the Baking Viewport Masks.Select the desired baking Quality. The Draft option provides the shortest baking time and is suitable for development iterations, while the Ultra quality engages the biggest possible number of light rays to be simulated and the best sampling resolution.Adjust the Far Clipping Distance for simulated light rays.
    Включите Bake Lightmaps for Surfaces. Отрегулируйте настройки запекания:
    • Set up the Baking Viewport Masks.Настройте Baking Viewport Masks.
    • Select the desired baking Quality. The Draft option provides the shortest baking time and is suitable for development iterations, while the Ultra quality engages the biggest possible number of light rays to be simulated and the best sampling resolution.Выберите желаемое качество запекания (Quality). Параметр Draft обеспечивает самое короткое время запекания и подходит для итераций разработки, в то время как качество Ultra задействует максимально возможное количество симулируемых световых лучей и обеспечивает наилучшее разрешение выборки.
    • Adjust the Far Clipping Distance for simulated light rays.Отрегулируйте Far Clipping Distance для имитации световых лучей.
  4. Adjust the Common Settings:
    • Select the number of light ray bounces. Higher values will result in a brighter lighting since each surface receives more photons.Select the number of light ray bounces. Higher values will result in a brighter lighting since each surface receives more photons.
    • Set the number of samples calculated per frame. This parameter is available for adjustment during baking process.Set the number of samples calculated per frame. This parameter is available for adjustment during baking process.
    Select the number of light ray bounces. Higher values will result in a brighter lighting since each surface receives more photons.Set the number of samples calculated per frame. This parameter is available for adjustment during baking process.
    Отрегулируйте общие настройки:
    • Select the number of light ray bounces. Higher values will result in a brighter lighting since each surface receives more photons.Выберите количество отскоков светового луча. Более высокие значения приведут к более яркому освещению, поскольку каждая поверхность получает больше фотонов.
    • Set the number of samples calculated per frame. This parameter is available for adjustment during baking process.Установите количество отсчетов для каждого кадра. Этот параметр доступен для настройки в процессе запекания.
  5. Start baking process by clicking Bake All Lighting and wait for it to finish. Live preview is available. Several iterations (one per bounce) will be simulated for each affected surface.

    You can stop the process at any moment by using the Stop button and you will be prompted to keep the achieved result or restore the previous textures.You can stop the process at any moment by using the Stop button and you will be prompted to keep the achieved result or restore the previous textures.

    You can stop the process at any moment by using the Stop button and you will be prompted to keep the achieved result or restore the previous textures.
    Запустите процесс запекания, нажав Bake All Lighting, и дождитесь его завершения. Доступен предварительный просмотр в реальном времени. Для каждой затронутой поверхности будет смоделировано несколько итераций (по одной на отскок).
    Примечание
    Вы можете остановить процесс в любой момент, нажав кнопку Stop, и вам будет предложено сохранить достигнутый результат или восстановить предыдущие текстуры.
  6. Upon completion, generated lightmaps will be saved in the bake_lighting/lightmaps folder and applied to the corresponding surfaces.По завершении сгенерированные карты освещения будут сохранены в папке bake_lighting/lightmaps и применены к соответствующим поверхностям.
  7. In the materials settings of lightmapped surfaces, consider enabling the Lightmap Cubic Filtering option for better quality.В настройках материалов для поверхностей с картой освещения рассмотрите возможность включения параметра Lightmap Cubic Filtering для лучшего качества.

You can check the result by selecting the Baked Lightmap mode in the Rendering Debug.Вы можете проверить результат, выбрав режим Indirect Lighting в файле Rendering Debug.

If you are not satisfied with results on certain objects, you can select surfaces and/or nodes and perform partial re-bake using different settings by clicking Bake Selected in the Bake Lighting window.Если вас не устраивают результаты для определенных объектов, вы можете выбрать поверхности и / или узлы и выполнить частичное повторное запекание, используя другие настройки, нажав Bake Selected.

The lightmap texture of a single object was re-baked to get proper color reflection from floor.Текстура карты освещения отдельного объекта была повторно запечена, чтобы получить правильное цветное отражение от пола.

Levels of DetailУровни детализации#

There is no need to bake a separate lightmap for each level of detail. You can save space and time by sharing already baked lightmaps between different LODs (works for LODs having the same UV maps):Нет необходимости запекать отдельную карту освещения для каждого LOD. Вы можете сэкономить место и время, поделившись уже запеченными картами освещения между разными LOD (работает для LOD, имеющих одинаковые UV-карты):

  1. Select the Bake Unique Texture mode for LOD 0.Выберите параметр Bake Unique Texture для LOD0.
  2. Select the Reuse Texture From Other Surface mode for all other LODs that will share its lightmap. Specify the LOD 0 in their Surface parameter.

    Выберите опцию Reuse Texture From Other Surfaces для всех остальных LOD, которые будут совместно использовать свою карту освещения. Укажите LOD0 в параметре Surface.

  3. Proceed to light baking to bake the lightmap for the LOD 0.Запекаем карту освещения для LOD0.
  4. The lightmap texture baked for LOD 0 will be automatically used for the other LODs.Текстура карты освещения, запеченная для LOD0, будет автоматически назначена полю Texture для других LOD.
Последнее обновление: 29.12.2022
Build: ()