luscn.h¶
Ludus Wiki · API overview · Browse API
File
LUSCN cooked scene interchange format (Ludus::SceneFormat).
This header is the single contract between producers of cooked scenes (Ludus::SceneCook, the Editor World composer) and consumers (Ludus::Resources SceneDefinition::Decode and the renderer that installs it). It is owned by neither side: tools and runtime both depend on it, and it depends on nothing but FoundationBase.
A bundle is little-endian and tightly packed, in this order: Header; Header::TextureCount x (TextureRecord + RGBA8 bytes); Header::MaterialCount x versioned MaterialRecord; Header::MeshCount x (MeshRecord + MeshRecord::VertexCount x VertexRecord + MeshRecord::IndexCount x uint32); Header::ObjectCount x versioned ObjectRecord. Version 3 uses VertexRecordV3 and ends with LightingRecord, analytic lights and its optional float32 RGB environment payload. Version 4 keeps every version 3 record except the vertices, which are VertexRecord again: bake chart coordinates are implicit (see TryGetBakeChartUv), so meshes stay indexed instead of storing one vertex per triangle corner. Version 5 keeps every version 4 record except the materials, which are MaterialRecordV5 with an alpha mode and cutoff, and admits the larger import profile (IMPORT_LIMITS) instead of the resident reference profile (see GetBundleLimits). Version 6 keeps the version 5 records except the materials (MaterialRecordV6 adds a linear surface map, an emission map and a normal-map strength) and the vertices (VertexRecordV6 adds a tangent frame), within the same import profile. Version 7 appends MaterialExtensionV7 after each MaterialRecordV6 to preserve source names, reflectance and typed optical parameters; other v6 records remain unchanged.
The record structs document the exact wire layout and are checked with static_asserts; serialise them field by field in little-endian order rather than copying the structs, so host endianness and padding never leak into files.
Declared in modules/content/scene_format/include/ludus/content/scene_format/luscn.h
Related declarations¶
- ludus::content::scene_format::MaterialExtensionV7
- ludus::content::scene_format::Header
- ludus::content::scene_format::TextureRecord
- ludus::content::scene_format::MaterialRecordV1
- ludus::content::scene_format::MaterialRecordV2
- ludus::content::scene_format::MaterialRecordV3
- ludus::content::scene_format::MaterialRecordV5
- ludus::content::scene_format::MaterialRecordV6
- ludus::content::scene_format::MeshRecord
- ludus::content::scene_format::VertexRecord
- ludus::content::scene_format::VertexRecordV3
- ludus::content::scene_format::VertexRecordV6
- ludus::content::scene_format::ObjectRecord
- ludus::content::scene_format::ObjectRecordV3
- ludus::content::scene_format::LightingRecord
- ludus::content::scene_format::LightRecord
- ludus::content::scene_format::BakeChartLayout
- ludus
- ludus::content
- ludus::content::scene_format