This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

灯光设置

Light is an integral part of every scene, and the number of light sources in the world can be close to infinite with all aircraft lights and strobes, airport and city illumination, strobes and so on.灯光是每个场景不可或缺的一部分,在所有飞机灯和频闪灯,机场和城市照明,频闪灯等中,世界上的光源数量可以接近无限。

Light sources are categorized by their application — on an aircraft or in the scene:光源按用途分类-在飞机上或在现场:

  • Aircraft lights are controlled via the LightAircraft property and are described in ig_config.xml as entity components.飞机灯是通过LightAircraft属性控制的,在ig_config.xml中描述为实体组件
  • To manage all ground-based light sources fast and easy, the Light Controller system is used. You can arrange all lights in the scene into the hierarchy using the LightSourceComponent property and enable or disable certain groups of lights, surfaces, or materials according to your needs, adjust their intensity, or make them strobes. For light sources that do not require manual control and depend only on time of day, AutomaticTimeLightingComponent is foreseen. This component manages automatic switching on/off the light depending on the position of the sun and moon.为了方便快捷地管理所有地面光源,使用了Light Controller系统。您可以使用LightSourceComponent属性将场景中的所有灯光排列到层次结构中,并根据需要启用或禁用某些组的灯光,曲面或材质,调整它们的强度或使其成为频闪灯。对于不需要手动控制且仅取决于一天中的时间的光源,可以预见AutomaticTimeLightingComponent。该组件根据太阳和月亮的位置来管理自动打开/关闭灯。

See Also
也可以看看#

  • The IG plugin API section for more details on managing IG via code (C++).IG插件API部分,了解有关通过代码(C ++)管理IG的更多详细信息。

LightAircraft
轻型飞机#

Setting aircraft lights requires the use of two components: LightAircraft and LightAircraftController.设置飞机灯需要使用两个组件:LightAircraftLightAircraftController

LightAircraft is assigned to light nodes of an aircraft. The following parameters are available:LightAircraft分配给飞机的轻型节点。 以下参数可用:

  • Light Type — type of the aircraft light.Light Type —飞机灯的类型。
  • Source Type — type of the light source.
    • Node Switch — the node can be enabled and disabled. The min and max light intensity in this case is set for light nodes only.Node Switch — the node can be enabled and disabled. The min and max light intensity in this case is set for light nodes only.
    • Emissive Surface — emission is enabled and disabled for the specified surface or surfaces of the node.Emissive Surface — emission is enabled and disabled for the specified surface or surfaces of the node.

      • Emission-Toggled Node — toggling on disables the node if emission of its surface is disabled.Emission-Toggled Node — toggling on disables the node if emission of its surface is disabled.
      • Surfaces — surfaces for which emission is enabled. To add a surface, type its name the same way it is written in the list of surfaces of this node.Surfaces — surfaces for which emission is enabled. To add a surface, type its name the same way it is written in the list of surfaces of this node.
    • Emissive Material — emission is enabled and disabled globally for the specified material.Emissive Material — emission is enabled and disabled globally for the specified material.

      • Materials — materials for which emission is enabled.Materials — materials for which emission is enabled.
    Node Switch — the node can be enabled and disabled. The min and max light intensity in this case is set for light nodes only.Emissive Surface — emission is enabled and disabled for the specified surface or surfaces of the node.Emission-Toggled Node — toggling on disables the node if emission of its surface is disabled.Surfaces — surfaces for which emission is enabled. To add a surface, type its name the same way it is written in the list of surfaces of this node.Emissive Material — emission is enabled and disabled globally for the specified material.Materials — materials for which emission is enabled.
    Source Type —光源的类型。
    • Node Switch — the node can be enabled and disabled. The min and max light intensity in this case is set for light nodes only.Node Switch —可以启用和禁用该节点。在这种情况下,将最小和最大光强度设置为轻节点只要。
    • Emissive Surface — emission is enabled and disabled for the specified surface or surfaces of the node.Emissive Surface-为节点的指定一个或多个曲面启用和禁用发射。

      • Emission-Toggled Node — toggling on disables the node if emission of its surface is disabled.Emission-Toggled Node —如果禁用了其表面发射,则切换为on将禁用该节点。
      • Surfaces — surfaces for which emission is enabled. To add a surface, type its name the same way it is written in the list of surfaces of this node.Surfaces —启用了发射的曲面。要添加表面,请以与在此节点的表面列表中写入相同的方式键入其名称。
    • Emissive Material — emission is enabled and disabled globally for the specified material.Emissive Material-为指定材质全局启用和禁用发射。

      • Materials — materials for which emission is enabled.Materials-已启用发射的材质。
  • Enabled By Default — the state of the light source when the world is loaded.Enabled By Default —加载世界时的光源状态。
  • Min Intensity and Max Intensity — minimum and maximum intensity of the emitting light. For light nodes, the light intensity is adjusted, for emissive surfaces — the Emission parameter.Min IntensityMax Intensity-发射光的最小和最大强度。对于轻型节点,光强度已针对发射表面进行了调整-Emission参数。
  • Strobe — strobe mode for the light.Strobe —灯光的频闪模式。

    • Strobe Program — strobe program used by the light source. The program uses a sequence of indicated time periods in seconds to consecutively enable and disable the light source starting from the Enabled state. For example, a sequence of 0.3;0.05;0.1 means that a strobe is enabled for 0.3 seconds, then disabled for 0.05 seconds, enabled for 0.1 seconds, and then continues to be enabled for 0.3 seconds, etc.Strobe Program —光源使用的频闪程序。该程序使用以秒为单位的指示时间序列来从启用状态开始连续启用和禁用光源。例如,序列0.3;0.05;0.1表示频闪已启用0.3秒,然后禁用0.05秒,启用0.1 seconds,然后继续启用0.3秒,依此类推。

LightAircraftController should be assigned to the parent node (aircraft) to make this type of lights work correctly via CIGI. Do not change any parameters in this property.应该将LightAircraftController分配给父节点(飞机),以使此类型的灯光通过CIGI正常工作。不要更改此属性中的任何参数。

Light Controller System
灯光控制器系统#

The Light Controller system allows implementing an arbitrary hierarchy of ground-based light sources. This is performed by setting a category in the LightSourceComponent component assigned to a node.Light Controller系统允许实现基于地面的光源的任意层次。这是通过在分配给节点的LightSourceComponent组件中设置类别来执行的。

注意
The position of a node in the World hierarchy does not affect the hierarchy indicated as the light source category.节点在“世界”层次结构中的位置不会影响指示为光源类别的层次结构。

Suppose, we have the following hierarchy of scene lights:假设我们具有以下hierarchy的场景灯:

  • City
    • Airport
      • runway
        • runway_1
          • PAPI
          • touchdown
        • runway_2
          • PAPI
          • touchdown
    • Downtown
      • street_lights
        • lamppost_1
        • lamppost_2
      • buildings
    • District_2
      • street_lights
        • lamppost_1
        • lamppost_2
      • buildings

Using this hierarchy, you can manage any light or group of lights via the console. To generalize, the asterisk symbol (*) is used. Asterisk inside the path means that all categories on this level are checked; at the end of the path — all categories are selected.使用此层次结构,您可以通过控制台管理任何灯光或一组灯光。概括地说,使用星号(*)。路径中的星号表示已选中此级别上的所有类别;在路径的末尾-选择了所有类别。

命令行
lights City/Airport/runway/runway_1/PAPI 1 — enables the PAPI light on runway_1.
lights City/Airport/runway/*/touchdown 1 — enables touchdown lights on runway_1 and runway_2.
lights City/Downtown/* 0 — disables all lights in the downtown area.

To control intensity, values between 0.0 and 1.0 are used:为了控制强度,使用0.01.0之间的值:

命令行
lights City/District_2/street_lights/lamppost_1 0.4

To enable the strobe mode for the light, 2 is used. For this purpose, the strobe mode should be added to the light component via UNIGINE Editor.要启用灯光的频闪模式,请使用2。为此,应通过UNIGINE Editor将频闪模式添加到照明组件。

命令行
lights City/District_2/street_lights/lamppost_1 2

LightSourceComponent
LightSourceComponent#

LightSourceComponent is the basis of the Light Controller system. This component allows setting all conditions describing the light source.LightSourceComponent是灯光控制器系统的基础。该组件允许设置描述光源的所有条件。

The parameters are the same as in the LightAircraft component with the only exception:这些参数与LightAircraft组件中的参数相同,唯一的例外是:

  • Category — the full path in the hierarchy of lights. The hierarchy of lights is developed by a user to consider all lights in the project and assign the corresponding category to a light. This hierarchy does not have any correlation with the World Nodes hierarchy.Category-完整路径灯光层次。灯光的层次结构由用户开发,以考虑项目中的所有灯光并将相应的类别分配给灯光。该层次结构与World Nodes hierarchy没有任何关联。

AutomaticTimeLightingComponent
AutomaticTimeLightingComponent#

AutomaticTimeLightingComponent is designed for lights that do not require manual control and need to be switched on and off depending on time of day. This component should be assigned to a node that is always enabled in the scene.AutomaticTimeLightingComponent专为不需要手动控制且需要根据一天中的时间打开和关闭的灯而设计。应将此组件分配给始终在场景中启用的节点。

This example component enables car daytime running lights from 6:00:00 to 23:12:35, and all downtown lights and car headlights — from 23:12:35 to 6:00:00此示例组件启用从6:00:0023:12:35的汽车日间行车灯,以及从23:12:356:00:00的所有市区灯和汽车前灯。

Time of day can be defined either using the Sun position or the sunrise and sunset time — the approach is selected via the Control Type parameter.可以使用太阳位置或日出和日落时间定义一天中的时间-通过Control Type参数选择进场时间。

  • Disabled — automatic control of lights depending on time of day is disabled.Disabled —禁用根据一天中的时间自动控制灯光。
  • Celestial — the Sun position is used to define time of day. The Sun Zenith Threshold parameter is available for fine-tuning.Celestial-太阳位置用于定义一天中的时间。 Sun Zenith Threshold参数可用于微调。
  • Time — the Sunrise and Sunset Time is set to define time of day in hours, minutes, and seconds.Time —将SunriseSunset Time设置为以小时,分钟和秒为单位定义一天中的时间。

Four categories of automatically controlled light sources are provided:提供了四类自动控制的光源:

  • Categories Day Enabled — categories of the light sources hierarchy that should be enabled during the day-time and disabled during the night-time.Categories Day Enabled-类别光源层次应该在白天启用,而在夜间禁用。
  • Categories Night Enabled — categories of the light sources hierarchy that should be enabled during the nignt-time and disabled during the day-time.Categories Night Enabled-类别光源层次应该在nignt期间启用,并在白天禁用。
  • Materials Day Enabled — materials that should be enabled during the day-time and disabled during the night-time.Materials Day Enabled-应该在白天启用而在夜间禁用的材质。
  • Materials Night Enabled — materials that should be enabled during the nignt-time and disabled during the day-time.Materials Night Enabled-应该在nignt期间启用而在白天则禁用的材质。

Controlling Light via CIGI
通过CIGI控制灯光#

To make light control available via CIGI, the corresponding components should be added to the configuration file as Global Terrain components.要通过CIGI进行灯光控制,应将相应的组件作为Global Terrain组件添加到配置文件中。

源代码 (XML)
<?xml version="1.0" encoding="utf-8"?>
    <property version="2.14.0.0" name="WaterDropAircraftController" manual="1" parent_name="node_base">
		<cigi_global_terrain_components>
		   <component_light id="0" name="city_all">CITY/*</component_light>
		   <component_light id="1" name="city_airport">CITY/AIRPORT/*</component_light>
		   <component_light id="2" name="city_streetlights">CITY/DOWNTOWN/STREET_LIGHTS/*</component_light>
		</cigi_global_terrain_components>

Then these components should be passed to CIGI via the ComponentControl packet as follows:然后,这些组件应通过ComponentControl数据包传递给CIGI,如下所示:

  • Component Class: Global Terrain
  • Instance ID: --- (目前不支持 )
  • Component ID: 配置文件中相应的component_light ID。
  • Component State: 1(启用)或0(禁用)
  • Component Data 1: (FLOAT) 从0到1的强度
  • Component Data 2: (INT32) 频闪灯为1(启用)或0(禁用)
最新更新: 2024-08-16
Build: ()