LightsprintSDK 2021.08.08
.rr3 / .rrbuffer / .rrmaterial fileformats

.rr3 is a serialization of RRScene (3d scene), fileformat created by Lightsprint.

.rrbuffer is a serialization of RRBuffer (2d texture / cubemap / vertex buffer), fileformat created by Lightsprint.

.rrmaterial is a serialization of RRMaterials (1 or more materials), fileformat created by Lightsprint.

Lightsprint stands against common business practise of creating truckloads of new formats and locking customers' data in these formats; we work for customers, not against them. We created these new fileformats after 5 years of supporting 95+ standard fileformats. We offer them as an option, not forcing you to use them.


.rr3 benefits

  • loads 50-200x faster than other scene formats (not counting time to load textures)
  • files are 2-6x smaller than in other formats
  • supports saving
  • supports instances
  • full import/export source code

.rr3 contents

.rr3 contains all data present in RRScene with these exceptions:

To see what is in RRScene and therefore in .rr3, visit "Member data documentation" of RRScene. It contains collection of objects and lights, so in next step, see "Member data documentation" in RRObject and RRLight. Here you can see that object contains mesh, collection of facegroups and world matrix, so in next step, visit RRMeshArrays, RRObject::FaceGroup, RRMatrix3x4. Facegroups contain number of faces and material, so finally visit RRMaterial.

Whenever RRBuffer is encountered and RRBuffer::filename is empty, buffer is embedded into .rr3, otherwise only RRBuffer::filename is saved.

Working with .rr3 in your program

When exporting from your program to .rr3, we recommend copying your data to RRScene and then calling scene.save("foo.rr3"); rather than recreating .rr3 structure in your own code. It is much easier and it ensures 100% compatibility.

If you import data, do the opposite, RRScene scene("foo.rr3"); and then read data from scene.


.rrbuffer benefits

  • supports all types of static RRBuffer data (2d textures, cubemaps, vertex buffers) (note that there is lack of standard fileformats for cubemaps and vertex buffers)
  • supports both fixed point and floating point precisions
  • loads 1-10x faster than other formats
  • file sizes are comparable to other formats with losless compression (i.e. smaller than formats without compression, bigger than formats with lossy compression)
  • full import/export source code

.rrbuffer contents

.rrbuffer contains all static data present in standard RRBuffer (i.e. 2d textures, cubemaps, vertex buffers, but not video)


.rrmaterial benefits

  • supports all material features supported by Lightsprint solvers
  • smaller filesizes, and faster loads/saves
  • full import/export source code

.rrmaterial contents

.rrmaterial contains all data present in RRMaterials, i.e. description of materials, with links to textures, or embedded textures