View Full Version : Outdated JPG?
03-03-2003, 12:06 AM
I was trying to implement jpg loader in my app, but everytime I load file, it has visible artifacts - white horizontal lines. When I load file that's given with gametutorials jpeg loader, everything is fine. Where is the problem, are those libs old or what?
03-03-2003, 12:50 AM
The problem can be hard to find but here are several ways.Are you using our own way of loading JPEG files.Try first the tested ways and then see what's wrong with your code.The JPEGs libraries are not old,you just do something wrong.
03-03-2003, 06:21 AM
Same with compiled exe's from gametutorials http://www.opengl.org/discussion_boards/ubb/frown.gif You can check that yourself, just download textut3 & use your own textures instead given ones.
03-04-2003, 04:04 AM
Are the jpegs you use in the power of two?
Like: 256x256 or 512x512?
03-04-2003, 04:23 AM
Yeap, 100000%. Have someone checked those examples? Image.jpg loads well as far as I don't touch it, but if I resave it with Paint/PainterClassic/W-XP Picture viewer everything goes wrong http://www.opengl.org/discussion_boards/ubb/frown.gif
Its a requirement of OpenGL that textures are in a power of two.
There are a couple of ways to use a 'non power of two' texture in OpenGL.
Here are two examples (there is a third which includes mipmapping but I am not sure if you are ready for that yet, no offense)
1.) Stretch the picture (dont care about the aspect ratio) to the next biggest power of two size. When you texture that to an rectangle that has the same aspect ratio then your initial pic it will be fine (except that the filtering may not as got as on a none stretched image).
2.) create a power of two size texture bigger than the image and place you image inside that (dont forget to adjust the texture coordinates).
Depending on what you want to do 1.) or 2.) may be more suited.
03-04-2003, 11:26 PM
Hi, the wheel is done!. You can use the "FreeImage" lib for loading jpg, tga, tiff, pnb, bmp...as texture for OpenGL. It's very ease.
03-05-2003, 03:04 AM
Yeap, I think I'm not redy for mipmapping yet, coz I'm using GL_GENERATE_MIPMAP_SGIS on hw where possible & simple mipmapping where not http://www.opengl.org/discussion_boards/ubb/frown.gif
OK, enough http://www.opengl.org/discussion_boards/ubb/smile.gif The problem is in fact that I use those textures to create world maze + outdoor env, w reflections (stencil) & CG for lighting stuff. And everything was fine while I was using BMP's, they all are 256x256@600dpi & 24bit, Except for skybox where I have 512x512 textures. But when I resave those images to JPG & load through my JPG routine OR gametutorials JPEG loading routine, strange artifacts appear http://www.opengl.org/discussion_boards/ubb/frown.gif
Unfortunately, I have some reasons not not to use any kind of libs http://www.opengl.org/discussion_boards/ubb/frown.gif
[This message has been edited by M/\dm/\n (edited 03-05-2003).]
03-06-2003, 02:35 AM
Seems that problem arises only with files saved on W-XP Pro http://www.opengl.org/discussion_boards/ubb/frown.gif
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.