The correct way to use png / jpg in OpenGL ES

What is the correct way to save images in png format if I want to use it in an Android OpenGL ES application as a texture?

Somehow some textures work, and some textures get incorrect vertex display. The code is the same, the image is different.

+3
source share
1 answer

It looks like you're loading texture data incorrectly, PNG can be 24-bit per pixel (RGB) or 32-bit per pixel (RGBA). If you do not take this into account in the texture loading code, some textures will look like this.

+2
source

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


All Articles