开发者

How to convert a texture to the ETC1 format for android

开发者 https://www.devze.com 2023-04-07 02:02 出处:网络
Im an openGL es newbie, and am trying to figure out how to lower texture usage in my app. Im aware of ETC1 and the various other c开发者_StackOverflow中文版ompressed texture formats but am having diff

Im an openGL es newbie, and am trying to figure out how to lower texture usage in my app. Im aware of ETC1 and the various other c开发者_StackOverflow中文版ompressed texture formats but am having difficulty figuring out how i can convert my JPGs to ETC1 while the app is loading. I found ETC1Util which can generate during runtime, but this wouldnt really be helpful since my textures will never change. I would also really like to keep my app using api level 7 (ETC1Util was introduced in 8)


ImageTec's PVRTexTool allows you to convert your JPEG to PVR files with the compression of your choice (PVRTC or ETC1 basically). The site is full of interesting things and code around textures (eg. it's easy to make a .pvr loader).

It's also not too hard to use the provided PVRTexLib to write an offline tool that can process your JPEG files and include the tool in your build process (say you still have png/jpeg files in your project for convenience and having rules in your makefiles to generate compressed .pvr texture at build time).

A few weeks ago I've started a small gdk-pixbuf loader using PVRTExLib, might help: https://github.com/media-explorer/gdk-pixbuf-texture-tool

0

精彩评论

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