entityCount
TypeScriptget entityCount(): numberSwift declarationfinal var entityCount: Int { get }Total number of entities in this lightmap.
class · iOS 27.0+ · SDK 27.1
final class LightmapResourceA resource containing references to lightmap texture atlases and descriptions of how parts of the atlases map to meshes in the scene. At a high level, ``LightmapResource`` comprises two parts: a set of layered textures containing lightmap data, and a set of EntityLightmapDescriptors specifying atlas packing. Both parts (the lightmap data and atlas packing) are expected to be generated by an offline process. LightmapResource is only intended for storing and retrieving them. Importantly, ``LightmapResource`` does not store references to runtime Entities. The correspondence between runtime Entities and their matching EntityLightmapDescriptors is established by ``LightmapComponent``. ## See Also - ``LightmapComponent``
get entityCount(): numberSwift declarationfinal var entityCount: Int { get }Total number of entities in this lightmap.
static initAtlasTexturesPerEntityData(atlasTextures: Array<TextureResource>, perEntityData: Array<LightmapResource_EntityLightmapDescriptor>): LightmapResourceSwift declarationconvenience init(atlasTextures: [TextureResource], perEntityData: [LightmapResource.EntityLightmapDescriptor]) throwsInitializes the resource with the given atlases and entity descriptors. The resources within `atlasTextures` must be 2D texture arrays. Textures containing data for ambient occlusion should be single-channel textures. Textures containing data for beauty bakes should contain RGBA color. Textures for diffuse irradiance should contain RGBA data. There should be 3 slices per atlas page. Lightmap textures use the Metal convention, where UV (0,0) corresponds to the top-left corner of the image while UV (1,1) corresponds to the bottom-right. Assuming a = sqrt(2), b = sqrt(3), c = sqrt(6), and N0 = (1/c, 1/a, 1/b), N1=(-1/c, -1/a, 1/b), N2 = (a/b, 0, 1/b), the first, second and third slices should contain lighting as if the surface normal was respectively N0, N1 and N2 in tangent space.
static initPerEntityData(perEntityData: Array<LightmapResource_EntityLightmapDescriptor>): LightmapResourceSwift declarationconvenience init(perEntityData: [LightmapResource.EntityLightmapDescriptor]) throwsInitializes the resource with the given entity descriptors, but does not specify any atlas textures. Skips validation of atlas texture indices and slices within bake descriptors. This is helpful for providing a SurfaceExtractor with information about how entities are laid out in the lightmap without needing to provide any texture data along with it.
get bakeTypes(): Array<LightmapResource_BakeType>Swift declarationfinal var bakeTypes: [LightmapResource.BakeType] { get }All bake types used by entities in this lightmap.
No declarations were skipped in this snapshot.