I’m trying to implement some environment-based Augmented Reality on iPhone by overlaying a Unity scene on top of the camera stream from UIImagePicker. I can push my UIImagePicker under (or over) my Unity EAGLView. However, there is no setting for Unity cameras’ clear flags to let the view under the Unity EAGLView show through as the background.
Is anyone familiar with the openGL settings in EAGLView that would let the “background” subview show through after glClear?
That is actually not possible.
The backdrop will always clear with something, it can not become “see through View” clear.
Actually for your intend you don’t even need the additional view. You can just take the image, resize it to be pow 2 and send it into Unity to use as a gui texture on a second cam to have it behind for example (the enhancement kit from bliprob does that and did so since unity 1.0.2 or alike and works in advanced and basic)
I was hoping that setting the openGL clear color to completely transparent (1.0, 1.0, 1.0, 0.0) wouldn’t leave garbage in the buffer. Are there no openGL settings to only write to the buffer pixels that my objects uses, and not print the others to screen?
I’m trying the camera-grab gui-texture approach, but I think that will cost more cycles than adding a standard second view, so the fps might suffer.
Thank you for your quick reply.
if you don’t write to a pixel it will just keep the old color.
But it will never show the content behind the context