Green Screen on Android Devices
Hello!
We've tryed to build andload the example scene with image tracker.
First of all we can see only green screen on all our android devices. What can it be? May be shaders? But we use absolutely axample scenes without any changes!
The second question is that we'veprinted all Your exampleimages and AR not working in editor/ We show all pictured to camera andhave no redult/ Console is quet too. Wecan seethat camera havebeen started, some other information, but no augmenting.
1. SDK Version: 3.5
2. Development Environment: Unity
3. Tracker/Scanner: ImageTraker
4. License Type: Free
5. Target Device: Android-based deveces
width/heigh of ImageTrackableBehaviour gets zero values after the first play in editor.
we are using unity 2017.4.1f
previous 2.6 version works fine and we can see the augmented objects in editor
we've tryed to create our own target image and create 2dmap using Your service. We'he loaded it to the project and the result is the same/ So now we want to try downgrade unity to 2017.3 as you've mentioned somwhere at this forum, that is have been tested and worked fine
we've donwgraded to Unity 2017.3 and everything great in editor now.
But the problem with green screen is still actual. We've tryed it on samsung S8, several noname android devices and the result is the same everywhere!
we've made a photo of the issue
Now we've created an output for information about the device's camera.
Now we know, that aplication and maxt's sdk detect device's cameras well.
ResultCode returns "SUCCESS"
So the main idea is that smth is wrong with shaders
Once again we've tryed to change shaders and when we change them for AndroidToYuv BackGround to CameraBackground one, for example, we can see a black screen on android devices, not green now. So we think that it is the reasom of that issue.
We have no enough time to wait for such long reply, but have to do it.
So now we've installed Your 3.4.2 version and evrything works great!
But we don't want to use old version without new features. We need them. We don't want jigging and so on.
We want 3.5! And Your new upgrade of CameraBackgroundBehaviorur.cs is not working good. Using three parameters of different shaders can't work as must!
What can we do now? We need all functionality without such strange bugs.
Please solve the issue as soon as possible. We need Your help!
Thank You.
Hi,
First, check the following:
1. Delete the ARCamera GameObject in the scene, re-import ARCamera, and run it.
2. Make sure that the Shader is properly linked to the CameraBackground GameObject under ARCamera as follows:
If you have tried the above checks and the problem persists, could you send me a sample code to reproduce the problem? In fact, before launching SDK 3.5, we confirmed that the Galaxy s8 device and unity 2017.3/4. So we need a reproducible way to solve the above problem.
Best regards,
Sam
Maxst SDK team
Sam hello!
We use absolutely empty example pojects without any changes! All shaders are linked absolutely the same way, as you've presented. Moreover, we don't see we need to send any code because we don't make any changes in your examples.
3.4 works fine, but 3.5 with it's 3 shaders in CameraBackgroundBehavior brokes everything.
We have about 15 test devices and all of them work the same way. If we change android's shader the screen is black, so smth is with it. Nothing else can be the reason
oh...Can you give me an Android log message?
Sam
Maxst SDK team
We've tested your algoritm and have read the code of that script.
maxstAR.AbstractCameraBackgroundBehaviour Class Reference
so you write there in
if (Application.platform == RuntimePlatform.Android) {
GetComponent<Renderer>().material = new Material(AndroidYuvBackgroundShader);
} else {
GetComponent<Renderer>().material = new Material(YuvBackgroundShader);
}
as we understand it must turn the YuvBackgroundShader in editor and AndroidYuvBackgroundShader on the device.
And we play in editor, it chanfes to cameraBackground shader and shows fine in play mode.
But when we try to build to a device, it tryes to load Yuv shaders.
We'vetryed to change shaders during editor plays the game mode. And when we switch to any Yuv shader we can see only pink sceen.
Yes we understand, that it can be so, that it is mobile shaders only. But when somebody creates a shader for Yuv he have to understand, that his shadermust work on all devises!
We've tryed to switch shaders to cameraBackground and have no result on devices.
BUT!!! When wi use your cameraBackground standart shader in 3.4 sdk there is only one shader and it wirks great on all devices, on iOS too!!
And why have you added that strange Yuv shaders?? And why don't they work perfect.
Can You do smth with it?
Once again: we dont't do any changes in codes, use Your demo scenes and seeonly green screen in 3.5 sdk and when we use 3.4 evrth works perfectly from the box.
The one visible difference between them is Yuv shaders adding.
When we change them to any other shader screen becomes black on the device.
Can you kindly explain why have You done it? What is the reason or Yuv using and why can't we work without it like in 3.4 sdk??
Thank You
.........
if(imageFormat == ColorFormat.RGB888) {
rgbTexture = new Texture2D(imageWidth, imageHeight, TextureFormat.RGB24, false);
GetComponent<Renderer>().material = new Material(RGBBackgroundShader);
GetComponent<Renderer>().material.mainTexture = rgbTexture;
} else if(imageFormat == ColorFormat.YUV420sp)
....................
Hm. And may be there are another devices, which uses another image fofmats? Or You set them Yourself?
If it is so, why YUV????
So now we see, that editor in unity uses RGB and that shader works good.
And our test devices use another format and Your YUV shader for android can't beused. And so we see green screen.
BUT!!! ONCE AGAIN! There are no YUV in previous 3.4 sdk. It's a pity, but we can't see previous AbsctactCameraBackgrounrBehaviour script...
So as we undersatan there was no any YUV color format.
Unfortunately the engineer in charge your problem is our of office now.
And weekend is even starting.
So..can you wait during weekend?
We will try our best to solve your problem ASAP.
Jack
Maxst SDK Team
We use the yuv shader because Android and iOS cameras use camera images in yuv format. Converting a yuv image to rgb results in a slight overhead, which affects SDK performance. Therefore, our SDK renders the YUV camera image provided by the device without conversion. But for Windows webcams, use RGB Shaders because they can be output directly to RGB.
We tried the test again on the Galaxy s8 and confirmed it was okay. Does not the app have camera permissions disabled?
If there is an error in rendering, the error log will obviously occur. We want the adb error log. Only then can you solve the problem.
Sam
Maxst SDK team
We've put additional info to debug text on screen and have written a few line of code. Now we can see, that camerabacground's material is setted to "YUVtoRGB" but not "AndroidYUVtoRGB".
using UPDATE we've founded that shader in use is "AndroidYUVtoRGB" and this is the reason. This shader not working on all our different android devices.
It is rather strange.
Permissions are ok, because 3.4 works fine!
Did you use YUVtoRGB in 3.4? Looks like not, so it works fine.
And eaven if 3.5 YUV shader works on Samsung S8, it doesn't mean, that it'll work on all android devices. We need to create applications, which will work on all devices.
Hm..
We are testing for most of our Android devices. Shader is work fine all devices we have.
Unity render graphic What is the api set to? In other setting, disable auto graphics api, add opengl es2.0, drop it to the top, rebuild it. If you still have same problems, please let me know your Android logcat message.
Sam
we'll do our best to solve the issue ourselves as usual.
And of coorse we'll wait for You answer.
thank You!
we can now add that in log we can see only one message:
Remapping between formats 62 -> 4 is not supported
04-20 16:00:17.392: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.399: E/Unity(19314): Remapping between formats 62 -> 4 is not supported
04-20 16:00:17.399: E/Unity(19314):
04-20 16:00:17.399: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.411: E/Unity(19314): Remapping between formats 63 -> 4 is not supported
04-20 16:00:17.411: E/Unity(19314):
04-20 16:00:17.411: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.421: E/Unity(19314): Remapping between formats 62 -> 4 is not supported
04-20 16:00:17.421: E/Unity(19314):
04-20 16:00:17.421: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.428: E/Unity(19314): Remapping between formats 63 -> 4 is not supported
04-20 16:00:17.428: E/Unity(19314):
04-20 16:00:17.428: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.435: I/Unity(19314): onPause
04-20 16:00:17.437: E/Unity(19314): Remapping between formats 62 -> 4 is not supported
04-20 16:00:17.437: E/Unity(19314):
04-20 16:00:17.437: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.448: E/Unity(19314): Remapping between formats 63 -> 4 is not supported
04-20 16:00:17.448: E/Unity(19314):
04-20 16:00:17.448: E/Unity(19314): (Filename: /Users/builduser/buildslave/unity/build/External/ProphecySDK/BlitOperations/BlitterInteger.cpp Line: 1006)
04-20 16:00:17.457: E/Unity(19314): Remapping between formats 62 -> 4 is not supported
we have android 5.0 device. What are the minimum requerements for using sdk with YUV shader?
minimum level is 19, so it have to work on adnroid 5.0
We need to create applications for everybody, not only for flagman users like s8 and so on. What will it be, if only 5-10% of user's devices will work fine?
We use YUV shader because All Android device can get YUV Image.
then, you can check Image format for your device.
you can find Update Function in InstantTrackerSample script.
TrackingState state = TrackerManager.GetInstance().UpdateTrackingState();
TrackedImage image = state.GetImage();
ColorFormat format = image.GetFormat();
use upper script.
That format is your device camera format. if your device can not get YUV format, we will find that other camera format problem how to fix it
format = RGB888 on our device at start.
If we use your methods in "update" we can see, that current image format is YUV420sp
So if 3.4 with it's standart CameraBackgroun shader works fine, why 3.5 with it's new shaders don't work as it have to?
Dear friends, lets solve this problem please, lets make it!
Thank you.
May be our devices can't use YUV format? Can we set it from script? Or we can only detectthis value, which is setted by Your library?
you can see format value RGB888 at Android Device? we already setted value NV21(YUV) in Android JNI.
so.. please send to me your apk file. we will check your project file.
How can we send it to you?
Send to : sdk@maxst.com
thank you
We've sent apk to You yesturday. Have You seen it?
Yes. we are finding what is problem. We will send patch to you after fix that problem.
Hello! So much time without any issue solution. Is everything is allright?
We are wokring to fix for that issue. We will release fixed version next week.
thank you.
Sorry, prognosist.
We knew what the problem was. But it takes a little time to fix it.
We will officially release version 3.5.1 next Tuesday.