Closed LeonardOertelt closed 1 year ago
Just add "-format=BGRA" to solve temporally in Windows config line. It seems a problem in the updateTexture32() method in Unity due to TextureFormat in Unity. It seems ARWrapper in ARToolkitX olny exports updatetexture32, and not updateTexture, so it only works with BGRA format.
That solved it for me. Thank you! It would be nice if there was a note in the documentation regarding this issue or a change of the default configuration until this is fixed.
This is now handled automatically. See https://github.com/artoolkitx/arunityx/blob/release/1.1.2/Source/Package/Assets/artoolkitX-Unity/Scripts/ARController.cs#L674
After I finally managed to compile the ARX.dll for Windows using mingw/cmake/Visual Studio 2019 and imported it alongside other libraries into Unity (see image) I always ended up crashing the editor as soon as I hit play.
After some digging in the code and in the Unity logs I found the problem in the file videoRGBA.c:
int videoRGBA::videoRGBA(uint32_t destRGBA, AR2VideoBufferT source, int width, int height, AR_PIXEL_FORMAT pixelFormat)
In case AR_PIXEL_FORMAT_420f bufPlanes has no valid index 0 and the access causes the access violation:![image](https://user-images.githubusercontent.com/51477225/59095437-c4791200-8918-11e9-9e56-28f547809281.png)
I also found out that in video2.c it uses ARVIDEO_INPUT_WINDOWS_MEDIA_FOUNDATION if that helps.
I have been trying to fix it myself but I am not very familiar with the code and haven't managed to get a working build with correct image output. All I managed to get was a green screen. So any help is appreciated!