FgiState
- Last UpdatedFeb 19, 2025
- 4 minute read
The FGI rendering pipeline enables you to define multiple lighting condition states with different settings. These states are mapped by FgiState nodes.
The AVEVA™ XR engine is able to move from one state to another (for example: entering and exiting a building). You can also interpolate between states to create smoothed transactions (for example: day time change).
Platform support
This node is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-Portable WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Full support |
Full support |
Full support |
Full support |
|
|
|
|
|
|
Guidelines
-
Never change FgiState parameters at runtime.
-
States are used to create placeholders for use by the FGI node currentState parameter.
-
Some FgiState values are used by the XR Studio Graphic Context editor to create probe state maps.
FGIState and SkyDome
The SkyDome dynamic sun can be linked to FGIState using the sky\proceduralSky field.
When connected, some of the SkyDome properties will be controlled by generated FGI states:
-
SkyDome sun will be aligned to the FGIState sun. Therefore, manipulating SkyDome sunAzimuth and sunElevation will produce no results.
-
The SkyDome sun intensity effect will be multiplied by FGIState sun\contribution.
Code example
This is a code example for the FgiState node.
<FgiState name="state0" templateInfo="FgiState|state0" sun.position="54.64066 56.92097 -140.9182" sun.target="-36.90698 -9.165833 24.16227" sun.color="0.3098039 0.5058824 0.7411765" sun.contribution="2.5" sun.pitch="0.3367634" sun.yaw="1.064456" sun.distance="200" shadows.position="-2.135145 15.93541 -38.53899" shadows.target="-36.90698 -9.165833 24.16227" shadows.contribution="0.5"/>
FgiState fields
These are the fields for FgiState node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > FgiState
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
_debug |
sbool |
Optional |
false |
Enables state-related objects to display in 3D debug mode. |
|
lights\contribution |
sfloat |
Optional |
def |
Weight of lights contribution to lighting calculation. |
|
lights\data |
mdstring |
Optional |
List of lights and their parameters. |
|
|
probes\contribution |
sfloat |
Optional |
1 |
Weight of the FgiProbe contribution to lighting calculation. |
|
probes\genAmbientColor |
svec3 |
Optional |
0 0 0 |
Ambient color value to use when generating the probes state map. Not used in realtime. |
|
probes\genLightsContribution |
sfloat |
Optional |
1 |
Weight of lights contribution used when generating the probes state map. Not used in realtime. |
|
probes\genShadowsColor |
svec3 |
Optional |
0 0 0 |
Shadow color value to use when generating the probes state map. Not used in realtime. |
|
probes\genShadowsContribution |
sfloat |
Optional |
1 |
Weight of shadows contribution used when generating the probes state map. Not used in realtime. |
|
probes\genSunContribution |
sfloat |
Optional |
1 |
Weight of sun contribution used when generating the probes state map. Not used in realtime. |
|
shadow\position |
svec3 |
Optional |
0 0 0 |
The casting segment origin of the shadow. |
|
shadows\color |
svec3 |
Optional |
0 0 0 |
The color of the shadow. |
|
shadows\contribution |
sfloat |
Optional |
1 |
The weight of the shadow's contribution to lighting calculation. |
|
shadows\target |
svec3 |
Optional |
0 0 0 |
The casting segment target of the shadow. |
|
sky\mesh |
sstring |
Optional |
Fully qualified name of the sky element. This is the internal resource name, not node name. |
|
|
sky\proceduralSky |
sstring |
Optional |
The name of a SkyDome node. When set, the FGIState will directly control some of the sun-related attributes of the SkyDome. |
|
|
sky\timeOfDay |
senum |
Optional |
00:00 |
Defines state current day time. Accepted values are: 00:00 01:00 02:00 to 24:00. |
|
stateId |
sint |
Optional |
0 |
The ID of the state to identify and trigger state change. |
|
sun\color |
svec3 |
Optional |
0 0 0 |
The sun color. |
|
sun\contribution |
sfloat |
Optional |
1 |
The weight of sun contribution to lighting calculation. |
|
sun\distance |
sfloat |
Optional |
0 |
The distance between sun target and position. |
|
sun\pitch |
sfloat |
Optional |
0 |
The sun position to target pitch, in radiants. |
|
sun\position |
svec3 |
Optional |
0 0 0 |
The sun position. |
|
sun\target |
svec3 |
Optional |
0 0 0 |
The sun target position. |
|
sun\yaw |
sfloat |
Optional |
0 |
The sun position to target yaw, in radiants. |