Limitations
- Last UpdatedAug 22, 2023
- 2 minute read
There are some limitations on the number of LightProbes and realtime lights that can affect a mesh.
Parameters
These values are specified inside the graphics configuration file as:
-
g_render_cfg.detail.maxLightsPerMesh: The maximum number of realtime Lights that affect a mesh.
-
g_render_cfg.detail.maxLightProbesPerMesh: The maximum number of LightProbes that affect a mesh.
-
g_render_cfg.detail.maxLightsPerMeshForProbesGeneration: The maximum number of realtime Lights that affect a mesh during the generation of the LightProbes. This number can be set higher because LightProbes are precomputed.
How it works
Before rendering a Mesh, a collection of Lights and LightProbes are evaluated for each mesh.
-
Only the Lights/LightProbes whose boundings intersect with the mesh bounding are considered.
-
When the number of intersecting Lights and LightProbes is more than the maxLights values, a selection is made based on the distance between the Lights/LightProbes and the mesh.
Two ways to build scenes
Because only the LightProbes that intersect a mesh are used, in order to give every mesh at least some lighting, the scene can be built in two ways:
-
Method A: A set of LightProbes whose radiuses cover somehow each mesh
-
Method B: A big LightProbe that gives light to all the meshes, plus a set of smaller LightProbes where most needed
For method (B) there is a particular flag that makes a LightProbe always present while rendering a mesh. This ensures that all the meshes have at least one LightProbe to give some light.
This particular LightProbe is called the Main LightProbe. Be sure that the size of this probe covers all the meshes that receive light.
Difference between a LightProbe and the Main LightProbe
When a mesh is looking for probes around it, the Main LightProbe has a higher priority than normal LightProbes. This ensures that the mesh uses the Main LightProbe, but only if the Main LightProbe and the mesh intersects.
-
Priority is used to sort the probes intersecting a mesh.
-
When the number of probes exceeds the maximum number of Probes per Mesh, some probes are not used to render that mesh.
Note: You can use the Main LightProbe as a standard LightProbe by giving it a small radius. Then only the meshes that intersects this LightProbe will use it. Be sure that the other LightProbes cover all the mesh area, otherwise darker spots can appear where the LightProbes are not placed.