Jump to content
Sign in to follow this  
rellikki

Texture quality sucks!

Recommended Posts

Yeah, I've got my buldozer in the same directory as O2, which is something like 4 or 5 levels down. tounge2.gif

Share this post


Link to post
Share on other sites

texture quality is the main thing that makes me not release my addons confused_o.gif

top is after .pac/paa conversion

bottom is regular .tga

stupidtex.jpg

to me the top one looks really bad, dont know what you guys think about it

Share this post


Link to post
Share on other sites

badly pixelated

its these shades of grey and black that paa and pac seem to have trouble handling i find sad_o.gif

Share this post


Link to post
Share on other sites

Since much guessing still seems to be around when it comes to OFP texture formats, I thought it can't harm to post some info about the OFP texture formats.

I know it's a bit technical, so feel free to ask if something isn't clear.

The difference you see from the tga to the pac/paa texture is mainly due to the difference in bits per color channel for tga and pac/paa.

When you open PAATool, you see some numbers behind the format options. Those numbers show how many bits are used ber channel to encode the color information of your texture.

For example, the tga format is a RGBA 8:8:8:8 format (R=red, G=green, B=blue, A=alpha channel), wich means the format stores its color and alpha values in 8 bits per channel (wich makes the 32bits total for tga with alpha channel).

( bits per channel means that is can store 2^8=256 different color values per channel. This is also the what you are used to from your paint program, where you can choose values from 0 to 255 (=256) for every channel.

Now the numbers that are shown in PAATool are different than 8:8:8:8.

We'll start from the bottom, as those formats are easier.

IA 8:8

The format is special in the way that it only has two channels: I for intensity and A for alpha channel. This means that the IA 8:8 format is a greyscale format as it only stores the intensity of a grey pixel. The numbers 8:8 tell that it is using full 8 bits for both the intensity and the alpha value. Wich means that you can have 256 different greys in your texture and a smooth alpha channel. this format should be identical to the greyscale formats you are used to from your paint program.

Now the problem is that all the converting tools only take 32bit tgas. So to get a 8bit greyscale texure, you first need to convert your texture into 8bit greyscale (or make sure that you really loose all the color information in another way), then convert it back to 24 bit and save it as 32 bit tga.

The main reason for not getting your texture converted correctly into the IA 8:8 format is that there's still color somewhere in your texture.

RGBA 4:4:4:4

This one looks similar to our tga (RGBA 8:8:8:8) format. Well, at least the first part.

The different numbers mean that instead of being able to store 256 different values per channel this format can only store 4bits per channel. Wich translates into only 2^4=16 (!!) different values.

This means that while you can use 256 different shades of, let's say blue, to go from black to bright blue in your tga, this will be converted into only 16 shades of blue in your OFP texture. This is the reason why most textures look that pixelated or banded.

Same applies to the alpha channel of this format: Only 16 shades of grey to define the alpha value.

Note that apart fron the IA 8:8 greyscale format, this is the highest you can get for a color format in OFP.

RGBA 5:5:5:1

As you can see, with this texture format, the bits from the alpha channel have been traded in to get an additional bit for the color channels.

This means that for the alpha channel you now only have 1 bit, wich is either transparent or non-transparent. So no smooth alpha channel here.

Therefor you get an additional bit in the color channels. This translates to 2^5=32 values per channel, wich is allready twice the value of the RGBA 4:4:4:4 format, but still nothing near the 256 different values of a normal tga texture.

So this again leads to pixelation and banding in the converted texture compared to the original tga one.

For both the RGBA 4:4:4:1 and the RGBA 5:5:5:1 format I recommend using the dithering option in PAATool. What this basically does is to simulate a specific color (that can't be displayed due to the small number of available bits) across several pixels. This doesn't help for pixelation, but if you look at the texture form a bit further away, it'll look allmost identical to the tga. No more false colors there.

DXT1 5:6:5 and DXT1 5:5:5:1

Those two texture formats are a bit special as the DXT1 part suggests.

Basically both formats are using RGB 5:6:5 to store their color information. (So the naming of the DXT1 5:5:5:1 is really misleading as it's really RGB 5:6:5 and using a trick to store the 1 bit alpha channel).

So what we got here are formats that can store 2^5=32 values for their red and blue channels and 2^6=64 values for their green channel.

This means that shades of green will show much less banding than shades of other colors or greyscales.

But that's not the whole truth of the DXT1 formats.

To save space those formats aren't really saving a 16 bit color for every pixel. Instead they take a so calles "texel" of 4x4 pixels, do some guessing and store just 2 16 bit colors and get 2 colors between those 2 stored ones with a certain calculation (wich is allways the same). Then the pixels are marked wich one of those 4 colors (2 stored + 2 calculated) they should get.

If you look closely at converted textures, you can see this effect of 4x4 pixel blocks that have a different color than the sourrounding ones, while in your tga texture all was smooth.

The big advantage of this compression method is that most graphics cards understand this compression and therefor it saves RAM on the graphics card as well as bandwidth.

Also this compression works quite well with photos as those are much more noisy and non-uniform than hand painted textures.

That's the reason why adding noise to a texture might help for a DXT1 convertion.

Look closely at the different colors of the pixels in a photo to see the difference to your hand painted texture.

Here's also the difference between TexView and PAATool: TexView uses a different algorithm to determine the 2 stored colors of a texel than PAATool.

If you know what texture format you want to get, I would allways advise to use PAATool and set the specific texture format you want (not Autodetect!).

TexView only uses the Autodetection method and sometimes just refuses to take the texture format you want to have as the exact way how TexView decides isn't known (afaIk).

At least I don't know a way to get TexView to convert textures into the RGBA 5:5:5:1 format.

You can easily check the texture format by opening the texture in a hex-editor and looking at the first 2 bytes:

80 80 -> IA 8:8

44 44 -> RGBA 4:4:4:4

55 15 -> RGBA 5:5:5:1

01 FF -> DXT1

Some general guidelines what texture format to use:

Allways try to use DXT1 without any alpha channel (DXT1 5:6:5 in PAATool or if you're using TexView, make sure that the alpha channel of your tga is really all pure white).

From a performance point of view this is the best format as it doesn't use any alpha channel and its compression is understood by the graphics card, so it saves bandwidth and ram.

Try to get close to the noise and color variation of a photo with your hand painted texture as the compression works much better then and isn't really obvious.

If you need an alpha channel, try to see if you get away with a 1 bit black/white alpha channel that doesn't have smooth transitions (but make sure that your alpha channel is really all pure white or pure black).

This way you can still use the DXT1 texture format (DXT1 5:5:5:1 in PAATool) wich will help the performance.

If you really need a smoother alpha channel, then it depends on whether you have a greyscale texture or a colored one. For greyscale ones use IA 8:8 and for colored ones RGBA 4:4:4:4.

When using TexView, make sure that your texture really doesn't have any colors if you want to get IA 8:8 and check the resulting file with the hex-editor to make sure.

Using IA 8:8 for greyscale textures that doesn't need a smooth alpha channel results in a better looking texture, but be well aware that it taxes the system more than a DXT1 texture.

Also the face order in your model might cause problems in combination with other textures that use alpha channels.

Same for the RGBA 5:5:5:1 texture format. Especially with Dithering enabled in PAATool, it might look better, but it taxes the system more than a DXT1 texture.

Trying PAATool instead of TexView (or the other way round), might help to get a better looking DXT1 texture

Also the same problems in combination with transparent textures as above apply.

Only ever use the RGBA 4:4:4:4 format if you really need a smooth alpha channel in combination with a colored texture, as the banding and pixelation will really get worse than with all the other formats.

Another thing is how those different texture formats translate into .paa and .pac:

In general, .paa can be everything, while .pac needs to be a DXT1 texture format. If you try to rename a non-DXT1 texture from .paa to .pac, OFP gets confused and can't find the mipmamps, wich explains the error message you're getting then.

If a texture is named as .paa, OFP seems to examine further what exact texture format it is, while with .pac it just assumes that it's a DXT1 format.

Share this post


Link to post
Share on other sites

I had a go at making a vehicle camo texture, and i'm having conversion problems again. I've tried all the tools, PAA and PAC format, all the modes for PAATool, but it just keeps getting screwed over upon conversion from TGA to PAA or PAC. Tried making it a big texture, then resizing it to a smaller one, didn't work. I had the same problem with a gun texture in the page before this, that was quite dark so maybe just problems with that, but this texture should have no problems due to colour, its broken up and lighter than other textures i've seen. help.gif

boxertgapaa0yq.jpg

Share this post


Link to post
Share on other sites

I've found my TGA files sometimes retain >something< crazy_o.gif that causes them to become "patchy" or bleed when I convert with Texview no matter how many times I try to redo the same file by cutting colours to 256 or reducing this that or the other .......

Simple solution, I have to start with a fresh blank 256x256 (or whatever) and draw away again.

If I remember, it mostly happens when I try to copy and existing working texture and reshade it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×