Reputation: 51
This is my 1st question here. I m new to Android development and i build now a live wallpaper (LiveSpace) I allready uploaded the lite version , you can find it here. https://market.android.com/details?id=thedavincode.alienland&feature=search_result#?t=W251bGwsMSwyLDEsInRoZWRhdmluY29kZS5hbGllbmxhbmQiXQ..
i tested it with Xperia phones and Lg P990 , and it seems to work fine , but there is a weird problem with Galaxy S2. (2.3.4. android) My app has 11 objects(classes) with a texture for each object, and every object has its own program and shaders. galaxy wont render more than 8 textures. it goes from id 0 to 7 and then rest objects apear black. no matter what i ve tried nothing changes. ive read that there is a limit for 8 textures but per shader , not total. Any help would be valueable.. thanks.
Upvotes: 1
Views: 4120
Reputation: 1285
SGS2(Mali400MP) have a limit of a max. 8 texture units. If you are using only single texture in shader, then you could use only one unit. For example:
glUniform1i(uTexture, 0);
- do it for all of your objectsglBindTexture(GL_TEXTURE_2D , m_texture);
- you are binding texture to active texture unit.glActiveTexture
call, as by default first texture unit activated (GL_TEXTURE0
)You should always keep in specification limits if possible, to be compatible with most devices.
Using one texture unit per object/texture is not a way to go.
Upvotes: 1