- Home /
GL_LUMINANCE format for texture uploads in Android plugin
I am building a plugin for Android that requires I upload a texture from native code. To get the basic plugin framework set up, I wrote a small function that binds to a texture handle passed from Unity and uploads random noise to the GPU for this texture. The plugin will eventually provide a buffer of `GLubyte`s representing a grayscale image. To do the actual texture upload, I make the following OpenGL call:
glTexImage2D(
GL_TEXTURE_2D, 0,
GL_LUMINANCE,
width, height,
0, GL_LUMINANCE,
GL_UNSIGNED_BYTE,
data
);
When doing this call, the result is a black texture on the mesh I am mapping it to. However, if I use `GL_RGBA` as the internal/external format and generate 4 times the amount of noise, the result is, as expected, noise.
Is there something I'm missing here. This works fine in regular OpenGL ES.
Thanks.
Your answer
Follow this Question
Related Questions
No OpenGL Context in Unity above 2017.1.2f1 0 Answers
Extremely slow texture upload in plugin when a model is being drawn 1 Answer
How to get pixels from an external texture? 1 Answer
Opengl plugin for Android 0 Answers
Problem, Textures updated by plugin won't behave as expected in combination with HLSL shader 2 Answers