Uses the .geom
XML format to represent a geometry object.
Choose a unique name for the geom element's name attribute. Add a version attribute with the value 1. Save the file under the same name with the .geom
extension, within a separate folder with the same name.
<?xml version="1.0" encoding="utf-8"?> <geom name="Cornellbox" version="1"> </geom>
The build system will report an error if the name attribute, filename and containing folder do not match.
Meshes
Add one mesh element for each mesh object to be included.
Make sure the filename attribute of each mesh refers to a mesh object saved with the .pim
extension, and that the name attribute of the mesh matches the filename.
Specific the mesh filename relative to the location of the geometry object.
For each mesh, specify the following attributes to include it in the radiosity computation:
direct=true
indirect=true
target=true
All other mesh attributes have default values. To get started, you can leave them unspecified.
<?xml version="1.0" encoding="utf-8"?> <geom name="Cornellbox" version="1"> <mesh name="Cornellbox" filename="Cornellbox.pim" direct="true" indirect="true" target="true"/> </geom>
Detail meshes
Mark meshes within a geometry object as detail meshes to share a lightmap with other meshes using mesh projection. Detail meshes are not included in radiosity computations, but must be present in the scene if the mesh projection process is to be performed during the precompute.
When a geometry object contains a detail mesh, the other meshes in the geometry object are known as target meshes.
The precompute outputs enlighten lightmap UVs for each geometry object. This process will automatically perform Mesh projection to project detail meshes in a geometry object onto target meshes within the same geometry object.
To mark a mesh as a detail mesh, specify the following attributes:
direct=false
indirect=true
target=false
When using mesh LOD, include all detail levels of a mesh in the same geometry object. This enables lightmapped meshes to share the lightmap between all detail levels. Choose one detail level to be included in the radiosity computation, and mark the rest as detail meshes.
Automatic UV simplification
We recommend to use automatic UV simplification to produce Simplified lightmap UVs.
To enable automatic simplification, for each mesh element specify the attribute simpMode="simplifyUsingUvs".
To merge charts across parts of the mesh that extend less than the size of one lightmap pixel, set simpUsePixelUnits="true" and simpMaxDistance="0.5"
<?xml version="1.0" encoding="utf-8"?> <geom id="" name="polySurface2" version="3"> <mesh name="polySurfaceShape2" filename=".\polySurfaceShape2.pim" direct="true" indirect="true" target="true" simpMode="simplifyUsingUvs" simpUsePixelUnits="true" simpMaxDistance="0.5"/> </geom>
Examples
The following example shows a collection of geometry objects with the following folder structure:
<root_folder>/ ubox_2sys_left/ ubox_2sys_left.geom ubox_2sys_right/ ubox_2sys_right.geom regular_whitesphere/ regular_whitesphere.geom
<?xml version="1.0" encoding="utf-8"?> <geom id="" name="ubox_2sys_left" version="4"> <mesh name="ubox_2sys_left" filename=".\ubox_2sys_left.pim" direct="true" indirect="true" target="true" /> </geom>
<?xml version="1.0" encoding="utf-8"?> <geom id="" name="ubox_2sys_right" version="4"> <mesh name="ubox_2sys_right" filename=".\ubox_2sys_right.pim" direct="true" indirect="true" target="true" /> </geom>
<?xml version="1.0" encoding="utf-8"?> <geom id="" name="regular_whitesphere" version="3"> <mesh name="regular_whitesphere" filename=".\regular_whitesphere.pim" direct="true" indirect="true" target="true" /> </geom>