开发者

Correct way to use png/jpg in OpenGL ES

开发者 https://www.devze.com 2023-01-12 16:43 出处:网络
What is the correct way to save images in png format, if I want to use it in my Android OpenGL 开发者_StackOverflow中文版ES application as texture?

What is the correct way to save images in png format, if I want to use it in my Android OpenGL 开发者_StackOverflow中文版ES application as texture?

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


That looks like you're loading the texture data the wrong way, a PNG can be 24-bit per pixel (RGB), or 32-bit per pixel (RGBA). If you don't consider this in the texture loading code, some textures will look like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消