Occlusion

We have covered a lot so far. However, we have not discussed one very important thing: how to hide virtual things behind physical things.

I have shown you the virtual puppy hiding behind my living room chair. How do we do this? The answer is: using the right kind of shader.

We have mentioned shaders before, but now it is time to delve a little bit more deeply into them.

In DirectX, we have a whole set of shaders: we have seen pixelshaders, geometryshaders, and vertexshaders. There are a lot more, but we will not go into those at all.

In Unity3D we only have one, simply called the shader. The shader we use is a property of the material we apply.

Let us create a new one. In our Unity3D project, create a new shader. Call it Occlusion. ...

Get Microsoft HoloLens Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.