TGA Loading und Texture Questions
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.
Also I was searching for a list, of all the OpenGL Texture Options with description, but I couldn't find anything good.
Check lesson 34 at NeHe. It shows how to load compressed and uncompressed TGAs.
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
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:Originally posted by edededYep. 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.
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
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
QTValuePak
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

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

