Author Topic: 32 bit textures - TGA and JPG  (Read 9658 times)

0 Members and 1 Guest are viewing this topic.

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Using this feature

http://mysite.freeserve.com/thomaswhittaker/c_code/freespace/fs2_open_r.rar
http://mysite.freeserve.com/thomaswhittaker/c_code/freespace/Launcher.rar

Ok the exe in this thread allows you to use TGA's and JPG's instead of PCX's.
For example fighter01-01a.tga or fighter01-01a.jpg can be loaded instead of fighter01-01a.pcx.

The engine will look for TGA first, then JPG and finally PCX

Also you must specify '-32bit_textures' command line parameter otherwise the textures will load into 16 bit even if you are playing in a 32 bit mode. We still have a lot of old cards so I dont want to force maximum quailty on everyone.

EDIT: For anyone downloading the exe from now on the parameter is '-t32'

This feature is only currently supported in D3D. Why? Because D3D provided a very nice function to do a lot of the work for me.

Now this is new code and I expect there to be bugs so anyone who tries it should consider themself a beta tester. Please give feedback on good and bad.

File type details

If people want I could also throw in compatiblity for these files types: .dds, .dib and .png
However the more types FS2 supports the more time it will take to work out which files it wants to load.

I have chosen jpg because a maximum quality jpg can give us good quality for a small file size.
I have also chosen TGA because it supports alpha channels.

Alpha channels

However I advise you not to use alpha channels except for stuff like planets. I've not tested alpha channels yet so they may not work perfectly yet. If you use alpha channels for 3D stuff then you are on your own, chances are the FS2 engine will not act how you expect and fixing that is not trivial.

Remember non alpha TGA's are 24 bit TGAS. If you save a 32 bit TGA without an alpha channel you wont see very much.

Green masking will have no effect in TGA and JPG, I could change that but I figure its better to stick to alpha channels since someone may actually want to use pure green in an image at some point.

Limitations

Because I coded it using D3DX functionality it has some interesting advantages. 16 bit users will be able to use the same data and it will be scaled down to 16 bit for them. Also hopefully it will scale down textures that are too large for your card. The only problem I see is that currently this system does not support texture sections so if people start making interface art then people whos max texture size is below 1024 (everyone scowl at voodoo owners) will get a very blurred picture in the frontend.

I think anyone releasing seriously huge textures for a MOD or whatever should have a low res version as well. All this scaling functionality is all very well but it will process slower on the machines that need to do the most rescaling of big images.

Also obviously using 32 bit textures instead of 16 bit means there will almost certainly be a performance loss.

Theres probably other problems that I havent forseen but they will turn up when people start to use this for real purposes.

Further work

Im also working on getting the current PCX's to load into 32bit for a slight increase in quality.
« Last Edit: October 25, 2003, 08:17:50 pm by 848 »

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
work it with the interface too ?
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
YEAH !! it works you are my hero :D :D :yes:
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
32 bit textures - TGA and JPG
Can we (I) see a screenshot of this in action? Sounds great!

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
sure ;) its a very fast test
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
32 bit textures - TGA and JPG
....:eek2:

Oh boy...

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
i work on a better render is will post a screenshot in a few minutes ;)
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
hmm well there we go random tiger i got some problems with the launcher they didn't save the -32bit_textures tag i must start the game ever over your launcher and enter the tag again an ingame the screen looks a bit blur
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
32 bit textures - TGA and JPG
Deutsch interface und pilot zimmer ? :)
« Last Edit: October 24, 2003, 02:40:21 pm by 1079 »
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
If its burry, could you post the original image as well so I can get a look at the difference? Theres probably a filter I can change.

Where those loaded from TGA or JPG? Looks like JPG to me.
Feedback is good but full details is better.

Oh.. and your right about the launcher, shows how much people are using that I guess. Make a shortcut to it and put the command line in that for now.
« Last Edit: October 24, 2003, 02:40:06 pm by 848 »

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
sure its tga and its not compressed its 1.32 mb
http://www.nwn-dippelsbach.de/dota/2_ChoosePilot.tga

edit: for example look at the lens flare of the erinyes
« Last Edit: October 24, 2003, 02:42:12 pm by 1059 »
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
32 bit textures - TGA and JPG
jpg's for the interface art sound good but, as a modder, for textures I think I'll stay on 16bit pcx for the moment (unless someone prove me that I can have a jpg with same quality and smaller filesize), since there isn't in my opinion such a big quality loss to 32 bit colour depth compared to potential perfomances loss, the jump could be made instead with tga with alpha channels.....
RT, can you explain me please what do you mean with alpha channel used on planet? I think you mean the background with something like a feather on the borders, right?
Alpha channel could bring to some interesting transparency effects..hmmmm
huff, I must change my old voodoo2:(

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Thanks freeterran, you're right. I just did a difference blend between the two images and theres a blur.

And my code is using a filter, I'll turn that off.
But I cant be bothered to post a new exe just for that.
I will keep your informed though, you've got better eyes than me.
« Last Edit: October 24, 2003, 03:02:55 pm by 848 »

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
hehe no problem i hope this will be implented in the next cvs update :) and could you not code it that we didn't need to start with the -32bit_textures tag ?
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Quote
Originally posted by KARMA

RT, can you explain me please what do you mean with alpha channel used on planet?


PCX's use pure green to set alpha on and off. Having a whole channel means you can make it gradual. Only problem is in 16 bit theres not really enough room per pixel for colour and alpha so one or the other suffers.

Definately time to get rid of your voodoo, they are terrible cards in just about every way.

You can get a 'nVidia GeForce 4 MX440 64MB AGP' for £34 !
Thats less than the price of a console game where I live.

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Quote
Originally posted by FreeTerran
hehe no problem i hope this will be implented in the next cvs update :) and could you not code it that we didn't need to start with the -32bit_textures tag ?


Well, I was going to make it a registry setting (controlled by tickbox in the launcher) but anytime you say 'registry' around here people start rolling around the floor screaming. Suggestions?

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
32 bit textures - TGA and JPG
yes, it what I understood was more or less correct:)
but, ehy, don't offend my poor voodoo2!!!:mad: it was an outstanding graphic card!!!...an era ago... :rolleyes:

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Actually FreeTerran, look at the edges around the ships in the first image you posted (the red one). Can you see what I mean. Perhaps you could post the original of that so we can see if thats the filter as well.

Thats what made me think it was from a jpg.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
32 bit textures - TGA and JPG
yeah the jpg is crappy quality the edges are from the image only the blur is on this screen but ingame they look a bit harder

btw: here is the orginal
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline RandomTiger

  • Senior Member
  • 211
32 bit textures - TGA and JPG
Sorry, I just hate voodoo cards for all kinds of reasons.