-
Advanced Member
Frequent Contributor
Re: Want to do trees
Just to tell you : the glPixelstorei are ok. But those value are the defaults and it is those you are suppose to use with my loading code. to learn more about the glpixelstori just find an electronic version of the red book.
As for the non rectangular texture: it is not my code fault! Opengl only support texture that are power of 2.
So examples are 64 X 64, 128 X 64, 256 X 64 etc.
so the height must be 2^m and the with 2^n where n and m can and cannot be equal.
if their are not, some weird things will happen.
[This message has been edited by Gorg (edited 02-12-2000).]
-
Re: Want to do trees
No, nonsquare textures are at least supported by GeForce cards. Ive heard that limitations of OpenGL, but with my recent texture code even nonsquare textures work. I played around a bit with your code. It doesn't fail when the texture is nonsquare, it fails when you can't divide the width or the height of the texture evenly through 4... this is strange, ic no way to fix this myself...
Tcs
-
Advanced Member
Frequent Contributor
Re: Want to do trees
hmm. I don't have that problem though. I still think it is because you don't have power of 2 textures (it can be rectangular 128 X 64, 64 X 128), but I'll look into it and come back to you later.
-
Re: Want to do trees
If you are using
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
you need to have your texture data aligned to 4 bytes.
I guess this is specific to data read in from BMP files for example. So, you don't necessarily have to do this. If your texture data is not aligned, just simply leave those four lines of code out.
Cheers,
Hude
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules