This is the documentation for Enlighten.
Mesh projection
Mesh projection is a method of generating UVs to allow one mesh to share the lightmap of another mesh in close proximity. One mesh is designated the target, and the other mesh the detail mesh. The mesh projection produces a set of UVs for the detail mesh that share the same space in the lightmap as the target mesh.
Two (or more) meshes can be projected onto a single target mesh.
Two (or more) meshes can be aggregated into a single target mesh, if both sets of lightmap UVs are part of the same atlas.
The mesh projection process:
- generates simplified lightmap UVs for the target mesh
- forms charts for the detail mesh, but doesn't generate lightmap UVs
- chooses the best target mesh chart for each detail mesh chartÂ
- projects each chart onto its target to obtain the lightmap UVs for the detail mesh
Chart alignment
To make sure the detail charts have the correct lighting, the target chart should be large enough to contain the projected charts, as shown below:
If any projected chart is larger than its target chart, the overhanging area of the projected chart will have incorrect lighting.
To prevent incorrect lighting, a boundary between charts in the target mesh should roughly correspond with a chart boundary in the detail mesh.Â
The best target chart
For each projected mesh chart, the mesh projection process identifies the closest target mesh chart. Closeness is determined by the distance between the projected vertex and a vertex in the target chart. The relative orientations of the detail and target surfaces are ignored.
The artist can manually override the choice of target chart by assigning a unique chart tag. Charts with a non-zero chart tag are only projected to charts in the target mesh with a matching chart tag.
Projection issuesÂ
when a detail mesh chart is projected to a poor choice of target mesh chart, the resulting distorted lightmap UVs cause incorrect lighting.
Use the GeoRadiosity Mesh projection debugging tools to check for distortion. It should be evident if any areas have unacceptable amounts of distortion.
The GeoRadiosity Projection Issues visualisation service shows problem areas are shown in bright colors.Â
To investigate further, click on the Filter tab in GeoRadiosity and toggle Show Target Geometry on and off.
If you use mesh projection, we recommend to provide similar visualizations in your editing tools. Use the Debugging Utilities API.