Results 1 to 4 of 4

Thread: Texture files

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    england
    Posts
    1

    Texture files

    Hi, I was wondering what the easiest file format to load for textures is? I Do not want source code but to attempt this from first principles, and was wondering if any one could offer advice.

    I have already had a look at a few file formats at wotsit.org, but tiff and jpg seem to difficult for me to load. Any suggestions for an easier format?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Texture files

    TGA is a very good format and it's very easy to read too. If you're a beginner in programming, I suggest you go for uncompressed TGAs and forget about compression for now. Compressed TGAs are not that difficult, but requires some programming experience to implement.

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: Texture files

    Be careful of LSB / MSB ordering when reading binary data. If you're working on Intel PC's this shouldn't be a problem, though if on MAC you may have to switch bytes....

    The tga file format is definately the easiest, as bob said, uncompressed is the way to go for ease of implimentation.

    check out www.wotsit.org for the file format spec

  4. #4
    Guest

    Re: Texture files

    A common error is to construct a TGA header structure that does not align to 18 bytes. Be careful if trying to read the header into a structure and ensure that the structure's size is actually 18 bytes.

    If sizeof() returns anything greater than 18, then you will need to add the line

    #pragma pack(1)

    to force 1 byte alignment of data.

Similar Threads

  1. loading exr files to a texture
    By Zarathustra in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-31-2008, 03:48 PM
  2. How can I browse bmp files to map texture?
    By rhizome in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-26-2002, 12:54 AM
  3. how to load 3ds files with jpeg texture?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-15-2002, 11:12 PM
  4. help: Texture from files
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-20-2001, 01:03 AM
  5. Using RAW RGBA texture files
    By Shields in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-13-2000, 10:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean