Pixel Sensor API Example

Is there a unity scene that I can download to test the world camera example? I couldn't get it to render on my Quad, Mesh renderer to stream correctly.

Have you taken a look at the latest version of the Unity Example Project? They have a Pixel Sensor Example.

Looking at the logs on the device is also helpful to determine bugs. You can use the ML Hub or Unity's Logcat package. You can also test that example script inside the Example Project and see if it works in the pre-configured project.

Yeah, it managed to load the default configurations, but let's say I want to visualize with different exposure level - I'm struggling to load the config

Understood, so what errors are you getting when running the following example script:

Trying to fetch sensor...

1 Like

Oh no, it looks like there was a typo when the page was being updated. Please add

TryInitializeSensor(); at the bottom of the InitializePixelSensorFeature function.

    private void InitializePixelSensorFeature()
    {
        pixelSensorFeature = OpenXRSettings.Instance.GetFeature<MagicLeapPixelSensorFeature>();
        if (pixelSensorFeature == null || !pixelSensorFeature.enabled)
        {
            enabled = false;
            Debug.LogError("Pixel Sensor Feature Not Found!");
            return;
        }

        //Find pixel with the specified name.
        cachedSensorId = FindSensor(pixelSensorName);

        // Subscribe to sensor availability changes
        pixelSensorFeature.OnSensorAvailabilityChanged += OnSensorAvailabilityChanged;

// Call this function at the end.
        TryInitializeSensor();
    }
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.