Page 1 of 2

TGA or JPEG ?

Posted: Sun Jul 02, 2006 1:54 pm
by Salombo
Hello All
I have made a skin pack and changed a few textures from tga to jpeg ... this saves a lot of space. The shader didn't have to be updated.
And the skins work perfectly.

Is there a rule for using tga when jpeg works too ?

Thank you

using psp(mac) and gimp(pc)

Posted: Sun Jul 02, 2006 2:28 pm
by Runt
I think the shader has to be tga. The real textures can also be jpg.

Posted: Sun Jul 02, 2006 2:59 pm
by Salombo
Yeah true 8-)

A skin I downloaded had a tga shader and a jpeg texture. That's what made me check this out. I reduced the size of the skinpack from 25mb to 9mb by converting large tga files to smaller jpegs. Haven't noticed a loss in detail or quality.

That's why I was wondering if there was some sort of rule for using tgas instead of jpegs. I don't want to end up crashing the server or causing a conflict in any way.

Thank You for answering :wink:

Respectfully :D

Posted: Sun Jul 02, 2006 5:41 pm
by Runt
tga's can handle alpha channels. used for transparant parts of textures.

Posted: Sun Jul 02, 2006 5:42 pm
by ViPER
If the tga carries an alpha channel - it will be lost in the jpeg.

/forum/viewtopic.php?t=11914

Posted: Sun Jul 02, 2006 11:38 pm
by Salombo
Well Thank You Guys
That clarifies the dos and donts.

cheers :wink:

Posted: Wed Jul 05, 2006 3:52 pm
by PKM
i have seen skin shaders where the file type was changed to .jpg though i see no reason to go through that if the file type lists .tga and it still accepts .jpg .

Posted: Wed Jul 05, 2006 5:13 pm
by Rookie One.pl
I do.
quake3-1.32b/code/renderer/tr_image.c wrote:

Code: Select all

if ( !Q_stricmp( name+len-4, ".tga" ) ) {
	  LoadTGA( name, pic, width, height );            // try tga first
    if (!*pic) {                                    //
		  char altname[MAX_QPATH];                      // try jpg in place of tga 
      strcpy( altname, name );                      
      len = strlen( altname );                  
      altname[len-3] = 'j';
      altname[len-2] = 'p';
      altname[len-1] = 'g';
			LoadJPG( altname, pic, width, height );
		}
;)

Posted: Wed Jul 05, 2006 6:19 pm
by PKM
the canuk skin shader in city nights final :
jyd_tunic
{
qer_editorimage textures/flak/forces/jyd_tunic.tga
{
map textures/flak/forces/jyd_tunic.tga
rgbGen lightingSpherical
}
}
jyd_pants
{
qer_editorimage textures/flak/forces/jyd_pants.tga
{
map textures/flak/forces/jyd_pants.tga
rgbGen lightingSpherical
}
}
jyd_boonie-tops
{
qer_editorimage textures/flak/forces/jyd_boonie-tops.jpg
cull none
{
map textures/flak/forces/jyd_boonie-tops.jpg
rgbGen lightingSpherical
}
}

jyd_boonie-sides
{
qer_editorimage textures/flak/forces/jyd_boonie-sides.jpg
cull none
{
map textures/flak/forces/jyd_boonie-sides.jpg
rgbGen lightingSpherical
}
}
jyd_face
{
qer_editorimage textures/flak/forces/jyd_face.tga
{
map textures/flak/forces/jyd_face.tga
rgbGen lightingSpherical
}
}
jyd_tunic_c
{
qer_editorimage textures/flak/forces/jyd_tunic.tga
{
map textures/flak/forces/jyd_tunic.tga
rgbGen lightingSpherical
}
}
jyd_blank
{
qer_editorimage textures/flak/forces/jyd_blank.tga
{
map textures/flak/forces/jyd_blank.tga
rgbGen lightingSpherical
}
}
45holster_jyd
{
qer_editorimage textures/flak/forces/45holster_jyd.tga
{
map textures/flak/forces/45holster_jyd.tga
rgbGen lightingSpherical
}
}
sv_jyd_sleeve
{
qer_editorimage textures/flak/forces/sv_jyd_sleeve.tga
{
map textures/flak/forces/sv_jyd_sleeve.tga
rgbGen lightingSpherical
}
}

Posted: Fri Oct 20, 2006 2:31 pm
by k47a
not very on topic

i get a 'load tga' error when loading the game when i use custom jpg textures... any ideas how to solve this problem (last time i had to change every jpg tex to tga to fix the problem :? )?

Posted: Fri Oct 20, 2006 7:42 pm
by bdbodger
Make sure your .jpg image is a 24 bit rgb color image . What are you useing to make the jpg ?

Posted: Fri Oct 20, 2006 8:08 pm
by k47a
Thanks! I'm using PS to make them; where can i check that it's 24 bit rgb?

Posted: Fri Oct 20, 2006 11:01 pm
by lizardkid
they released Q3 codebase? i thought thye just released Q2...

Posted: Fri Oct 20, 2006 11:33 pm
by PKM
lizardkid wrote:they released Q3 codebase? i thought thye just released Q2...
news to Lz2the k-i-d; vader is luke's father .

Posted: Fri Oct 20, 2006 11:55 pm
by bdbodger
If that means Photo Shop then on the image menu with a graphic loaded click mode and make sure it says rgb color and 8 bits per channel .