We are trying to set texture directly to OpenGLES rather than via Unity. The idea is to avoid the buffer copy to increase performance.
On Mac (OpenGL, Unity pro 2.61) the following works:
void paintFrame(int textureID)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0,GL_RGB, GL_UNSIGNED_BYTE, (GLvoid *)imageData);
tex = new Texture2D (width,height, TextureFormat.RGB24, false);
The problem is that on iPhone (OpenGLES, Unity pro 1.7) the same does not work.
Any ideas on: a) Whether the problem arises from the textureID being handled differently between the openGL/Unity versions?
b) Whether the problem is related to the texture size (we are using 256X256) that should be different on mobile?
c) A different way of saving the need to copy the texture buffer to a unity object before it is sent to OpenGLES?
have you found a solution to this problem?
Answer by NicolasHognon
Oct 12, 2011 at 03:31 PM
did you solve your problem ? because I have got the exact same problem.
We copy a texture generated from our C++ plugin to unity through GL functions. It is ok under windows ... but we failed to make it work under iOS.
If you have any idea/recommandation your are welcom.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
1 Person is following this question.
Why the "target texture" option is enabled in Unity iPhone Advance for all the cameras?
Get a portion of a Texture2D to another Texture2D
Procedural or Animated Textur in AirAttack Zeppelin Wreck (IphoneGame)?
2D car track method
GL_LUMINANCE format for texture uploads in Android plugin