Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: phreak on January 10, 2003, 04:43:21 pm

Title: another graphics feature -- need input
Post by: phreak on January 10, 2003, 04:43:21 pm
i recently stumbled across a feature used in newer games: texture compression, and its implementation using OGL (dunno how to do it in DX, but i know its possible)

using compressed textures, modders can use 32-bit textures that have been compressed leading to:

lower memory usage
faster rendering
faster texture upload
faster disk i/o


i'm planning on using the DirectX Texture Compression (DXTC) file format (.dds).  A DXTC compressor can be found as PS and 3DSMAX plugins, and a DirectX SDK utility called DxTex.

DXTC images also support mipmapping within the file.

DXTC is supported using TNT cards and up for nvidia. and Radeon 7500 and up for ATI

Compressed Textures would also be a help to modders in terms of download size

http://developer.nvidia.com/view.asp?IO=texture_compression_OpenGL
Title: Re: another graphics feature -- need input
Post by: Sesquipedalian on January 10, 2003, 06:25:09 pm
Quote
Originally posted by PhReAk
DXTC is supported using TNT cards and up for nvidia.
Ergo, Yes!
Title: another graphics feature -- need input
Post by: LtNarol on January 10, 2003, 06:33:03 pm
Not quite sure if I follow correctly, but what does the compression do to quality compared to uncompressed 8 bit maps?
Title: another graphics feature -- need input
Post by: phreak on January 10, 2003, 09:19:48 pm
you dont need palletting and its near lossless so theres not much to worry about
Title: another graphics feature -- need input
Post by: Krom on January 10, 2003, 09:58:16 pm
If I'm not mistaken 3dfx cards (like the voodoo3) also support S3TC/DXTC.
Title: Re: another graphics feature -- need input
Post by: Setekh on January 10, 2003, 10:55:53 pm
Quote
Originally posted by PhReAk
modders can use 32-bit textures


Yes please. :) It sounds excellent, the way you describe it - any known weaknesses?
Title: another graphics feature -- need input
Post by: Deepblue on January 10, 2003, 11:09:27 pm
Does that mean weapons too?
*Drools.....* *Thinks about the massive memory his current weapon effects take* *Decides not to think about it*
Title: another graphics feature -- need input
Post by: KARMA on January 11, 2003, 06:24:21 am
i agree, btw what will happen to older gpus that don't support compression?
Title: another graphics feature -- need input
Post by: phreak on January 11, 2003, 12:27:00 pm
Quote
Originally posted by KARMA
i agree, btw what will happen to older gpus that don't support compression?


modders can do this:

campaign_maps_dxtc.vp
campaign_maps_std.vp

if the user has a TNT+ or Radeon it should run in OGL.
DX should support this natively



STATS
-------
256x256 bitmap (24 bit) -- 192kb
256x256 pcx(256 color) -- 80kb
256x256 DXT1 (25 bit - 8r 8g 8b 1a) -- 32kb
256x256 DXT3 (28 bit - 8r 8g 8b 4a) -- 64kb
256x256 DXT5 (32 bit - 8r 8g 8b 8a) -- 64kb

DXT2 and DXT4 aren't supported by OGL hardware
Title: another graphics feature -- need input
Post by: Fetty on January 11, 2003, 02:43:01 pm
i just did some digging
according to that site nether tnt nor tnt2 cards support dxtc
gf256 starts with that

*sniff my g400max doesnt support it ether :(
edit vodoo 3 also doesnt
Title: another graphics feature -- need input
Post by: vyper on January 11, 2003, 06:58:22 pm
Quote
Originally posted by Fetty
i just did some digging
according to that site nether tnt nor tnt2 cards support dxtc
gf256 starts with that

*sniff my g400max doesnt support it ether :(
edit vodoo 3 also doesnt


Hold the boat... I have  a G400 and Elite Force had Texture cmopression, and it worked fine. :D
Title: another graphics feature -- need input
Post by: LtNarol on January 11, 2003, 07:05:01 pm
I vote no...or atleast make it optional.  Some people are still using tnt2s :nervous:.  That and I really don't want to figure out a system of organization around those 2 vp names, since I'll be releasing 7 chapters using 7 separate mods :shaking:
Title: another graphics feature -- need input
Post by: Sesquipedalian on January 11, 2003, 08:13:12 pm
Quote
Originally posted by LtNarol
I vote no...or atleast make it optional.  Some people are still using tnt2s :nervous:.  That and I really don't want to figure out a system of organization around those 2 vp names, since I'll be releasing 7 chapters using 7 separate mods :shaking:
It works on a TNT and up.  A TNT2 is part of the "up".  Hence the 2.
Title: another graphics feature -- need input
Post by: phreak on January 11, 2003, 09:07:51 pm
oops.. i cant read :mad:

dyslexia strikes again

GF 256 +
Radeon 7500+

only for OGL

DX should support this natively, since its DirectX Texture Compression

forgot to make this clear:

if FS2 loads a texture named "texture01" and finds "texture01.dds" and "texture01.pcx", it will load the compressed one first
Title: another graphics feature -- need input
Post by: Anaz on January 11, 2003, 09:37:08 pm
?again strikes dyslexia
Title: another graphics feature -- need input
Post by: IceFire on January 11, 2003, 10:26:23 pm
Would this be a step on the way to getting some nice bump mapping too?
Title: another graphics feature -- need input
Post by: Setekh on January 13, 2003, 06:14:42 am
Quote
Originally posted by IceFire
Would this be a step on the way to getting some nice bump mapping too?


http://developer.nvidia.com/search.asp?keywords=bump+mapping

I wish I understood this stuff. :o
Title: another graphics feature -- need input
Post by: RandomTiger on January 13, 2003, 06:58:51 am
Im not convinced this would give much of a speed increase given the way the engine works but if you think you can get it done it wont hurt to try.

EDIT: Actually what you should do is measure how much time the current system takes, and see how much % it takes up and if this is worth doing.

Which is what my timing system is for http://www.hard-light.net/forums/index.php/topic,12701.0.html
Title: another graphics feature -- need input
Post by: Inquisitor on January 13, 2003, 02:45:21 pm
Mkae a copy of your code directory and try it out :)
Title: another graphics feature -- need input
Post by: aldo_14 on January 13, 2003, 04:19:33 pm
Quote
Originally posted by Setekh


http://developer.nvidia.com/search.asp?keywords=bump+mapping

I wish I understood this stuff. :o


This may be better - it's onew of the things I'm doing next semester.  I'm looking forward to it - looks like the eventual aim is to code a (java based, natch) 3d (wrl I think) viewer ala 3d exploration.  Should be fun.

https://www.cis.strath.ac.uk/teaching/ug/classes/52.359/lect14.pdf
Title: another graphics feature -- need input
Post by: aldo_14 on January 13, 2003, 04:22:55 pm
Quote
Originally posted by RandomTiger
Im not convinced this would give much of a speed increase given the way the engine works but if you think you can get it done it wont hurt to try.


Would increase the texture bandwidth on the gfx card, surely... I'm not sure exactly how it works, though (not conversant with the FS2 engine).... AFAIK I understand the textures are pre-cached on load (so it wouldn't impact texture loading into the gfx card), but what about the affect on moving the textures within that cards memory iteself (caching and the like, which I presume it does, i.e. for switching lods)
Title: another graphics feature -- need input
Post by: LtNarol on January 13, 2003, 05:10:37 pm
Quote
Originally posted by Sesquipedalian
It works on a TNT and up.  A TNT2 is part of the "up".  Hence the 2.


Quote
Originally posted by Fetty
i just did some digging
according to that site nether tnt nor tnt2 cards support dxtc
gf256 starts with that

*sniff my g400max doesnt support it ether
edit vodoo 3 also doesnt


Well, are you sure it works with TNT and up?  Fetty doesnt seem to think so :blah:
Title: another graphics feature -- need input
Post by: phreak on January 13, 2003, 05:26:01 pm
its natively supported in DX.

it needs a GF1 or radeon 7500 for OGL

so yes, only if you run in DX mode
Title: another graphics feature -- need input
Post by: phreak on January 14, 2003, 06:52:00 pm
from the looks of it, we get to see texture compression

admins, you can close the poll.  I have already started work
Title: another graphics feature -- need input
Post by: phreak on January 17, 2003, 05:23:29 pm
looks like its working with OpenGL mode in 16 and 32 bit.

if any DX coder wants to work with this go ahead
Title: another graphics feature -- need input
Post by: phreak on January 18, 2003, 06:48:35 pm
I have DXTC support working.. time to rest.

To use DXTC support:
1-create texture in a paint program save final as 24-bit .bmp. This is for non-alpha'ed texes. Read the DxTex readme for info on how to use alpha channels

2-Once open, go to Format->Change Surface Format and select DXT1, DXT3, or DXT5.

3-save as *.dds

4-Freespace2 now searches for .dds files before looking for .pcx files


For a copy of DxTex go here: http://fs2source.warpcore.org/ogl/dxtex.zip

remember to place in data/maps
Title: another graphics feature -- need input
Post by: Martinus on January 30, 2003, 12:09:13 pm
[color=66ff00]*applauds* :nod:
[/color]