TGA Loading und Texture Questions

Mutle
Unregistered
 
Post: #1
For my 3D Engine, I need to load TGA's as Textures. All the code I found, didn't work. If anyone has got good (ANSI-C) code to load it, please help me.

Also I was searching for a list, of all the OpenGL Texture Options with description, but I couldn't find anything good.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
Check lesson 34 at NeHe. It shows how to load compressed and uncompressed TGAs.
Quote this message in a reply
ededed
Unregistered
 
Post: #3
This is Cocoa so may not be your problem but for ages I was stuck with texture loading problems, I think all textures that OpenGL uses have to be size 2^n pixels^2

so that could be:
64*64
512*512
256*256
32*32

It took a while to get that one worked out.
SpaceGoon uses texture loading so get that if you want:
http://www.geocities.com/ed72678954/index.html
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #4
Quote:Originally posted by ededed
This is Cocoa so may not be your problem but for ages I was stuck with texture loading problems, I think all textures that OpenGL uses have to be size 2^n pixels^2

so that could be:
64*64
512*512
256*256
32*32
Yep. I think you can also have textures that are 32*64, 128*256, etc. Some new graphics cards support textures of other sizes, but you don't want to limit your game to just computers with those cards.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Actually, EXT_texture_rectangle is supported by every card better than the Rage128. If you're doing a "standard" 3D engine, in today's terms, it's probably not an unreasonable requirement.

Rectangular textures have other disadvantages, though:

Rectangular Texture coordinates run from 0..width, 0..height instead of 0..1, 0..1 as they do for Power of Two (PoT) textures.

Rectangular textures can't be mipmapped.

Rectangular textures can't GL_REPEAT, only GL_CLAMP or GL_CLAMP_TO_EDGE.

--------------

If you want to target the Mac only, just use QuickTime to load your textures. That way you won't limit yourself to TGA, and you know your image loading doesn't have bugs Smile

QTValuePak
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone texture loading issue yotryu 0 3,313 Mar 11, 2009 03:40 AM
Last Post: yotryu
  Texture Mapping: Loading a texture from a .bmp file? ishrock 5 5,749 Dec 13, 2008 09:27 AM
Last Post: ThemsAllTook
  OpenGL Texture Loading & Sprites corporatenewt 2 10,935 Jan 30, 2008 12:39 PM
Last Post: ynda20
  Texture Loading in Cocoa... dave05 3 7,915 Dec 11, 2007 03:12 AM
Last Post: DoG
  general blending versus texture blending questions WhatMeWorry 2 4,895 Dec 7, 2006 02:43 PM
Last Post: arekkusu