Judith on 19/12/2009 at 11:57
I bet most of you texture makers know what (
http://en.wikipedia.org/wiki/Mipmap) mipmapping is, and you know T3 Flesh engine uses it extensively. I'd say the effect is a bit too strong, you can see texture quality is going down when you're just 128 UU from the surface.
If you ever fiddled with default.ini, you probably saw the mipmapping option, but it has only two states: point, where everything is pixelated, and mipmap. Incereasing the number doesn't improve the mipmapping quality.
But I've just found out what does :)
(
http://img707.imageshack.us/i/7seamdetail.jpg/) The bathroom tiles I used in this example have uneven gaps, so the effect is exaggerated, but if you have more regular tiles it should look much better. You can use this technique with any texture types, but tiles are the kind of surface which default engine mipmapping seem to affect most and it's clearly visible to the player.
This is my tile texture with default mipmapping, look how vertical lines get blurred the more they're away from the player:
(
http://img13.imageshack.us/i/0none.jpg/)
Inline Image:
http://img13.imageshack.us/img13/2856/0none.th.jpgAwful isn't it? But there's a remedy for that. You can generate mipmaps when you save the .dds image in your 2d editing program. I'm using Gimp with .dds plugin. There are several options here, you have to tick "Generate mipmaps" option and click on the "Advanced options" to choose mipmap filter. Now let's see how each setting affects the image quality ingame:
1 - Default:
(
http://img12.imageshack.us/i/1mipmapdefault.jpg/)
Inline Image:
http://img12.imageshack.us/img12/2257/1mipmapdefault.th.jpg2 - Nearest:
(
http://img13.imageshack.us/i/2mipmapnearest.jpg/)
Inline Image:
http://img13.imageshack.us/img13/4089/2mipmapnearest.th.jpg3 - Box:
(
http://img12.imageshack.us/i/3mipmapbox.jpg/)
Inline Image:
http://img12.imageshack.us/img12/8760/3mipmapbox.th.jpg4 - Bilinear
(
http://img23.imageshack.us/i/4mipmapbilinear.jpg/)
Inline Image:
http://img23.imageshack.us/img23/6541/4mipmapbilinear.th.jpg5 - Bicubic
(
http://img13.imageshack.us/i/5bicubic.jpg/)
Inline Image:
http://img13.imageshack.us/img13/8153/5bicubic.th.jpg6 - Lanczos
(
http://img141.imageshack.us/i/6lanczos.jpg/)
Inline Image:
http://img141.imageshack.us/img141/4099/6lanczos.th.jpgYou can see the big difference between default engine mipmapping and e.g. Lanczos. This last one option takes a few second before the image is saved so I guess it's the best quality setting. I don't see any difference between Default and Box filter so it might be the same setting, and there's only a tiny difference between Box and Lanczos. Nearest is one of the worst settings but I'm surprised there's no difference between Bilinear and Bicubic which are pretty bad too.
You'll also notice that it adds some KB to the image size, even if the image is compressed, so use it wisely. DXT5 1024 texture with alpha gets additional 300 kb. Uncompressed 1024 .dds is usually 3 MB, with mipmaps it's 4 MB. I guess we can assume that such operation adds 1/3rd to the space needed for the image on your HDD. Bigger files mean more bigger .ibt file sizes but sometimes the quality is just worth it ;)
massimilianogoi on 19/12/2009 at 12:16
Whatta hell! This is supposed to elminate the Moiree effect?
Beleg Cúthalion on 19/12/2009 at 13:50
And for me as another noob: This adds a bit of information so the engine knows how to shrink the texture in the distance properly...right? I might have a look at strange mip-mapping effects in my map, but there shouldn't be too sharp tiles I think.
Inline Image:
http://www.eidosforum.de/images/smilies/addon/kratz.gif
Judith on 19/12/2009 at 14:08
Quote Posted by Beleg Cúthalion
And for me as another noob: This adds a bit of information so the engine knows how to shrink the texture in the distance properly...right? I might have a look at strange mip-mapping effects in my map, but there shouldn't be too sharp tiles I think.
Inline Image:
http://www.eidosforum.de/images/smilies/addon/kratz.gifYup, that's it. You don't have to generate mipmaps in your .dds file, but those generated by the engine look awful. I haven't tested it yet but it also might be possible to generate them by hand. It's just a set of additional layers, your base texture scaled down twice until it gets to 1 x 1 pixel. So this +1/3rd size calculation is incorrect, the number of additional layers depends on image size. For 1024 it's 10 layers, 512 - 9, 256 - 8, and so on.
massimilianogoi on 20/12/2009 at 03:17
Then you can use it only on the diffuse, that's the best one, in my opinion, seeing that three pictures.
Judith on 20/12/2009 at 08:08
It appears to be so, but it's the effect of the normalmap getting pixelated heavily. It may look good on screen but in motion it's the first example that looks best. Almost as if we had 2x or 4x anisotropic filtering :cheeky: Though the second option seems more reasonable, disk space-wise.
Let's say you aim at high visual quality and you use only 1024 textures and uncompressed normals. The latter weigh 3 MB per each. Generated mipmaps will add 1 MB to every normalmap you have and from 150 to 300 KB to other compressed textures. If you have something like 100 materials, which is a common situation when you build your mission out of custom textures only, you'll get additional 100 MB just from normals :tsktsk: It may not increase the final package size as much, since ibt files with textures inside get compressed quite nicely, but it will require much more space on HDD to run.
So indeed, it's wise to choose the second option.
Ziemanskye on 20/12/2009 at 09:05
Fading mipmaps is where they lose colour as they go, like if you wanted things to disappearing into fog you could have them fade to the same colour as the fog to save a bit of effort, and to smudge the edges of the effect a bit more.
Or you could fade to white for a snowy level, or to black (with the exception of the window textures) to get an effect like the stylised skylines in the game.
Generally though, it's not something you'd use without being part of some special effect, since you generally need to plan in advance that you'll be using it.
Judith on 20/12/2009 at 16:52
Thanks for the insight, Z.
I was also fiddling with normalmap compression, since there's such mode as DXT5n, but it produces strange results in .dds plug-in for Gimp. Normals are pink and half-transparent :erg:
I also found t(
http://developer.nvidia.com/object/real-time-normal-map-dxt-compression.html) his article, where 3Dc compression is mentioned. This is DX 10 compatible only, but its DX 9 counterpart is the DX5nm, which is unfortunately not available in this Gimp plugin. Too bad, since that might help us decrease FM sizes a bit, without much loss in quality.