Switching default texture format to DDS
The FG development team is considering to switch the default format for textures from png to DDS. This would offer a number of significant advantages:
- DDS is a more compact format than png, hence the download size of the FG base package may be decreased
- Compressed DDS can be directly used by many graphics cards, reducing also GPU memory consumption
- DDS stores all texture resolution levels, in essence no lower resolution levels have to be generated when the texture is used, hence it loads much faster into memory
- The resolution levels ('mipmaps') can be customized, allowing for some interesting effects at no performance cost
Practically all commercial simulations use DDS for these reasons.
Feedback needed - should FlightGear switch the defaults to DDS format for terrain texturing?
However, the DDS compression algorithm is patented, which means that it is not readily available for open source graphics drivers used by Linux distributions. Dependent on the specific hardware, this may or may not be a problem (modern graphics cards typically do not need the driver to process DDS, for older graphics cards there are non-patented workarounds available which decompress the DDS on the software level). The development team is concerned about making the FlightGear experience pleasant for all users, hence we would like to gather feedback how many users would be affected by a change in practice.
let's collect some some feedback [on DDS usage in FlightGear] until late November and restart this topic. We probably know by then what we do for the next release. "Somebody" needs to collect the feedback, however.
— Torsten Dreyer (2014-09-03). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
If there are no problems reported, FG will change defaults to textures in DDS format with the 3.4 release, and then phase out the use of png textures. In other words, a lack of feedback from end users might very well mean that future FlightGear versions may require DDS support and may not necessarily work for people with outdated hardware - so if you care about backward compatibility, please do get involved, test DDS support and provide feedback!
What we need you to do?
FlightGear already provides the simple option to test a DDS texture set. If you are running on Linux and use an open source graphics driver, please take 5 minutes to help during your next FG session:
- Open the dialog under View -> Rendering
- Under 'Terrain texture scheme', change the default 'Region-specific' to 'Global alternative (DDS format)'
- Press 'Okay' - FG will reload the terrain
- Do you see proper textures on the terrain (they may look different and may also not fit the location perfectly)? If yes, you're fine. If you see monochromatic, or even bright/pink, colors or other rendering artifacts, your system may have problems with DDS.
- Change back to the texture scheme you like best
- Enter your experiences in the list below
Thanks for your help!
Tested hardware and graphics drivers
NVIDIA proprietary driver
Card | Driver | DDS ok | Reported by |
---|---|---|---|
GeForce GTX 670M | 310.19 | Yes | ThorstenR |
N13M-NS Optimus | 340.32 | Yes | Tom_ch |
GeForce GT 520M | 344.75 | Yes | EliasTarasov |
GeForce GT 640 | 343.13 | Yes | lumni1968 |
GeForce GTX 780 Ti | 340.52 | Yes | Avionyx |
GeForce GT 750M | 331.38 | Yes | Dutchguy |
GeForce GT 620 OEM | 331.38 | Yes | C-GGKV |
GeForce GTX 650 | 331.20 | Yes | dany93 |
GeForce 210 | 304.117 | Yes | Jean-Philippe |
GeForce GT 520 | 332.21 | Yes | cossack90 |
GeForce GTX 260 | 304.117 | Yes | Lann |
GeForce GTS 250 | 331.38 | Yes | Madbyte |
GeForce GTS 450 | 340.32 | Yes | chris_blues |
GeForce 8600 GT | 340.32 | Yes | szpajder |
GeForce GTX 460 SE | 331.38 | Yes | f-jjth |
GeForce GTX 560 Ti | 319.32 | Yes | PATTEN |
GeForce 8600 GT | 331.38 | Yes | attila |
GeForce GTX 750 ti | 340.32 | Yes | f-toro |
GeForce GT 650M | Apple OS 10.9.4 | No | dersh |
GeForce 9800GTX | 304.117 | Yes | ctec356 |
GeForce GT 220 | 331.38 | Yes | D-ABEK |
GeForce GTX 760M | 331.38 | Yes | f-ojac |
GeForce GTX 560 | 319.32 | Yes | Clm76 |
Quadro FX 770M | 304.88 | Yes | OO ZVY |
GTX 660 Ti | 340.46 | Yes | JS |
NVIDIA open source driver (Nouveau)
Card | Driver | DDS ok | Reported by |
---|---|---|---|
GeForce GT 630 | No | Jakub Klawiter | |
GeForce GT 220 | No | D-ABEK | |
GeForce GTX460 | No | User:T3r |
Intel proprietary driver
Card | Driver | libtxc_dxtn installed? | DDS ok | OS | Reported by |
---|---|---|---|---|---|
Intel HD Graphics 5000 | N/A | N/A | No | Mac OS X 10.9.5 | Csantz |
Intel open source driver
Card | Driver | libtxc_dxtn installed? | DDS ok | Reported by |
---|---|---|---|---|
HD Graphics 3000 (i7-2600K) | 10.2.6 | N/A | Yes | cdesai |
HD Graphics 3000 (i3-2330M) | 10.2.2 | N/A | Yes | Flyhigh/saiarcot895 |
HD Graphics Sandy Bridge (Pentium B980) | 10.1.0 | No | Yes | f-jjth |
HD Graphics 4000 Ivy Bridge | 10.3.0 | No | Yes | onox |
HD Graphics 4000 (Ivy Bridge) | 8.15.10.2712 | No | Yes | Red Leader |
ATI/AMD proprietary driver
Card | Driver | DDS ok | Reported by |
---|---|---|---|
ATI Radeon HD 6310 | 14.6-1 | Yes | ZLSA |
AMD Radeon R9 200 Series | 14.4 | Yes | Richi |
Radeon HD 4850/4870 | legacy 8.97.100.7-4 | Yes | Jano |
ATI Mobility Radeon HD 4570 | 8.631 | Yes | Yury 4500 |
ATI/AMD open source driver
Card | Driver | libtxc_dxtn installed? | DDS ok | Reported by |
---|---|---|---|---|
AMD Radeon HD 6570 | 10.1.3 | Yes | Yes | fgjosh |
AMD Radeon HD 6770 | 10.2.5 | No | No | Mongrol |
AMD Radeon HD 7950 | 10.2.1 | Yes | Yes | Saga |
AMD Radeon R9 270X | 10.3~git20140805 | No | No | nine |
AMD Radeon R9 270X | 10.3~git20140805 | Yes | Yes | nine |
AMD Radeon HD 4850 | ?? (debian sid) | Yes | Yes | jano |
Sample test
DDS Test at the airport of Orio (Bergamo - Italy)
The final result, with all the "Shader Options" active, is not very satisfactory, I would say very poor. Apparently not check on any improvement in the speed of image loading. I think on modern machines with quad-core processors 16 GB, with latest graphics cards (NVIDIA 870) 6 GB, the loading of these images is not really a "bottleneck". I propose to insert the DDS functionality, but in a transparent way, ie convert "on the fly" the images before inserting them into the temporary memory, for example using the convert function of ImageMagick. However, I do not know if it really is a useful feature, I think there are many other things to do before this.
These are the parameters used by the startup script "run_fgrun.sh":
Note To reproduce this test, you can use the following Fgfsrc file - you should set up $FG_ROOT and $FG_SCENERY specifically for your own system though. |
--airport=LIME
--aircraft=757-200-PW2040
--disable-random-objects
--enable-horizon-effect
--enable-enhanced-lighting
--enable-distance-attenuation
--enable-ai-models
--disable-ai-traffic
--disable-real-weather-fetch
--enable-clouds3d
--bpp=32
--texture-filtering=16
--prop:/sim/rendering/multi-sample-buffers=1
--prop:/sim/rendering/multi-samples=4
--timeofday=noon
--enable-terrasync
--httpd=5500
--props=5501
--jpg-httpd=5502
--multiplay=out,10,,0
--multiplay=in,10,,0
--disable-fgcom
Excerpts from the ongoing discussion
Here is my suggestion how to proceed:
Does that sound reasonable for everybody? — Torsten Dreyer (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Misc
I'd propose [...] this process:
I think we have an information management problem in relation to the user base - a frequent forum situation is that a user requests something that's already there, but the information is just not out. So if we even envision such a change, I would start spreading the relevant information basically yesterday. — Renk Thorsten (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
DDS Debate in 2012
Legalities
These kind of precompressed images limits their usage to a specific set of drivers. And no, due to the patent issues no open source code including ours — Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
t is technically incorrect to provide these s3 patent precompressed textures to a driver that does not announce the apropriate — Mathias Fröhlich (2012-01-01). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
Portability Concerns
These kind of precompressed images limits their usage to a specific set of drivers. And no, due to the patent issues no open source code including ours — Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
And this is what I try to do now: Object against using these patented compression algorithms. — Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
It's not limited to dds. If you use osgconv xxx.dds xxx.ivs you will probably have the same effect. So I think simply ommitting DDS is ok? — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
I would like to have a flightgear that is by default just running on every average system. Having this run faster on a special configured system with some — Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
this is the reason for the message. If your machine would refuse to display this you, developing that, would probably just say 'nice try, but it does not work' — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
Seriously, I think plenty people not being on this list today and probably never will be in touch with anybody here, will run into this issue. — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
Seriously, I think plenty people not being on this list today and probably never will be in touch with anybody here, will run into this issue. — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
Your driver will display this fine. So, in the end I do not care if it is 'your particular video driver' that does — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
Approaches
Well, the default f16 does not work anymore for example. I have also never tried the new textures, but I assume that these also contain — Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
Hmm, regarding dds. I have to say, that not all OpenGL drivers support texture compression, and — Mathias Fröhlich (2011-12-27). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
Well, I hope that we can get rid of the compression. Can somebody with the apropriate tools convert the compressed textures to non — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
I can see several approaches:
probably do the job of avoiding the hangs (hopefully? to be checked?). May be
in the database loader thread. This would help all textures not only the ones
could be handled or not. On loading an image in case of available compression — Mathias Fröhlich (2011-12-30). [Flightgear-devel] DDS texures (Was: Improving random trees &
buildings).
(powered by Instant-Cquotes) |
Next step is to make sure that compression is not required to avoid the hangs. My favorite bet would be that then the new configure option regarding texture — Mathias Fröhlich (2011-12-30). [Flightgear-devel] DDS texures (Was: Improving random trees &
buildings).
(powered by Instant-Cquotes) |
Precomputed mipmaps
Could we do dds files without compression but with precomputed mipmaps?
— Mathias Fröhlich (2011-12-29). Re: [Flightgear-devel] Improving random trees & buildings.
(powered by Instant-Cquotes) |
The 4. Method that I can imagine is to precompute the mipmaps in the loader. IIRC tests with some of the guys suffering from this problem, providing — Mathias Fröhlich (2012-07-21). Re: [Flightgear-devel] DDS usage in effects files.
(powered by Instant-Cquotes) |
I think then, computing mipmaps for any texture file on the CPU in the loader thread should globally improove the situation. — Mathias Fröhlich (2012-01-01). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
Doing that differently will provide some overhead that could be kept at a minimum I think: — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
On unix I usually get the gzip plugin installed by osg (osgdb_gz.so). Is this also the case for the default win32 case? Is there a osgdb_gz.dll or something — Mathias Fröhlich (2012-01-15). Re: [Flightgear-devel] DDS texures (Was: Improving random trees &.
(powered by Instant-Cquotes) |
What about solution 6 with (uncompressed premipmapped dds).gz? On linux this should work as long as you have zlib installed which could be — Mathias Fröhlich (2012-07-21). Re: [Flightgear-devel] DDS usage in effects files.
(powered by Instant-Cquotes) |
I implemented a mipmap control and generation tool in effects when I last updated the urban shader. For the moment, it relies on hardware when the average operator — Frederic Bouvier (2011-12-30). Re: [Flightgear-devel] DDS texures (Was: Improving random trees
& buildings).
(powered by Instant-Cquotes) |
Implementation
As has been previously pointed out, the current DDS texture set is not simply the global png texture set converted. — Stuart Buchanan (2014-09-04). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
2) If we go down this path, we probably want to separate the underlying texture format from the materials.xml definition entirely. For example, we — Stuart Buchanan (2014-09-04). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
That does leave the issue of what happens to the existing dds texture definitions where there are special mipmap layers. I'd suggest that we — Stuart Buchanan (2014-09-04). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
3) We need a sensible process for dealing with aircraft, which has been identified as a significant issue. Again, I think more aircraft developers — Stuart Buchanan (2014-09-04). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Challenges
"dds on an open source driver (radeon and intel) I was forced to use radeon at some time, and it was fun, the planes were pink :) once libtxc-dxtn installed, dds were loaded fine again, so it can be used on open source if you are ok to use the lib."
— Renk Thorsten (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Another potential option would be to convert regions to .dds but keep both global-png and global-dds, but making that user-friendly would — Rebecca Palmer (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |
On my system (Intel Ivybridge), DDS works with or without libtxc, but this may not be true of all Intel hardware. — Rebecca Palmer (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |
You can specify the dependency on libtxc_dxtn, but then distributions like openSUSE cannot ship FlightGear anymore. libtxc_dxtn implements S3 texture — Stefan Seifert (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |
Debian/Ubuntu's libtxc is libtxc-dxtn-s2tc, which claims to avoid the patent at a small cost in visual quality: — Rebecca Palmer (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |
The dds textures seem to have some advantages over our png textures and using them is tempting. — Torsten Dreyer (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
We currently have regions-png, global-png and global-dds; as I noted earlier, switching to regions-dds, global-png and global-dds has the — Rebecca Palmer (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Can we invert the logic in, say, preferences.xml so xxx-dds is enabled by default and switching to xxx-png has to be done in rendering options? — Torsten Dreyer (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Changing the default (which is in preferences.xml) is easy: the problem is how do users with non-.dds-supporting hardware (if this exists) know — Rebecca Palmer (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Conversion
Also see DDS texture conversion.
the script take the .dds and not convert the png again if both exist(I remember having manually used "compare" to check if both the dds and the png looks the same, and if not i changed some names)
— jean pellotier (2014-09-05). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
I think this is an inheritance from some other game engine using a different convention, and therefore from the authoring tools that were developed for such an engine (photoshop exporter plugins and the like). If indeed the FGFS DDS textures are only meant to be used in FGFS then this should be fixed at the conversion time. Otherwise, if we want other applications to easily reuse the FGFS textures then it would be better to stick to the most common convention. But I think we all agree that the source for any DDS texture should be kept, which pretty much precludes importing ready made DDS textures from 3rd party sources. Incidentally I think importing DDS artwork from other sources should be discouraged, since it will most likely run afoul of the licensing terms of the original copyright owner.
— TDO Brandano (2014-09-05). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Nothing as exotic. Just a different "origin" between OpenGL and Direct3D image conventions. OpenGL image origin is located in the lower-left corner, while Direct3D (hence DDS too) considers the top-left as the origin, resulting in a DDS image to appear vertically flipped when read in an OpenGL context. This has repercussions in the way normal-map decoded normals appear (hence the flag in the effects, which signals to the shader to flip the decoded normals). The rest is simply a matter of workflow: either use flipped coordinates and skewed/reversed conventions throughout your whole workflow, or just flip the image and (eventually) set a flag for the shader at "publish" time (said flag could be automatically set by the code on DDS texture load). (the latter seems more pragmatic/appealing)
Automatic conversion script is welcome indeed. Also I'm pretty sure that we have some people here ready to convert a PNG to DDS as soon as you say "Hey boys I created a new PNG file, can you convert this file for me please ?" :-)
— Clement de l'Hamaide (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |
A few world about the conversion: once a png/rgb/jpg found, the script try to guess the suitable dds format: with or without alpha channel, — jean (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Pros
I always got a loading problem with png textures, large textures take seconds to load and convert, and that ruin my close flight where you — jean (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
Cons
FG actually runs with dds textures, it just doesn't render anything reasonable, I believe you get monochromatic colors. But I don't expect the menu to be affected, it doesn't use textures.
— Renk Thorsten (2014-09-02). Re: [Flightgear-devel] .dds textures (was Unused and/or sourceless textures).
(powered by Instant-Cquotes) |
If it's relevant, I recall having S2TC compression problems when running Flightgear, and updating this package to a newer version manually (outside of the main repos) fixed the issue. I'm on an Intel HD 3000, but I'm guessing that Intel HD 4000 doesn't have this problem, since it seems to have better OpenGL and OpenCL support.
— Saikrishna Arcot (2014-09-02). Re: [Flightgear-devel] Download size,
and hardware support (was .dds textures).
(powered by Instant-Cquotes) |