Wednesday, September 22, 2021

StereoKit v0.3.3 (C# and OpenXR)

 

StereoKitReleaseHeader.png

Another chunky update to StereoKit the Mixed Reality engine is here! Unicode support, a revamped Model inspection API, some nice improvements to the built-in UI, and a whole lot more! Keep reading for the details :)

 

A Quick Intro to StereoKit

 

If this is your first time hearing about StereoKit, here's a quick introduction: StereoKit is a code-first, C#, cross-platform, OpenXR based Mixed Reality engine! It focuses on fast iteration times (really fast, seriously!), performance by default for mobile MR devices, and an easy-to-use and powerful API. If that sounds interesting to you, you can learn a lot more on the docs site!

 

Unicode Support

 

This is a pretty big and important feature! Text rendering in MR is a tough task to tackle, and when StereoKit's text support was first written, we went with the bare minimum to get off the ground fast: ASCII/Latin characters. Pretty easy to start with, but that runs into a wall pretty fast when other languages get involved!

 

This update brings in Unicode support for text rendering and input, and supports a pretty wide range of character sets out-of-the-box, including Japanese! Even better, StereoKit handles the glyph atlases by itself and on-demand, so no need to bake or ship large pre-rendered glyph atlas textures. Right-to-left languages aren't in quite yet, but are definitely on the roadmap for the future!

 

Check out the Cyrillic characters being added to the atlas automatically when StereoKit detects them!Check out the Cyrillic characters being added to the atlas automatically when StereoKit detects them!

ModelNode API

 

The Model API initially shipped with basic functions to iterate through the Meshes and Materials in it, but a Model can contain a wealth of extra information expressed in its hierarchy and node names! In particular, empty nodes can be super handy for placing things on or around the Model, and Model based UI is a pretty great example of this. So we've revamped the API for exploring the contents of a Model!

 

Here, positions and sizes are extracted from the Model's hierarchy, and used to place interactive elements on the Model.Here, positions and sizes are extracted from the Model's hierarchy, and used to place interactive elements on the Model.

A peek at the Model's internal structure.A peek at the Model's internal structure.

There's many ways to use this information, and this particular example is only scratching the surface!

 

UI Improvements

 

UI is an area of StereoKit that will constantly be improving, and this update is no exception! While many parts were polished and improved, I just want to highlight a few new things.

 

UI.PushSurface and UI.PopSurface were added to help with Model based UI, which you saw in action with the radio from above! Instead of creating a visible panel like UI.WindowBegin/End, this just adds an invisible layout surface that behaves in a similar manner.

 

A small sample of some new changes you can make with the UI customization APIs.A small sample of some new changes you can make with the UI customization APIs.

Some small improvements to the default window look make panels look just a bit cleaner! In addition to this, UI.SetElementVisual was added to allow customization of Meshes and Materials used by a number of different UI elements.

 

Dragging the HSlider out will make the slider bar 1x bigger each step!Dragging the HSlider out will make the slider bar 1x bigger each step!

The HSlider also received some tweaks and updates, including a new option that allows for finer tuning of the slider value! Pulling this slider out will switch to a scaled input slider, where the same motion will then move the slider less.

 

Try it out!

 

But that's not all the new stuff, this is just some of the highlights! You can check out the complete change-list over here. And if you want to give this a try, then you can also head over to the getting started guide.

 

If you've got questions, feedback, or some sweet ideas, feel free to drop by the GitHub Discussions or Issues tabs and say hi!

 

Thanks for reading :)
- Nick Klingensmith
- Primary StereoKit maintainer

Posted at https://sl.advdat.com/3nZzzgo