cancel
Showing results for 
Search instead for 
Did you mean: 

How to use an OVROverlay Cubemap?

johnjoseph_cake
Honored Guest
Hi All, 

For this question assume that I'm in the Cubes scene included in the OVR SDK. I'm on mobile using a Galaxy S6 with the GearVR. 

In that scene, I used the OVRCameraRig to generate a cubemap using the Oculus screenshot tool (PNG, size 2048, mipmaps turned on). The cubemap works fine if I create a cubemap skybox material and apply it to the camera, but I want to try and use the OVROverlay cubemap. 

What I did was attach an OVROverlay component to the OVRCameraRig in the scene, set its shape to Cubemap, and placed my generated cubemap in the two texture slots (as per this screenshot). I don't see anything in the editor, which I guess makes sense, but if I build to the phone I don't see the cubemap either. Furthermore if I use ADB I can see lots of errors. The first is

RenderTexture.GenerateMips failed: render texture does not have mip maps (set useMipMap to true).
Which seems odd because, as I mentioned, MipMaps is chcked on my .cubemap screenshot. 

Graphics.CopyTexture can only copy between same texture format groups (OpenGL internal formats: src=37812, blockSize=16 ; dst=32856, blockSize=4)
I figure that means the screenshot is formatted incorrectly, but the screenshot tool doesn't give me a lot of options regarding format. I tried reducing the size of the screenshot but it didn't seem to have an effect (I thought it would change the blocksize or something.) 

OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
I see one of these at the end. 

Is there a step I'm missing? Or is this something that isn't supported on mobile / the Galaxy S6? I actually just tried using the project (as well as the cubemap from the project) mentioned in this thread with the same results. 

Thanks for any help you can provide, 

John
8 REPLIES 8

deftware
Expert Protege
Judging by the CopyTexture error complaining about formats, the problem is likely that you have a cubemap texture that has a different internal format than the framebuffer/screenshot texture.

If the texture can't copy because the src/dst are different formats then naturally it won't generate mipmaps, producing the mipmap error.

johnjoseph_cake
Honored Guest


Hi,

Welcome to the Oculus Developer Forums.

Are you familiar with the documentation on OVROverlay here?

If you were to set the cubemap to underlay, does it still not show up in your scene?


Hi, 
Yes, I think I followed the steps under basic usage and my component in Unity appears to be set up as it is in the screenshot on that page. I don't think there are any other OVROverlay objects in my scene besides the cubemap. I'll try setting it to underlay to see what happens. I haven't tried using the OVRRTOverlayConnector type yet so I'll try that as well. 

deftware said:

Judging by the CopyTexture error complaining about formats, the problem is likely that you have a cubemap texture that has a different internal format than the framebuffer/screenshot texture.

If the texture can't copy because the src/dst are different formats then naturally it won't generate mipmaps, producing the mipmap error.


The cubemap texture was generated using the Oculus Screenshot Wizard. I assume that what that tool generates is fair game for a cubemap, but perhaps the texture it's trying to overwrite is invalid? I'm not sure what that texture is, though (I didn't specify one as far as I can tell) and I can't tell from the OpenGL flags what kind of image it wants. Perhaps I have to somehow clear any existing textures? But I don't know what to bind in order to clear it as it isn't displayed in the error. 

bassmit
Honored Guest
@imperativity I am working on a unity desktop application and would like to use a cubemap overlay to hide dropped frames while loading a scene, but I cant get it to work. A quad works fine, but when I try to use a cubemap all I see in vr is the hourglass icon. There are no errors/warnings/messages in the unity console. Debugging shows that OVROverlay.SubmitLayer is called with a scale of 1 and a pose with position and rotation (as euler) all 0's. SubmitLayer returns true indicating the overlay is considered visible.

I have tried all combinations of overlay/underlay, dynamic, 1 or 2 cubemaps, but to no avail. I am working with the OculusSampleFramework_1.19.0 unity package, and I'm using the following versions as per the console message: Unity v2017.1.0p4, Oculus Utilities v1.18.1, OVRPlugin v1.18.1, SDK v1.20.0.

Does the issue you mention also apply to desktop applications? Can I view the status of that issue somewhere?
Is there a working example, or documentation specific to cubemaps?
Are there any requirements/limitations I should be aware of?

Thanks, Bas


immersion-VR
Honored Guest
Any updates on an eta for this to be fixed within mobile? It has been a .... while :wink:

sycx
Explorer
@imperativity 

We are waiting for this bug to be fixed for a long time.
Any Updates on this bug?
Is there a Unity issue tracker link so we can vote it up and hopefully it can be fixed more quickly. 

immersion-VR
Honored Guest
@imperativity
Do you have an update on the status of this, thanks.

ribsies
Explorer
@imperativity
any updates on this?

immersion-VR
Honored Guest
Slightly off-topic but want to upgrade to 2017.4.1 to try the overlay out but cannot find any link to upgrade?
The update link on this page: https://unity3d.com/unity/whats-new/unity-2017.4.1 takes me to download 2017.3.1...
Is 2017.4.1. available?

Additionally no reference to overlays in the release notes in either 2017.4.0 or 2017.4.1 ?


[Update] Ignore the above - found it here : https://unity3d.com/unity/qa/lts-releases