void Update()
    {
        // Update the light exposure.
        float exposure = xr.GetLightExposure();

        // Exposure ranges from -1 to 1 in XR, adjust to 0-2 for Unity.
        sceneLight.intensity = exposure + 1.0f;
    }
Example #2
0
    void Update()
    {
        if (xr.DisabledInEditor())
        {
            return;
        }
        // Update the light exposure.
        float exposure    = xr.GetLightExposure();
        float temperature = xr.GetLightTemperature();

        // Exposure ranges from -1 to 1 in XR, adjust to 0-2 for Unity.
        sceneLight.intensity            = exposure + 1.0f;
        sceneLight.colorTemperature     = temperature;
        RenderSettings.ambientIntensity = exposure + 1.0f;
        RenderSettings.ambientLight     = tempToColor(temperature);
    }