GLKTextureLoader does not load jpg on "New iPad"

I am trying to create a cubic map of six jpg files from the Internet in GLKit. It works fine on my iPhone 6+, but when I run the same code on the β€œNew iPad”, the cube map is just black when applied to the object. If I try the same with png files, this will work. Is there anything specific that needs to be done to properly download jpg to certain equipment?

The error cubeMapWithContentsOfFiles is nil , so it looks like GLKit believes that it loaded the texture correctly.

Here is a demo project http://s.swic.name/Yw8F

+6
source share
1 answer

If the sizes of the textures that you generate are themselves determined by the display parameters of the device (for example, rendering a full-screen UIView for a texture), then the resulting cubic map can easily fall into MAX_TEXTURE_SIZE on some devices, but exceed it on large devices. What are the pixel sizes of your cube map on iPhone 4 Plus vs 4th generation iPad? If they exceed 4096 in any dimension, you may have problems.

0
source

Source: https://habr.com/ru/post/979001/


All Articles