# Running Marker Colocation on Desktop is missing

**URL:** <https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777>\
**Category:** Unity Development\
**Tags:** development, unity\
**Created:** [October 24, 2023, 10:40am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777 "2023-10-24T10:40:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [October 24, 2023, 10:40am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/1 "2023-10-24T10:40:23Z")

</div>

Hello,  
I am currently in the process of building a Photon Fusion sample for Magic Leap 2.  
As I continue reading, there is a description of the software to install for Running Marker Colocation on Desktop, but I don't know which software it is. (The folder structure has also changed and I don't know which one to install and run.)

> If you want to test the example with the desktop client, in the top Unity menu go to **Magic Leap \> Fusion Example \> April Tag \> Install** to install the desktop April Tag library.

 ![スクリーンショット 2023-10-24 193856](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/e/e546493dba10a4614bd76516cbd8eb3ab9152d99.png)

> **[Photon Fusion | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/third-party/networking/photon-fusion/#running-marker-colocation-on-desktop)**
>
> Guide on using the ML2 Photon Fusion example project

Please advise.

**Unity Editor version** : 2022.3.11f1  
**ML2 OS version** :1.4.0-dev2  
**MLSDK version** :1.4.0-dev2 (Unity Package 1.11.0)  
**Host OS** : (Windows/MacOS) Windows  
**Photon Fusion** : Fusion SDK 1.1.8 F Build 725

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [October 24, 2023, 5:40pm UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/2 "2023-10-24T17:40:08Z")

</div>

The package allows April Tag tracking on other platforms such as desktop :

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/9/9bee6c2f43880901fc20484df0a721b3dd68c1d4.png)

It is a modified version of the following repo: [GitHub - keijiro/jp.keijiro.apriltag: AprilTag tracker for Unity](https://github.com/keijiro/jp.keijiro.apriltag) which was compiled to support April Tag 36h11 markers. You can generate the markers here : [Online ArUco markers generator](https://chev.me/arucogen/)

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [October 25, 2023, 8:44am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/3 "2023-10-25T08:44:32Z")

</div>

> [@kbabilinski](#):
>
> The package allows April Tag tracking on other platforms such as desktop :

This one has already been executed. I don't know what to do after doing this. I have it installed somewhere. It doesn't say anything at all about what is where and what to do, so I can't proceed.

 ![スクリーンショット 2023-10-25 174203](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/3/3ed66aa5fce5e6383248a5d6bc9a8442661947a5.png)

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [October 25, 2023, 2:27pm UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/4 "2023-10-25T14:27:40Z")

</div>

With the package installed, you should be able to preview marker tracking in the example scene on the PC by pressing M then showing the marker to your web camera.

If the camera does not enable properly, select the **Generic Marker Tracking** prefab from the hierarchy, then select the object inside the **Image Source** field. There you can select the Camera to use with the Desktop marker tracker.

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [October 26, 2023, 6:27am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/5 "2023-10-26T06:27:13Z")

</div>

Thanks for the reply.  
After executing the MarkerColocation scene in Unity Edtior, pressing the M key on the keyboard does not show the camera image, even after selecting the Image Source and setting the Device Name.

 ![スクリーンショット 2023-10-26 152323](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/9/92a880c7999a4eca206a78b4d2b9878538486657.png)

When I click the play button in the Unity Editor with Application Simulator running, the LED on the webcam does not turn on.

 ![スクリーンショット 2023-10-26 143859](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/6/678defb4952992e724ca9ff21d64c66f8c15c394.png)

When I click the play button in the Unity Editor without Application Simulator running, the webcam LED turns on, but the following error occurs

> RenderTexture.Create failed: width & height must be larger than 0  
> UnityEngine.Graphics:Blit (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Vector2,UnityEngine.Vector2)

Regardless of whether Application Simulator is running or not, the webcam image will not be projected.

I'm very confused because there is no capture of what steps to take and when they were successful in either case.

---

<div class="post-metadata">

**Author:** ![ababilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/ababilinski/32/79_2.png) [@ababilinski](https://forum.magicleap.cloud/u/ababilinski)\
**Post date:** [October 26, 2023, 11:57pm UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/6 "2023-10-26T23:57:29Z")

</div>

Hi @tokufxug,  
Please see my comments below:

**Using App Simulator**  
App Simulator won't work, because the project uses a custom simulator based off of the Photon Fusion Example

**Webcam texture error**  
Can you try restarting your Unity Editor? If that doesn't work, can you debug the size of the webcam texture?

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [October 27, 2023, 7:12am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/7 "2023-10-27T07:12:17Z")

</div>

Hi @ababilinski  
I understand that App Simulator does not work. I don't think the documentation mentioned whether App Simulator is enabled or not.  
I checked the width and height of WebCamTexture and the width was 1280 and the height was 720.

Klak.TestTools.ImageSource.cs :169

```auto
    void Update()
    {
        if (_running)
        {
            Debug.Log(" ***************************** webcam.width:" + _webcam.width + ", webcam.height:" + _webcam.height);
            RotateBlit(_webcam);
        }
    }
    void RotateBlit(Texture source)
    {
     
        Graphics.Blit(source, _webFlipped, _rotateMaterial);
    
        Blit(_webFlipped, _webcam.videoVerticallyMirrored);
        CameraTexture?.Invoke(source);
        
    }

```

> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* webcam.width:1280, webcam.height:720

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [October 30, 2023, 8:36am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/8 "2023-10-30T08:36:23Z")

</div>

I have already shared the width and height of the Web Camera.  
Any tips on this issue?

---

<div class="post-metadata">

**Author:** ![ababilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/ababilinski/32/79_2.png) [@ababilinski](https://forum.magicleap.cloud/u/ababilinski)\
**Post date:** [November 1, 2023, 2:29pm UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/9 "2023-11-01T14:29:58Z")

</div>

Can you provide the full error that you are getting?

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 2, 2023, 8:50am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/10 "2023-11-02T08:50:35Z")

</div>

> RenderTexture.Create failed: width & height must be larger than 0  
> UnityEngine.Graphics:Blit (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Vector2,UnityEngine.Vector2)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:60)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:174)

---

<div class="post-metadata">

**Author:** ![tokufxug](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/tokufxug/32/172_2.png) [@tokufxug](https://forum.magicleap.cloud/u/tokufxug)\
**Post date:** [November 2, 2023, 10:19am UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/11 "2023-11-02T10:19:09Z")

</div>

The method in the Blit of Klak.TestTools.ImageSource divides the width and height of the OutputBuffer, but the calculation result is NaN because it is 0. This is most likely the cause of the error.

> aspect1:1.777778  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:53)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> OutputBuffer w:0  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:54)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> OutputBuffer h:0  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:55)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> aspect2:NaN  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:58)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> scale1:(NaN, NaN)  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:60)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> scale2:(NaN, NaN)  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:63)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)  
> scale3:(NaN, NaN)  
> UnityEngine.Debug:Log (object)  
> Klak.TestTools.ImageSource:Blit (UnityEngine.Texture,bool) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:65)  
> Klak.TestTools.ImageSource:RotateBlit (UnityEngine.Texture) (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:190)  
> Klak.TestTools.ImageSource:Update () (at Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs:182)

---

<div class="post-metadata">

**Author:** ![ababilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/ababilinski/32/79_2.png) [@ababilinski](https://forum.magicleap.cloud/u/ababilinski)\
**Post date:** [November 10, 2023, 3:31pm UTC](https://forum.magicleap.cloud/t/running-marker-colocation-on-desktop-is-missing/2777/12 "2023-11-10T15:31:54Z")

</div>

I wonder why the OutputBuffer has an output of 0,0

Do you have the `_fullScreenResolution` enabled? Can you add the following debug log to the end of the Start() method and share the output:

```auto
Debug.Log($"_outputTexture: {_outputTexture} | _fullScreenResolution: {_fullScreenResolution} | _outputResolution: {_outputResolution}");

```
