googlevr / cardboard

Open source Cardboard SDK and samples
Other
1.48k stars 253 forks source link

Unity XR Plugin - GLES3 support #40

Closed GnoblarAgency closed 3 years ago

GnoblarAgency commented 4 years ago

Currently, the XR Plugin requires that you use only the GLES2 graphics API. Is it planned to update this to GLES3?

We previously mixed Cardboard with ARCore but this is no longer possible as ARCore requires only GLES3.

jballoffet commented 4 years ago

Thanks for requesting the feature, adding GLES3 support is on our roadmap. Please star or watch this issue to be notified when it becomes available.

RajatPatel5 commented 4 years ago

I am also facing the same issue with using ARCore and XR plugin in the same project. Please fix this or provide an alternate temporary solution.

StefanoCecere commented 4 years ago

top problem. thank you

darkverse commented 4 years ago

Yes major problem. OPENGLES3 would be a must have but are there any plans for Vulkan? Is it on the roadmap at all?

Roborino commented 4 years ago

This is a huge issue for us. We can not move forward until this is resolved. At a min we need XR Plugin to be able to use GLES3 as we are using ARCore with our application. We are on hold until this can be resolved.

What is the expected ETA?

ankityudiz commented 4 years ago

Same Issue faced by me as well in one of our project as we use ARCore plugin and it conflicts with OPENGLES3 graphics API, Can you guys tell us how much time it will still take for an update with GLES3?

RajatPatel5 commented 4 years ago

I am using ARFoundation as well as Google Cardboard in my project. As this new XR plugin only uses OPENGLE2 which is not supported or either ARkit or ARCore we are unable to use both the plugins in our project. We also tried to use the older plugin but we are not able to resolve the references of UIWebView with it. So please suggest some ways to overcome this issue.

hawkwood commented 4 years ago

Instead of this plugin, I am successfully using Mobfish's plugin (https://github.com/mobfishgmbh/Cardboard-VR-Unity-SDK) with ARKit on iOS. I think the public_dev branch is suppose to be functional with Android, but I haven't tested it yet.

maartenslaa commented 4 years ago

Same issue here, I thought OpenGLES 3.0 is backward compatible except for some minor parts: "..framebuffer objects are no longer shared between contexts, cubemaps are always filtered using seamless filtering, and there are minor changes in the way signed fixed-point numbers are converted to floating-point numbers." source

Roborino commented 4 years ago

Thanks for requesting the feature, adding GLES3 support is on our roadmap. Please star or watch this issue to be notified when it becomes available.

Is it possible to get an update? Our project is currently on hold until this is resolved.

Roborino commented 4 years ago

@jballoffet understood that it does not support Vulkan.

Is it possible to get a date when it will support GLES3?

chaosemer commented 4 years ago

I expect that adding support for GLES 3.2 is a straightforward shader rewrite that you can do. We include shaders in native code in distortion_renderer.cc and in cardboard_xr_unity.cc. You could also backport ARCore to GLES2 as there's also nothing major in the implementation tying it to GLES3.2. For ARCore I also expect rewriting the shaders to be GLES2 compatible would be sufficient.

I mention this because we're prioritizing issues such as Issue #11 (Metal support) Issue #35 (Requiring Unity Pro) in front of GLES3 support. I hope this unblocks you. 😄

dipaw commented 3 years ago

Any news on OpenGLes 3.0? A lot of developers have been waiting for a long time.

chaosemer commented 3 years ago

This was fixed in v1.4.0.

dipaw commented 3 years ago

68e8685b717b71a76c56ca1b13eaf140 Something goes wrong. :(

chaosemer commented 3 years ago

Drat. These type of device-specific issues are super annoying to debug. We test on the Galaxy S8 and S9, but not on the S7 (which your phone appears to be). We noticed a similar issue on those devices in our internal testing but it looks the S7's specific driver doesn't like #version being on the second line, even if the first line is empty.

I'm fairly certain this will be fixed by moving the #version lines in opengl_es3_distortion_renderer.cc's kDistortionVertexShader and kDistortionFragmentShader and in cardboard_xr_plugin.cc's kWidgetVertexShaderOpenGlEs3 and kWidgetFragmentShaderOpenGlEs3 to be on the very first line, i.e. as R"glsl(#version 300 es. Can you try making that change and rebuilding sdk.aar following the instructions in generate_sdk_aar.md on your phone (looks like a Samsung Galaxy S7)?

dipaw commented 3 years ago

Yes, there really is a mistake on the samsung s7. I checked on the Blackberry Priv, everything starts fine there. Unfortunately, I don't even have an android studio, and I don't even know how to use it, so I can hardly help you with anything. Sorry.

upd. Checked for s8 plus, it also crashes.

chaosemer commented 3 years ago

What's the build fingerprint on the S8 plus that crashes? (From your log, the S7's build fingerprint is samsung/heroltexx/herolte:7.0/NRD90M/G93OFXXS1DRA5:user/release-keys.) We tested on an S8, but it may have been a different OS or chipset. (The S8 has both Qualcomm and Exynos variants and they have completely different GPU behavior.)

dipaw commented 3 years ago

68e8685b717b71a76c56ca1b13eaf140

Here is the logcat with S8.

chaosemer commented 3 years ago

I created a branch on cardboard-xr-plugin with my hypothetical fix, can you please try that out on your S7 and S8?

The branch is named fix-gles-3.0. You can download it from here, then unzip it and that package to your Unity project by specifying the unzipped location on disk.

dipaw commented 3 years ago

can you please try that out on your S7 and S8?

Both works now, Thank you 👍

chaosemer commented 3 years ago

Glad to hear it! I'm going to open a new bug for the GLES 3.0 doesn't work on some devices and close this one as GLES3 support is completed and working otherwise.

ArcticWolves commented 3 years ago

will there be support for the Vulkan and OpenGL 3.0?

chaosemer commented 3 years ago

OpenGL ES 3.0 should be working fine in the latest release (1.4.1). If you have specific issues, please file them separately.