3D assets in Scenaria - GLB or OBJ?
Though currently (v1.21 beta), Scenaria supports both GLB and OBJ assets there are some gotchas that you need to be aware of.
GLB - is the binary version of the GLTF 3D asset format (see https://www.khronos.org/gltf/ for more information) and is our target format for all future 3D assets. However currently the GLB library we are using (taken from the HLTK) has a few issues -
- The scene may (on Hololens v1) disappear as it renders each GLTF asset. This is caused by a threading issue with UNITY.
- GLTF assets may not render correctly - we have had issues rendering 3D scans using the library.
- Animations are not currently supported.
We are working on updating the GLTF support.
OBJ - is a format that has been used for many years to transfer 3D assets from one application to another. The OBJ library in Scenaria does not suffer from the same issues as GLTF but does have some of its own issues.
An asset saved as OBJ file may contain the
- The .obj file itself,
- A material file (.mtl)
- One or more texture files (.png).
Scenaria expects to find the .mtl and any .png's in the same directory as the .obj. The material file must be named the same as the .obj file but replacing the .obj extension with .mtl.
Any referenced .png files must also exist in the same folder.
We would recommend placing each obj asset and any associated files in its own folder.
e.g. the 3D world asset in our Hello World test scene is called 3dearth.obj its material file is 3dearth.mtl and it has one png called 5.png.
No of triangles - Currently there is no hard limit in Scenaria on the no of triangles an asset can have. We have tested OBJ files in Scenaria of up to 350k triangles - they will render... BUT the frame rate in HL drops dramatically, the memory overhead may cause the app to become unstable and they do take some time to load. We would recommend keeping assets to well below 100k triangles, preferably near to 20k.
Caching - we have implemented a simple asset caching scheme on the HL for .glb, obj and .mtl files - this massively speeds up reloading scenes. You can clear the cache by clicking on the clear cache button on the settings screen.