A friend of mine with more money than sense recently purchased the Development Edition of the Microsoft HoloLens. I say he has more money than sense because he isn’t even a developer. Why would someone who isn’t a developer spend $3000 USD, close to $4500 CAD, on a developer model of a niche product? I don’t know, but it gives me the opportunity to write code for it and actually try it out on the actual device. I don’t really see many practical applications of the technology, outside of Computer Aided Design, but I may as well take advantage of the access.
That being said, I don’t actually have the device myself. I’ll have to write the application and then take it to his house to try it out on the actual device. The next post in this project will therefore talk about getting set up to use the emulator.
But what do I actually want to accomplish in this project?
- Obviously, my first goal is just to write a demo that runs on the HoloLens. Pretty much every tutorial out there uses Unity for this, so you would think I’d be following their lead. But apparently I’m a glutton for punishment. I decided to try to write this demo strictly in Visual Studio, just like the Rendering Terrain project. This may change once I start trying to make progress, but Microsoft does provide a template for a holographic application using DirectX 11, and support for the HoloLens is built into the Windows SDK, so Unity is not a requirement, just a convenience.
Once I get the demo working. I might actually consider reproducing it in Unity as well. I’d like to gain more experience with the toolset, and comparing building this demo two different ways might be an interesting exercise.
- To minimize the amount of new stuff to learn this time around, I want to reuse some of the work I did in the Rendering Terrain project. To that end, this project will be about rendering a height map terrain on the HoloLens. The goal is to find a flat surface to anchor the terrain to, generate a terrain to fit that surface, and then render the terrain.
I want to render it with textures, most likely reusing the textures I came up with for the last project.
I won’t implement shadow mapping for this project. I’ll just stick with the basic shading.
I also don’t think I’ll be implementing tessellation. I’d prefer to skip frustum culling as well. I think, for my purposes, a simple static mesh should do. I’m not entirely certain at this point how the Spatial Mapping works, but I’m hoping to be able to generate a mesh to fit a surface. For example, if I can detect a two foot by two foot table, I should then be able to say, ‘give me a mesh density of four vertices per inch,’ and generate a 97×97 vertex mesh1. Depending on the power available with the HoloLens, I’ll attempt higher resolutions. If I can figure out how, I’ll even make it an option you can change in a GUI.
- I mentioned in the last point that I want to generate the terrain. What I’d really like to do is animate the terrain generation. I’ve previously implemented some algorithms for procedurally generating terrain and I have one that is incremental. It will work quite well as an animation because I can perform an iteration and then a render pass. Doing this at interactive rates should be quite easy as we won’t be dealing with huge meshes. While I intend to just use the CPU implementation, I have previously implemented this method on the GPU as well. If the CPU implementation isn’t fast enough, the GPU one definitely should be.
This is, perhaps, less of a goal and more of what I’m going to do, since I’ve done it and there isn’t really anything to learn here. Still, you can expect at least one post on this topic.
- Rather than continuing to use LodePNG to load my texture data, I’d like to switch to Microsoft’s DirectXTex library to load DDS files to texture. As I mentioned previously, this would let me combine all of the texture data that I was storing in a Texture Array into one file. Instead of eight file accesses, I’d only need one. That seems like a simpler and more efficient system.
I think that’s about all I actually want to accomplish on this project. My last project was quite long and I found it hard to stay positive and motivated as the project dragged on. Hopefully I can keep this project shorter and more focused.
The code for this project will be available on GitHub.
Table of Contents
- Part 1 – Getting Started
- Part 2 – A Simple Terrain Mesh
- Part 3 – Of Height Maps and Shaders
- Part 4 – Fault Formation
- Part 5 – Animated Terrain Generation
- Part 6 – Taking a Surface Into Account
- Part 7 – Surface Meshes
- Part 8 – Depth Only Rendering of Surface Meshes and Moving Some Code Around
- Part 9 – Handling Basic Gestures
- Part 10 – Converting Surface Mesh Data For Plane Finding
- Part 11 – Rendering Planes
- Part 12 – Anchoring and Orienting Our Terrain
- Part 13 – Setting the Size of Our Height Map
- Part 14 – Fixing Terrain Selection
- Part 15 – Adding Textures