graphics - how to read in a texture picture into opengl -
what easiest format read texture opengl? there tutorials -good tutorials, loading image formats jpg, png, or raw array can used texture mapping (preferably without use of library libpng)?
opengl not knows nothing common image formats (other natively supported s3tc/dxt compressed , alikes, different story). need expand source images rgba arrays. number of formats , combinations supported. need choose 1 suits you, e.g. gl_alpha4 masks, gl_rgb5_a1 1bit transparency, gl_bgra/gl_rgba fullcolor, etc.
for me easiest (not fastest) way pngs, lossless compression , full alpha support. read png , write rgba values array hand on opengl texture creation. if don't need alpha may accept jpg or bmp. pipeline common source -> expanded rgba array -> opengl texture.
Comments
Post a Comment