Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Camera feed does not show when using OPENGLES2 as Graphics API #277

Open
patrickscheper opened this issue Jun 27, 2018 · 25 comments
Open

Camera feed does not show when using OPENGLES2 as Graphics API #277

patrickscheper opened this issue Jun 27, 2018 · 25 comments
Labels

Comments

@patrickscheper
Copy link

When using OPENGLES2 as Graphic API the ARBackground does not show the camera feed. It's black and creates artifacts from the canvas.

Did I overlook the documentation of is this a bug?

@patrickscheper patrickscheper changed the title ARCore (Background) does not show when using OPENGLES2. Camera feed does not show when using OPENGLES2 as Graphics API Jun 27, 2018
@pablisho
Copy link
Contributor

Hi, Thanks for the report, but I cannot reproduce your issue. Could you give some instructions to repro? Are you using HelloAR? Which device are you using? Which version of ARCore are you using? What modifications are you doing to the project? Thanks.

@cvasquez-github
Copy link

Same thing here, using Unity 2017.3.1p4, Camera feed (background) not working when setting Android-Graphics API to OpenGLES2, and we really need ARCore to work with GL2... BTW I noticed that the ARBackground.shader file explicitly mentions GLES3. (// For GLES3, #pragma only_renderers gles3, #ifdef SHADER_API_GLES3)

@NicolasWipon
Copy link

Hi,

I also have the black screen issue, with Auto Graphics API enabled (when I disabled it, I can see GLES3 and Vulkan as default Graphics API).

I'm using ARCore 1.3.0 and Unity 2018.1.6f1. I have the issue on HelloAR scene build on a Galaxy S7 (model SM-G930F) with Android 7.0.
And now, even the default Camera App of the phone shows a black screen and I get an error : "Warning Camera failed."
The smartphone is not very hot.
I need to reboot it to have the camera works again.

Here is what I did to get the issue, I didn't do any modification on the samples :

-> Create a new Unity Project on 2018.1.6f1
-> Import "Google ARCore 1.3.0" unitypackage.
-> Follow these instructions : https://developers.google.com/ar/develop/unity/quickstart-android (switch on Android platform, disabled multhreaded rendering, change package name, Minimum and Target API Level and enable ARCore in XR Settings)
-> Open "HelloAR" scene
-> Test in editor (press Play and it installed InstantPreview on the smartphone) : camera feed was working when I tested in editor.
-> Build and run the app on the Galaxy S7 with Android 7.0 : no camera feed, I just saw a black screen with the UI "Searching for surfaces..."

@patrickscheper
Copy link
Author

I have the same configurations as @NicolasWipon . My Samsung S7 (SM-G930F) has Android 8.0.

@cvasquez-github
Copy link

Any news? Maybe is just an issue on the ARBackground.shader?? I'm not a shader expert, maybe someone could modify the shader to properly support GL2? Thanks!

@DaneyT
Copy link

DaneyT commented Aug 14, 2018

Hi,

I have also tried the ARCore unity package in combination with Opengl es2 and I also noticed the camera background bug.
In my case, the camera feed is also not visible and the 3D graphics are stretched out.
In Opengl es3 everything works perfectly fine.
Watch this video to see it in action: https://www.youtube.com/watch?v=oTfS1nP3nJQ&feature=youtu.be

Background info project: Tried to make a Google Instant Play app in Unity with ARCore. The project is below 10mb(I disabled a lot of Unity packages in the Window-> Package Manager to get it below the 10mb limit) and it works and builds fine, even with instant build. It should work, only the bug prevents it from working correctly. The background camera plane is broken in instant build and normal build.
As spotted by @cvasquez-github the issue lies probably in the ARBackground.shader (second half of the shader).

The project can be downloaded here: https://drive.google.com/file/d/1I-vbmNqP1jVqmVdLlP2utVNCr4oRru5K/view
To test it install the .apk files and see the difference. The .apk files can be found in the _Builds folder.

Unity version: Unity 2018.2.0f2 (64-bit)
ARcore unity package: 1.4.0
Recorded device: Google Pixel
Unity scene: HelloAR
Android versions: Android 8.1 & Android 9
To view the bug: Disable auto graphics API and Change Opengl es3 to Opengl es2

Google wants to implement this as seen here: https://www.theverge.com/2018/5/8/17326260/google-play-instant-apps-ar-android-update-new-features-arcore-no-download-io-2018
It would be great if you could take a look at this bug.

@cvasquez-github
Copy link

Excellent @fredsa great to know that you are fixing this issue on the next upcoming release!! Do you have an estimated date for it? Thank you very much!

@pablisho
Copy link
Contributor

Hi, ARCore SDK for Unity 1.5.0 has been released and this issue should be fixed. Please feel free to comment if you still experience it.

@hcGuyue
Copy link

hcGuyue commented Sep 28, 2018

When I disabled auto graphics API and Change Opengl es3 to Opengl es2, I got a pink screen without the camera feed.
Unity version: unity 2018.2.5.f1
ARCore unity package: 1.5.0
Device: Huawei P20

@cvasquez-github
Copy link

Worked perfectly here! using OpenGLES2, built using Unity 2018.2.7f1 (64-bit). Tested on Pixel 2.
Thank you very much for fixing this issue!

@cvasquez-github
Copy link

cvasquez-github commented Oct 3, 2018

It worked fine on Google Pixel 2 and Samsung Galaxy S7 devices, but we are getting Pink screen on Samsung Galaxy Note 8 devices using OpenGLES 2.

whatsapp image 2018-10-03 at 07 41 55

@cvasquez-github
Copy link

When I disabled auto graphics API and Change Opengl es3 to Opengl es2, I got a pink screen without the camera feed.
Unity version: unity 2018.2.5.f1
ARCore unity package: 1.5.0
Device: Huawei P20

Same thing here on Galaxy Note 8.

@Frander
Copy link

Frander commented Jan 31, 2019

I have the same issue y some Samsung S7 models using opengles2, but when i using opengles3 the problem is fixed.

@TimJansenDB
Copy link

TimJansenDB commented Mar 1, 2019

Same Problem here on my Samsung A3 and opengles2.
ARCore SDK for Unity 1.7.0
Seems this ticket should not be closed?!

@emongev
Copy link

emongev commented Mar 1, 2019

Same problem here on my Nexus 6P and OpenGLES2 using ARCore SDK for Unity 1.7.0, definitely shouldnt be closed.

@TimJansenDB
Copy link

TimJansenDB commented Mar 4, 2019

It seems that the OpenGL Version switch is not working on some Devices.
If I take out all GLES3 code it works on GLES2 also.

@fredsa
Copy link

fredsa commented Mar 4, 2019

Given that a number of you are still not able to use GLES2 on several devices, reopening.

@imkrystal
Copy link

Hi @cvasquez-github
Have you resolved the problem ?
I'm using Vuforia (scene A) and ARCore (scene B)

  • Vuforia (camera will work if you uncheck Auto Graphics API and use OpenGLES2)
  • ARCore (camera will work (not pink shader) if you use OpenGLES3 or check Auto Graphics API)
    How can I make it work together ?

@alepandolfo
Copy link

I was able to make it work by removing the line 77 of the ARBackground shader:

transitionColor = texture(_TransitionIconTex, uvCoordTex);

Then I replaced it by this:

#ifdef SHADER_API_GLES3
transitionColor = texture(_TransitionIconTex, uvCoordTex);
#else
transitionColor = textureExternal(_TransitionIconTex, uvCoordTex);
#endif

And it's fixed!
At least on my phone (Moto Z3 Play)

@imkrystal
Copy link

imkrystal commented Apr 10, 2019

@alepandolfo I will try this. Thank you so much :)

@Frander
Copy link

Frander commented Apr 13, 2019

I was able to make it work by removing the line 77 of the ARBackground shader:

transitionColor = texture(_TransitionIconTex, uvCoordTex);

Then I replaced it by this:

#ifdef SHADER_API_GLES3
transitionColor = texture(_TransitionIconTex, uvCoordTex);
#else
transitionColor = textureExternal(_TransitionIconTex, uvCoordTex);
#endif

And it's fixed!
At least on my phone (Moto Z3 Play)

I try this fix and works in a Samsung S7 SM-G930U, but in a Samsung S7 edge SM-G935F still show pink screen, both of them have the same processor and the same GPU.

https://www.sammobile.com/devices/galaxy-s7-us-unlocked/specs/SM-G930U/
https://www.sammobile.com/devices/galaxy-s7-edge/specs/SM-G935F/

@azukizuki
Copy link

This issue continues to occur with ARCore 1.9.
It does not occur in Pixel 3 but occurs in Huawei P20...

@fredsa
Copy link

fredsa commented May 14, 2019

I just checked a few devices using Unity 2017.4.27f1 with OpenGLES2 only with 1.9.0 SDK+APK:

  • Pixel 2: works correctly
  • Samsung Galaxy S7: works correctly
  • Huawei P20: magenta background — does not work

@joinCY
Copy link

joinCY commented May 17, 2019

我刚刚使用Unity 2017.4.27f1和OpenGLES2检查了一些设备,只有1.9.0 SDK + APK:

  • 像素2:正常工作
  • 三星Galaxy S7:正常工作
  • 华为P20:洋红色背景 - 不起作用
    I have the same problem

@joinCY
Copy link

joinCY commented May 17, 2019

I just checked a few devices using Unity 2017.4.27f1 with OpenGLES2 only with 1.9.0 SDK+APK:

  • Pixel 2: works correctly
  • Samsung Galaxy S7: works correctly
  • Huawei P20: magenta background — does not work

I have the same problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests