Question

I have a code that renders objects in obj and mtl format (android - opengl es 1.1) For small objects (few textures) I have no problem but when the number of textures exceeds 30-40, I receive this in my logcat: eglLockWindowSurface failed to map memory at... I load all the textures in onSurfaceCreated using glBindTexture and texImage2D (all to single texture unit). And bind them for drawing in onDrawFrame

What's the problem exactly? I searched for hours but couldn't find any solution for this situation except texture atlas. Since my company gives me the export files of blender/3dsmax I can't use this approach. How I can avoid this error and work with this too many textures?

Thanks in advance.

Was it helpful?

Solution

only limit for loading and binding texture is max integer size! the limit was maximum texture size (depends on device) If maximum texture size is 4096kB, it means you can't bind an image that has width * height * 4 greater than 4096,000. (4 is float size). so you must scale down your image.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top