View Full Version : TGA files not working
Michael Clease
05-06-2007, 00:51
I am trying to get TBGL_LoadTexture to recognise my textures but it keeps reporting that the format is wrong/version
I am making them in PSP with alpha channels or i believe i am.
anyone got any ideas.
Michael Hartlef
05-06-2007, 07:10
Mmmh, I was playing with TGA files just 2 days ago and they were working fine. What do you mean by not working?
Michael Hartlef
05-06-2007, 07:11
If you ment that the alpha channel is not recognized, here is a tip.
You have to set the blend mode. It took me a while to figure it out but I got it to work. I will look it up tonight an post the EQUATE combo.
Michael Clease
05-06-2007, 08:34
they get rejected by load texture, a box pops up saying unsupported format / version.
I know i am doing something wrong i just cant work out what.
Update:
I downloaded GIMP, textures made with that are working must be the way i am making them in PSP.
thanks anyway mike.
Petr Schreiber
05-06-2007, 09:54
Hi Abraxas,
so it works now ?
I must update help file, because TGA are supported only uncompressed 32bit ones - 24bit for color and 8bit for alphas. For 256 colors without mask better choice could be BMP, which are quite similar in size.
You can get very basic TGA masking sample here (http://community.thinbasic.com/index.php?topic=774.msg4739#msg4739)
Thanks,
Petr
Michael Clease
05-06-2007, 11:22
I havent tried them properly yet, what i meant was the load texture is rejecting them.
I will come back with more detail later today (hopefully).
Petr Schreiber
05-06-2007, 16:19
That would be nice,
thanks for your patience
Bye,
Petr
Michael Clease
05-06-2007, 16:48
Looks like it was just me being a dumbass. ::)
I dont know how to use PSP obviously, but gimp is quite good anyway.
thanks for your help.
has anyone written a drawing/ photo editing program in thinbasic yet?
Michael Hartlef
05-06-2007, 18:21
Nope, you are the first ;)
Michael Clease
05-06-2007, 19:01
Think i will pass on that to someone else.
Petr Schreiber
05-06-2007, 19:09
Hi,
something related to image processing allows third party module by Marco Pontello (http://mark0.net/plugins-tbdw-e.html).
Bye,
Petr
Hi Abraxas,
so it works now ?
I must update help file, because TGA are supported only uncompressed 32bit ones - 24bit for color and 8bit for alphas. For 256 colors without mask better choice could be BMP, which are quite similar in size.
You can get very basic TGA masking sample here (http://community.thinbasic.com/index.php?topic=774.msg4739#msg4739)
Thanks,
Petr
I tried saving in different tga formats to make it smaller size. None of the smaller file size ones would work, then read here that it needs to be 32 bit only, ahhh ok :)
Just to give an idea:
The 32 bit tga file is 4,097KB
The 16 bit compressed is 191KB
The 8 bit greyscale is 469KB, don't know why this is bigger than the previous one.
Petr Schreiber
12-06-2009, 13:17
Hi Kent,
yes, TGA only in 32bits, as says help for TBGL_LoadTexture.
Reason is simple - for pictures without aplha channel I was thinking of 24bit BMPs, and when you need Alpha, then TGA.
Both raw data are converted to 8bits per channel RGBA textures, which provide good performance.
To be honest, I will not invest any time to new image formats before TB goes XP only.
Once we are on XP+ ship, TBGL can use GDIPlus safely which supports PNG/JPG/TGA/BMP nicely.
The reason is that PNG format alone has so many variants TBGL DLL would grow a lot just to add one format we will get free once moving to WinXP.
In case somebody needs the functionality on preXP systems, he can pick image library of his choice, and via TBGL_MakeTexture ... make texture from RGB/RGBA stream.
Petr
I see Petr, I was wondering why you hadn't used any of the nice header translations that Jose has on his sight for image libraries, GDI+ being one of them. Unlike me, you are nice and think of users on many older systems.
Lionheart008
13-06-2009, 10:22
hi dear petr, kent, good morning all... :)
where can I find a tbgl example with GDIplus ??? I have read about gdiplus some days ago using FB with GDIplus (supports: bmp, gif, jpeg, tiff, png) to load different image formats :)
@petr:
Once we are on XP+ ship, TBGL can use GDIPlus safely which supports PNG/JPG/TGA/BMP nicely.
would be nice to see how does it works with tbgl... nice day, best regards, Lionheart
Petr Schreiber
13-06-2009, 11:57
Hi Kent,
thanks for understanding :)
Frank, José Roca has lot of examples - for PowerBASIC, but the texture making part should be the same.
It is in GDIPlusUtils.inc I presume, sample code here:
http://www.jose.it-berater.org/smfforum/index.php?topic=2343.0
You simply convert any picture to RGBA series of bytes and then upload it to OpenGL.
The upload part can be simplified using TBGL_MakeTexture in TBGL.
Petr