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.
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
The package allows April Tag tracking on other platforms such as desktop :
It is a modified version of the following repo: GitHub - keijiro/jp.keijiro.apriltag: AprilTag tracker for Unity which was compiled to support April Tag 36h11 markers. You can generate the markers here : Online ArUco markers generator
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.
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.
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.
When I click the play button in the Unity Editor with Application Simulator running, the LED on the webcam does not turn on.
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.
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?
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
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
I have already shared the width and height of the Web Camera.
Any tips on this issue?
Can you provide the full error that you are getting?
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)
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:
Debug.Log($"_outputTexture: {_outputTexture} | _fullScreenResolution: {_fullScreenResolution} | _outputResolution: {_outputResolution}");