We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

Search Results for

    Show / Hide Table of Contents

    Hover Light

    A HoverLight is a Fluent Design System paradigm that mimics a point light hovering near the surface of an object. Often used for far away interactions, the application can control the properties of a Hover Light via the HoverLight component.

    For a material to be influenced by a HoverLight the Mixed Reality Toolkit/Standard shader must be used and the Hover Light property must be enabled.

    Note

    Up to two HoverLights are supported by default.

    Examples

    Most scenes within the MRTK utilize a HoverLight. The most common use case can be found on the MRTK/SDK/Features/UX/Prefabs/Cursors/DefaultCursor.prefab

    Advanced Usage

    By default only two HoverLights can illuminate a material at a time. If your project requires more than two HoverLights to influence a material the sample code below demonstrates how to achieve this.

    Note

    Having many HoverLights illuminate a material will increase pixel shader instructions and will impact performance. Please profile these changes within your project.

    How to increase the number of available HoverLights from two to four.

    // 1) Within MRTK/Core/StandardAssets/Shaders/MixedRealityStandard.shader change:
    
    #define HOVER_LIGHT_COUNT 2
    
    // to:
    
    #define HOVER_LIGHT_COUNT 4
    
    // 2) Within MRTK/Core/Utilities/StandardShader/HoverLight.cs change:
    
    private const int hoverLightCount = 2;
    
    // to:
    
    private const int hoverLightCount = 4;
    
    Note

    If Unity logs a warning similar to below then you must restart Unity before your changes will take effect.

    Property (_HoverLightData) exceeds previous array size (8 vs 4). Cap to previous >size.

    See also

    • MRTK Standard Shader
    • Improve this Doc
    In This Article
    Back to top Generated by DocFX