Hello
I’m having the classic, black texture issue with my app on android. I think i know the cause, (the texture size is too large), but it is quite unique, and I can not think of a fix.
I’m running the vuforia plugin on android, which works fine. However when the AR marker is detected, I need to access the pixel information from the webcamtexture vuforia is using. Currently I’m accessing the texture via the material used by the renderer that displays the webcam texture that vuforia uses. It works fine on PC, however on android the accessed pixels are black, resulting in a black texture. (Note that I’m not talking about the webcam background).
This leads me to assume that when I cast the mainTexture on the webcam backdrop to texture2D (so I can access the pixel information) the Texture2D that is returned is black. An example
Texture2D texture = (Texture2D)backdropRenderer.material.mainTexture; // Get the texture assigned to the backdrop as a Texture2D
return texture.GetPixel(15, 50);
This is only an example of the part of the code that I have isolated that causes the problem, as I have confirmed all other parts to work.
So this leads to two questions
- is there another means of accessing pixel information from vuforia’s webcamtexture than the above
- what is the limit of generating texture2d via script on android