![]() ![]() Instead, it now displays the "textureID" texture as if the alpha channel isn't there or that it's somehow set to complete opaqueness. Tagsīefore, this code would simply make the displayed texture completely invisible since the "alphaID" texture becomes the alpha channel. These two textures are fed to the following shader on Unity side: Shader "alphaMaskShader" (I simplified this part a bit, what it does in this case is simply fill another texture of the same dimensions of the previous one with black on a single channel) Where alphaID is a pointer to a texture passed by Unity. ![]() GlTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, emptyPixelsAlpha.data()) In a second plugin I have this: static std::vector emptyPixelsAlpha(height * width, 0) Where textureID is a pointer to a texture passed by Unity, and framebuffer->buff is the bytearray of the image I want to put in it. GlTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, videoWidth, videoHeight, glPixFormat, glPixType, frameBuffer->buff) In one plugin I have this: glBindTexture(GL_TEXTURE_2D, textureID) Unfortunately, it is not working correctly anymore. When I started off I used OpenGLES2 to maximize device reach but recently I decided I wanted to try moving up to OpenGLES3, so I included the gl3 headers instead of the gl2 headers, built, and switched Graphics API on Unity to OpenGLES3. So I have a Unit圓D plugin written in c++ and compiled for Android. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |