Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Want to do trees

  1. #11
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    662

    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).]

  2. #12
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Bremen, Bremen, Germany
    Posts
    58

    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

  3. #13
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    662

    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.

  4. #14

    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
  •