How can I correctly display a png with a gradient using OpenGL ES on the iPhone? -


I have tried to use PNGs as a mess in my OpenGL ES based iPhone game. Gradents are not properly prepared. How can I fix this?

"Not properly prepared" I mean that the gradients are not smooth and do not like to degrade sections of a particular color, but a smooth transition

In the original problem, there are some bits of RGB in your texture (or likely to be less) your frame buffer . The PNG file will not be used directly by the graphics hardware - it should be converted to some internal format. I do not know the OpenGL ES API, but you can probably put the PNG file directly in it, or you can do some conversion steps first and take the converted data in hand to open the GL ES. Either in any case to ensure that the relevant document is used, the internal format used is of sufficient depth. For example, a 256 color-plated image would be sufficient as a 24-bit RGB or 32-bit RGBA format. I strongly suspect that your PNG has been converted to RGB 15 or RGB 16, which has only 5 or 6 beats per color component - is not nearly enough to display a smooth gradient.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -