Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 41 42 43 [44]   Go Down

Author Topic: High Resolution / True Color Textures Mod  (Read 184707 times)

0 Members and 9 Guests are viewing this topic.

Triad773

  • member
  • Offline Offline
  • Posts: 478
    • Triad's website
Re: High Resolution / True Color Textures Mod
« Reply #516 on: March 10, 2013, 09:57:05 AM »

That's a nice example Malone, thanks- even a Luddite like me can appreciate the difference now :)
Logged

Herra Tohtori

  • Modder
  • member
  • Offline Offline
  • Posts: 671
Re: High Resolution / True Color Textures Mod
« Reply #517 on: March 10, 2013, 11:04:42 AM »

Ok, this is a long post that doesn't directly tie into the high-res texture discussion at least as far as aircraft are concerned, but it may be of interest to modders and players alike. If this takes the thread too much off-topic, feel free to split it into its own topic; otherwise carry on with the discussion.


I've been trying out 2048 map textures and this last has also at times puzzled me. You can use a very detailed 2048 texture but, when flying over it, it does not necessarily look that more detailed, even up close.

But, when flying in mountains and very hilly terrain, you do seem to notice quite a lot more detail.

I have been pondering this and think it may have to do with the angle that the textures are viewed at.

When flying over flat terrain, from a cockpit you look at the terrain from almost perpendicular angles, you are looking down at angles of maybe 5, 10, 15 degrees perhaps. When flying in mountains, from a cockpit you can often look at mountainsides at an almost true 90 angle, that is straight head on.

When you look at 90 degrees, then a texture is not really deformed so much, as you are looking much as you would on your screen in a graphics program.

When looked at in 10 degrees,I think the game tries to render an average of all the details and colors in a texture and ends up creating a more smudged and blurred version of the texture.

You could try to approximate this by for instance holding a bookcover and looking at it straight on. Then hold it almost flat at 180 and see how much you can make out of the words and details in any photos or illustrations on the cover.

I think is one of the reasons why - at least up to a point - Il-2 maps of mountainous or hilly terrain, usually look better than simple flat terrain. Even with old 1024/ 512 texture maps.

For more reading on this matter:
http://en.wikipedia.org/wiki/Anisotropic_filtering

http://en.wikipedia.org/wiki/Mipmap

The problem with MIP mapping in IL-2 graphics engine - at least from what I can see - is that it uses a software-based MIP mapping method, rather than any kind of dynamic MIP mapping which uses the capabilities of graphics cards, and the crux of the problem is that it simply uses too few MIP maps.

Anyone who has done stuff with default skins knows that there are four different resolutions of each stock default skin: Skin1o.tgb (default 1024x1024), Skin1o.tga (512x512), Skin1p.t (128x128) and Skin1q.tga (16x16).

These are called texture LOD's, just like 3D models have levels of detail that vary based on distance, the texture chosen by the game is determined based on what distance you are at.

The problem with this kind of texture arrangement is that there is a substantial gap between Skin1o.tga and Skin1p.tga - it skips one step entirely (256x256 resolution). With aircraft this is not such a big problem, but I hypothesize (and I should stress I have no idea if I'm actually correct) that the game does the same thing to terrain textures: It opens the texture, creates MIP map LOD's of it at fixed resolutions, and then it determines which texture resolution it should use for each terrain tile.

Unfortunately, it seems that just like the default skins, there is a sizeable gap in this LOD system - it is apparent that at a certain distance, the texture quality (resolution) drops significantly and abruptly.

This is further compounded by the fact that the texture selection is only affected by distance, rather than dynamic things such as field of view. If you look at distant texture with high field of view, the object will have small diameter on the screen and small MIP map doesn't look out of place at all. However, when you zoom in, that object or part of terrain will increase in size on screen, which should technically increase the resolution of selected MIP map. This process of determining which MIP map to use is called LOD Bias, and it can be either dynamic or static. Dynamic LOD Bias determines the required MIP map level of detail based on the apparent size of object as it appears on the screen, based on distance and field of view. Static LOD Bias is a fixed function of distance, and field of view has no effect on it; unfortunately it seems IL-2 has this kind of system, most likely for performance constrictions way back when the engine was coded.

So the problem with MIP maps is the apparent gap in the LOD chain, which causes the texture resolution to abruptly change for worse at certain distance, and the LOD bias system which does not take field of view changes into account in any way.


The problem with viewing flat surfaces at an angle is solved by the second technique I linked: Anisotropic filtering. Basically what it means is that the texture filtering changes as the angle changes. This actually works reasonably well in IL-2 (you can best see this by looking at the runway ahead of you - with low texture filtering settings the runway gets blurry and smudgy at quite close distance while with higher settings it remains quite clear at further distance).

I believe the reason for terrain textures being blurry at an angle is simply caused by the distance being longer at higher angle, which causes the MIP mapping algorithm to revert to low resolution LOD, and anisotropic filtering system is stuck with a too low resolution texture to begin with.


Distant mountains and hills also look very blurry to me. Also, when you go high enough, even the flat terrain below you will get blurry. The transitioning distance is approximately 10-12 km; the texture change from "sharp" to "blurry pixellated mess" happens gradually over distance of about 2 km. Observe:

Very high altitude, terrain is blurry everywhere (even right below):
 

Here you can see an airfield. The airfield textures have, apparently, proper MIP map LOD and you can still see details in the runway and parking area surface, even though it's obviously tiled you can tell it has some definition - it isn't blurred beyond recognition.

 

Coming down, at somewhere between 11000 and 12000 metres, you start seeing some definition of the higher resolution texture, which seems overlayed with the blurry low-resolution terrain texture:

 

At around 10 km, the terrain immediately below you has gained substantially more detail.

 

And as you descend below 10000 metres mark, the terrain looks pretty much ok.

 


However, any part of the terrain that is beyond the 10 km mark will start to get blurry, regardless of the original texture resolution. Here I'm flying at about 3000 metres, which means the terrain will start to get blurry at about 17 degrees below horizon - or, at about 9500 metres land distance, it's a simple trigonometric exercise:



And the same approximate area, but zoomed in (which makes the low resolution MIP map look even more gnarly):





Now, to be fair toward Maddox Games: This game was developed more than ten years ago and at the time, there were a lot of hardware constraints that required numerous walk-arounds which, by today's standards, have become nuisances at best and antiquated frankenstein monsters of coding at worst.

I also have a feeling that this blurring that can be observed may actually be a rudimentary (VERY rudimentary!) way of producing atmospheric blurring effect at a distance. The reason that makes me suspect this is the way the blurry texture and sharp texture blend into each other over a reasonably long 2 km distance. At the time of the game's release, the screen resolutions were about half what they are now - if I recall right, for the longest time IL-2 officially supported only up to 1024x768 resolution. Today, almost everyone is playing at something like 1600x1200, 1680x1050, 1920x1080 or even multi-monitor setups. This all exposes the old solutions much worse than when the game runs at a resolution it was developed for.

If that is a case, this is not really a bug or a case of badly implemented MIP mapping, but instead it may be a planned feature, even if it doesn't work very well at modern resolutions.

That said, it would be good to find what part of the game does this blurring exercise, and possibly reduce the effect or remove it altogether, and perhaps figure out some other way of implementing atmospheric blur instead. However, with not having access to source code, I'm always skeptical about the probabilities of someone fixing it... that way I'm always happily surprised when people do the seemingly impossible.
Logged

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23994
  • Taking a timeout
    • STFU
Re: High Resolution / True Color Textures Mod
« Reply #518 on: March 10, 2013, 11:15:32 AM »

Thanks for your report Herra.
Most likely fixing what you have reported would require changes deep inside native code of IL-2, I'm afraid that it's currently out of reach for us.

Anyway...

Carsmaster provided a new set of DLLs which greatly enhance FPS and game compatibility.
This makes the first real public release version which can be found in the "Visuals" section now.

Please proceed in the new v1.0 Thread, this thread will be closed now.
High Resolution / True Color Textures Mod Release Thread

Thanks and best regards - Mike
Logged
Don't split your mentality without thinking twice.
Pages: 1 ... 41 42 43 [44]   Go Up
 

Page created in 0.042 seconds with 27 queries.