The sample you provided is actually not using DirectWrite
I think, which would not be your best bet in any case, because the DirectWrite
feature is a strictly 2D one (it is part of the SharpDX.Direct2D
API). While your application seems to need to render in 2D, you actually are rendering a flat 3D object in 3D space from various vantage points, multiple times, and ensuring that these are consistently facing in a set of pre-defined directions (see billboarding). Thus, you would need a 3D engine which incorporated 2D elements (i.e. billboarding), rather than a strictly 2D one that you would be using should you go the DirectWrite
route. Plus, there's a good amount of overhead for rendering everything stereoscopically, and DirectWrite
is notoriously slower than it's counterparts.
I'm not too versed in hololens, and I won't pretend know the specifics of how exactly such an effect would be achieved, but I imagine what you might do is have the 3d text sitting in 3d space, and billboard in the direction of the viewer. There's probably a slew of techniques for things such as stabilization and velocity estimation, but the underlying premise would be billboarding that image with respect to the viewer.
I hope this helps a bit. Again, hololens isn't necessarily something I'm familiar with, but I wanted to say mostly that if you try to do this with DirectWrite
you're going to have a bad time.
EDIT:
It occurs to me that this might be slightly misleading, because I phrased it in such a way that implies DirectWrite
is incompatible with 3D, which isn't really true. You can indeed use DirectWrite
in conjunction with Direct3D to render to 3D space, but DirectWrite
itself only writes to a 2D surface. I really should have said don't use DirectWrite
by itself to write to 3D space.
In order to use DirectWrite
to write to 3D space, you would need to create a flat quad in 3D space, and use the render to texture technique in order to render your DirectWrite
text to a texture. This texture may then be wrapped on that quad, and the quad may then be placed in 3D space to be rendered in 3D.