Useful common concepts that you can leverage in your application.
Common useful prefabs not particularly related to a particular HoloLens feature.
Unity camera that has been customized for Holographic development.
- Camera.Transform set to 0,0,0
- 'Clear Flags' changed to 'Solid Color'
- Color set to R:0, G:0, B:0, A:0 as black renders transparent in HoloLens.
- Set the recommended near clipping plane.
Rotates a hologram so it is always facing towards the camera.
Show a GameObject around the cursor that points in the direction of the GameObject which this script is attached to.
You must provide GameObjects for the Cursor and DirectionIndicatorObject public fields.
Cursor The object in your scene that is being used as the cursor. The direction indicator will be rendered around this cursor.
DirectionIndicatorObject The object that will point in the direction toward the object which this script is attached to. This object can be a 2D or 3D object.
DirectionIndicatorColor The color you want the DirectionIndicatorObject to be. The material on the DirectionIndicatorObject will need to support the color or TintColor property for this field to work. Otherwise the DirectionIndicatorObject will continue to render as its exported color.
TitleSafeFactor The percentage the GameObject can be within the view frustum for the DirectionIndicatorObject to start appearing. A value of 0 will display the DirectionIndicatorObject when the GameObject leaves the view. 0.1 will display when the GameObject is 10% away from the edge of the view. -0.1 will display when the GameObject is 10% out of view.
Causes a hologram to maintain a fixed angular size, which is to say it occupies the same pixels in the view regardless of its distance from the camera.
A MonoBehaviour that interpolates a transform's position, rotation or scale.
A script to add to the main camera object so that when running in Play mode in Unity, the user can control the camera using keyboard and mouse.
A simple Tagalong that stays inside a sphere at a fixed distance from the camera. Very cheap implementation with smoothing capability.
A Tagalong that stays at a fixed distance from the camera and always seeks to have a part of itself in the view frustum of the camera.
A Tagalong that extends SimpleTagalong that allows for specifying the minimum and target percentage of the object to keep in the view frustum of the camera and that keeps the Tagalong object in front of other holograms including the Spatial Mapping Mesh.
A base class to make a MonoBehaviour follow the singleton design pattern.
Provides dynamic Text to Speech. Speech is generated using the UWP SpeechSynthesizer and then played through a Unity AudioSource. Both plain text and SSML are supported.
Code shared between LambertianConfigurable.shader and LambertianConfigurableTransparent.shader.
Feature configurable per-pixel lambertian shader. Use when higher quality lighting is desired, but specular highlights are not needed.
Feature configurable per-pixel lambertian transparent shader. Use when higher quality lighting and transparency are desired, but specular highlights are not needed.
Higher performance drop-in replacement for the Unity Standard Shader. Use when very high quality lighting (including reflections) is needed.
Code shared between UnlitConfigurable.shader and UnlitConfigurableTransparent.shader.
Feature configurable unlit shader. Use when no lighting is desired.
Feature configurable unlit transparent shader. Use when transparency and no lighting are desired.
Code shared between VertexLitConfigurable.shader and VertexLitConfigurableTransparent.shader.
Feature configurable vertex lit shader. Use when a higher performance but lower precision lighting trade-off is acceptable.
Feature configurable vertex lit transparent shader. Use when a higher performance but lower precision lighting trade-off is acceptable, and transparency is needed.
A simple occlusion shader that can be used to hide other objects. This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer. This shader differs from Occlusion.shader in that it doesn't have any depth offset, so it should sort as expected with other objects adjacent to the window.
This scene shows how to use ManualCameraControl.cs. The script is on the main camera of the scene. When preview mode in Unity is activated, the user can move around the scene using WASD and look around using ctrl + mouse.
This scene demonstrates how to use TextToSpeechManager.cs. The script is placed on 3 cubes in the scene. Whenever a cube is activated with an air tap, a text to speech voice will emanate from the cube. The user can also ask "What time is it?" to hear the current time from a voice that stays with the user as they move.
This scene demonstrates how to use WindowOcclusion.shader. It positions a virtual 'window' directly in front of you when the scene starts. A cube in the back is only visible when viewed through the window because quads around the window use the WindowOcclusion shader.