DXT Compression and Transparency Question (Track .wads)

Posted by Noog 
DXT Compression and Transparency Question (Track .wads)
Date: October 02, 2019 05:12PM
Posted by: Noog
I've been looking into the .wad files some of the circuits I use and have two questions I'd like to address to the experienced track builders out there.

1. What is the difference between DXT1 and DXT5 compression. When should each be used, and why are some textures not compressed at all? (Related - is there a PO hit when using the highest compression, whichever that is?)

2. When and where should transparent & semi-transparent textures be used, and why? (Also, am I right in assuming that both will tend to have more of an impact on PO than an opaque texture?).
In short, DXT1 is for fully opaque textures, and DXT5 is for textures with transparency. As with every compression, a bit of detail is lost during the process. You might see an uncompressed texture every now and then when the creator desired to keep the highest possible image fidelity. And of course since they are uncompressed, they need more memory to be stored. I'm not sure about PO though. Personally I've never felt the need to store a texture without DXT compression.

DXT5 textures can be either semi- or full-transparent. Semi-transparent means every pixel in the texture can be either "on" or "off" regarding transparency - this kind of texture is mostly used in trees and horizon in the original tracks.

Fully transparent textures can have a whole gradient of transparency values, so you can simulate materials like glass - where you can see the object and see through it at the same time.

You should keep all your textures in DXT1 unless you specifically need some part of it to be transparent - your .wad will be smaller, which means shorter loading times. For most textures with transparency, semi-transparent DXT5 is enough. You should keep full DXT5 to translucent objects like glass, and I also recommend full DXT5 for catch fences.

Fences are a particular case not because of the object itself (on paper, a fence perfectly fits the description of either "on" or "off" transparency), but because of the mipmaps. Each texture has four mipmaps which switch in game view depending on how far the object is - when the object is near, the highest resolution mipmap is shown. The problem with semi-transparency is that the on-off behavior also affect the mipmaps, and this effect in fences will lead to a "noisy" effect as you run past them that I personally find very annoying and distracting. Switching the texture to full transparency before generating the lower mipmaps leads to much smoother results.

And when in doubt, check the original .wad files from the unmodded game. Modders can do some crazy stuff :)

Edit: I forgot to mention that when too many DXT5 transparent textures are on the screen at the same time, the game's graphical engine can get confused and show objects in improper positions, or show through objects that should be solid. I also ran into the same trouble when using both transparent and opaque textures on the same object - in these cases, simply detaching the transparent part into a separate object was enough to fix the issue.


Follow F1virtual on Facebook and Twitter for the latest development updates
Send bug reports and track editing questions to f1virtualblog@gmail.com
My unfinished tracks: [www.grandprixgames.org]



Edited 2 time(s). Last edit at 10/03/2019 03:16PM by Prblanco.
Re: DXT Compression and Transparency Question (Track .wads)
Date: October 03, 2019 08:06AM
Posted by: Noog
Fantastic information Paulo. That helps a lot.

Thank you.
Thanks Paulo, I can always learn something else

Mods & Tracks for GP4 - [www.mediafire.com]


Keeping alive the GP4
Hello Paulo,

Does this explanation works also for car objects, specifically Windscreens or Windows (in case of GT or prototype car mods).

i know it pretty much using the z_cockpit_visor object works as transparency when in lod0, but in lower lods, it does not show transparent, but solid (with DXT1 compressed textures, at least).
Just curious if it has same behavior if change to DXT5 for window textures.

Thank you
Ricardo
The game handles car textures differently. All car textures are DXT5 and the transparency layer is not used to control transparency, but reflectance under dynamic lighting. Compare the chrome McLarens from the Lewis Hamilton years to the more recent Red Bulls and you have a nice picture of what I'm talking about.

I believe z_cockpit_visor is a special case (all the z_ objects are), and it really only works with transparency in LOD 0. The cars from the original game didn't even have this object in lower lods, I think. But in this particular issue you'll have more luck asking people who have modded these kinds of cars already.


Follow F1virtual on Facebook and Twitter for the latest development updates
Send bug reports and track editing questions to f1virtualblog@gmail.com
My unfinished tracks: [www.grandprixgames.org]
Prblanco Wrote:
-------------------------------------------------------
> The game handles car textures differently. All car
> textures are DXT5 and the transparency layer is
> not used to control transparency, but reflectance
> under dynamic lighting. Compare the chrome
> McLarens from the Lewis Hamilton years to the more
> recent Red Bulls and you have a nice picture of
> what I'm talking about.
>
> I believe z_cockpit_visor is a special case (all
> the z_ objects are), and it really only works with
> transparency in LOD 0. The cars from the original
> game didn't even have this object in lower lods, I
> think. But in this particular issue you'll have
> more luck asking people who have modded these
> kinds of cars already.

Thank you for your reply, I guess I will test by myself to see results, I want to convert a modern GT3 mod, for personal use. I am not so skilled as other people here, but enjoy the process of converting and seeing a nice in game result. Cheers!
@Prblanco. You said all for track and car. Nothing more to add (Y) ;-)

Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, Vader, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy