![]() |
RE: Mipmapping and Optimising Textures |
Post Reply ![]() |
Author | ||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() Posted: November-08-2015 at 10:51am |
|
That was a very interesting read. Since I am in the process of reinstalling windows 7 from scratch and running Prepar3D v3 only on that system following nicks bible, I have decided to check the textures of all simobject and scenery addons after I have installed them. I am only at the point that I have installed the PMDG NGX and 777 and using Image tool from the SDK I discovered that many (it would appear to be most) of the NGX textures return the message "Failed to load the image" when dragged into image tool.
Maybe its not the ideal aircraft to start messing around with with this stuff but I made the suggested backups so what can go wrong. The fact that Image tool reject the textures from PMDG surprised me. I cannot think of a reason why I should not optimize them as per the Mipmapping and Optimising Textures guide? EDIT: .dds textures that image tool cannot open need to be opened with Photoshop and converted to 32bit .bmp files. Once they are converted they can be converted back to .dds files with the image tool. Is this the first step in dealing with textures that the image tool simply wont open? |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
Toby, if he is around will need to ring in here and I am not home at present, however most likely the files are in a format that need to be converted first
If they are DDS they must be converted first. |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks Nick, I see that the file that i converted so that it could be opened by image tool
now has the format "32 Bit alpha". I think I saved it wrong in photoshop. Anyway I will continue to study the guide until I get the hang of it. Just one question for anyone familiar with photoshop. In the Nvidia DDS read properties dialogue box I inadvertently unchecked the "Show this Dialogue" check box before clicking OK. Now when I drag a DDS file into photoshop it does not appear. Anyone know how to get it to appear again? I looked through all the menus but it was not referenced in the only place I could find "Nvidia". ![]() |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
http://www.patb.com/?p=23yea, that one can be a bugger.. We all do that at one point. I did it about 10 years ago see the link above and restore it
|
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks again Nick that did the trick.
If you didn't already have the link you are a wizard at the search engine. I tried several different searches for a solution and found nothing :-) Anyway the dialogue box is back. Time to wreak havoc with the NGX VC! So far all I have accomplished is turning a 2,049KB file into a 16,385KB file LOL! I guess its a steep learning curve for a dummy! :-) |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
I have the link saved from years ago in case I ever did it again and forgot how to recover it If you do it right, the final recompressed file size will be much smaller (EDIT: with the exception of one circumstance, see my post further down in the thread) If you are dealing with 2048-4096 textures and you recompile them to 1024 they CANT be larger in the recompile if you do it right. As long as you save the originals you cant do any damage. Practice with a separate set of files. You will get the hang of it even if it may take some time. Just remember if the original graphic size is LESS than 1024 you need to leave it alone unless the original format is 32/24bit with no mip maps. If its 32bit and under1024 with no mips, just add mips to the original and recompile to DXT, done. We have been doing that since FS8 and its one of the reasons people like myself don't see the same stutters, crashes, OOMs and frame drops everyone else does. Hell, that all goes back to Steve Lacey and the original Aces team who directed a lot of friends in the background as to in how to get around the 3rd party nutcase developers who didn't (and many still don't) know their ass from a hole in the ground when it came to the sim and performance. Those texture resolutions are NOT necessary.. what is necessary is someone who knows WTF they are doing with graphics. These scenery and aircraft developers who make so called 'HQ' or 'HD' texture products are all -ducked- in the head but its used to sell and they don't care As a side note, believe it or not, Aces never thought developers would be stupid enough to try and force anything above 1024 in DDS, DXT format and certainly nothing in 24/32bit over DXT/DDS. People have been buying into that crap for years and believe its something high-tech and high quality. It may look great for marketing and the professionals they hire to do videos for their product advertisement may make it look great by fudging everything with video tricks (they get paid to do that!), but in real use it never performs like it does in the marketing videos and if the files are converted/reduced and properly cleaned the image quality difference is hardly noticeable if at all. real shame people haven't figured out just how snookered they have been for years by that BS Its not just planes and airports.. Many environment addons that do clouds/water, etc are just as bad and sell that crap like its something special and worth the money LOL |
||
![]() |
||
acko52 ![]() Senior Member ![]() Joined: November-09-2010 Location: australia Points: 103 |
![]() ![]() ![]() ![]() ![]() |
|
Ducked if i know Nick, these ducked in the head devs need a good ducking in the you know what!!!
|
||
new to fsx & computers have flown a few a/craft but not a pilot Intel I7 2670QM (2.2/3.1 GHZ 1333 MHZ FSB 6MB L3 cache) HM65 chipset W7 hp 64 bit *GB mem DDR 3 ( 4GB + 4GB ) 1333 MHZ Nvidia ge 540m 2G
|
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
Naaaa.. people have to make ends meet and put food on the table and many of them actually believe the silly nonsense that they produce is legitimate and really works in the ESP render engine well since all they do is look at simple flights with nothing else running and go: OOhhhhhh people will buy this.
That includes plane$, $cenery, airport$, cloud$, water.. you name it It all dates back to 2002 and continue$ to this day.. It has gone on long enough from the days of FS2K, FS8, FS9 to FSX, FSXSE and right into Prepar3D I am the Raymond Reddington to the F$ addon world with what I posted in the Bible and every developer who practices that type of graphic productions wor$t nightmare. Most of them hoped people would read what I posted and not understand what I said and/or just blow it off as a disgruntled old coot.. LOL THE BLACKLIST Flightsim Developer HD Texture Artist (N0.1) I did what Steve Lacey could not do in 2005 with the gag order (AKA non disclosure) from MS as he moved to Google and I am glad Toby came forward and posted the process so everyone can have access to the information. R.I.P. Steve |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
This is awesome.
My first project is going to be the VC of a well known 737. My P3D V3 install is still very clean. I an at the install addons stage of the bible, so quite a bit to do. is it better to optimize addon textures as I install them or install all the addons, complete the steps in the bible and then optimize the addons? Or does it matter? |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
You can install any way you like and experiment after.
|
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
So having reviewed the guide again it is getting clearer. However, I am still a little confused as to how to proceed if ImageTool just cant open the texture in the first place.
It seems to me that the first order of business is to then fix the files so that Image tool can open them. I did this simply by opening one with photoshop and then save as. When the Nvidia tool appeared I selected DTX1 based on looking at the alpha channel and only seeing black and white. It crossed my mind that just because I cannot see an grey there it doesn't mean there isn't any. If there was I should have saved it as a DTX5. Assuming I did everything right the only thing that I did with the file is recompress and resave it with the exact same setting and now it can be opened with image tool and I can therefore apply the rest of the guide to it. My only though is once the file is opened in photoshop is there a tab in there that will show whether the file is a DTX1 or a DTX5 file? That way I would not have to really on my eyesight to determine if there is any grey in the alpha channel. But that's assuming the texture was saved correctly in the first place. I made a short video of what I did. Maybe some can confirm that I did this right: https://drive.google.com/file/d/0B4aX5Q3-OT6kdnlWejhVVlZFNFk/view?usp=sharing |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
If image tool wont open a file then its not a DXT1-3-5-32bit, etc and most likely a DDS which is not supported by image tool
It reads to me at first glance you got everything else down but PS doesn't support DXT and will not open the file until it is converted from DXT first in image too. If PS opens a file with the DDS box then its DDS. If it opens a file directly and displays the graphic without any DDS box then its NOT DXT and is probably 32/24 bit BMP which should be DXT and isn't |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
you will get this message if you try to open any DXT compressed file in photoshop:
|
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
That is without the Nvidia plugin, right? |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
DXT has to be converted first in image tool if it above 1024 in size. Image tool will display the size of the graphic in the readout. If there is a alpha channel image tool will display that too and if the file is DXT5 it must be resaved to preserve the alpha as Toby's outline explains. DDS with the PS tool is a bit easier Its not a easy job to fix this crap. That's why unless I really want the addon I wont waste my time screwing with another developers nonsense. If I really want the addon I will spend the time to fix it if it wasn't made right. Even with a good understanding of all this you can spend all day fixing one addon airport or plane if the addon comes with a lot of graphics since you must check every single graphic file to be sure its not over 1024 or not compressed with mip maps ... or its a waste of time to do it 1/2 arse and skip. Do note that night textures do not need to be mip mapped but they do need to be resized if too large or if they are 32/24bit converted to DXT |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
correct Go to <FSX or P3D>\Scenery\World\texture and select a file.. lets say 005B2SU1.BMP its a DXT1 1024x1024 file with no alpha copy that to the desktop, (you don't have to but lets be safe) then open PS and try to open that file... you will get the error message above. Lets say you want to edit that file as in add graphic content or sharpen, blur, remove a road, etc, etc... That file must be opened in Image tool first, convert to 32bit, extract the mip maps and then the 005B2SU1_0 file is save (the original size file and discard the mip-maps) and saved as 32bit for editing Once edited in PS it is resaved as a BMP, then opened in image tool, converted back to DXT1 and mip maps added back, then resaved as the same file name since that file I posted is DXT1 there is no alpha so direct conversion to 32bit BMP and back is fine If that file happened to be a DXT5 with a alpha channel you must convert to 32bit and then extract the 005B2SU1_0 file and save it as a TGA or TAGRA so the alpha channel is preserved. You can then open that file in PS and edit/resize and resave a .tga from PS, then use Image tool to add the mip-maps back in and convert it to DXT5 and save as BMP again Its not an easy process and there is NO SUCH THING as a batch tool that does all this There COULD be a batch tool to do things like convert and add mip-maps automatically if the person making the batch file knows every single file name that needs to be converted, but unless someone MAKES such a list for EACH version of EACH addon and posts that batch file, you must do all this manually one file at a time. Toby made a batch file for Ultimate Traffic 2 many years ago and that automates all this into two clicks and go have a beer, with thousands of AI aircraft graphic files. |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
On thing about file sizes.. there can be a situation where a file after its converted/mipped/resaved can be larger than the original
In this scenario the overall file 'size' is not an issue, its the fact that the original did not have mip maps and adding them to a graphic that never had them could increase the file size assuming the original file was 1024 DDS/DXT and just missing the mip-maps REASON: If you have been looking at the process you will see mip-maps are a series of duplicate images that get smaller and smaller in size with a descending order as shown in image tool. The sim reads the mip layer based on the distance from the camera, in other words, it doesn't load every graphic in that file or the larger resolution when your eye is further from the image... it reads and displays the graphic size based on how far away the view point is from the object. STUTTERS and FRAME LOSS can be caused by LACK of Mip-Maps because with a graphic that is not mipped the sim is loading the LARGE graphic even from miles away and if you multiply that by 100's of graphics.. whoa Nellie !! If a graphic is already 1024 and in the correct DXT1-3-5 or DDS format to begin with, which is fine, but the graphic contains NO mip maps, then adding them as you should and resaving in the original correct format can create a larger final file size... but understand that FILE SIZE in that case is A-OK and is what you want. File SIZE is not the key, correct file CONTENT and FORMAT is the key Some developers believe mip-maps reduce image quality and do not put them into their graphics.. (there's yer sign) all they are doing is reducing your performance and making your life miserable by lowering scenery settings or going on a tweak fest to compensate for their poor graphic practices. Many are lazy or just plain ignorant. Some know exactly what they are doing and refuse to do them right with the excuse it kills image quality, horse hocky Mip maps are your best friend in Flight Sim. Quality comes in the graphic itself and the graphic professional who knows how to make quality graphics that take into account mip's (as Toby showed how to clean them up) |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
Its a step learning curve but I am putting the pieces together :-)
Id it safe to assume that the Textures in the vanilla sim are formatted correctly? i.e. only textures in 3PD addons will benefit from this treatment? Yes I have already come across textures in the addon I am working on where the file got larger because there where no mipmaps in the orignal. I can already anticipate at least a couple of large airport addons that will benefit from mipmaps if they don't already have them. |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
There are a few default textures that can use a tweak, and in that I am talking about a low number that you may never even see in the sim depending on where you fly, but the majority are all in correct format so no need to look at those, just addons
The worse offenders for performance in default are not textures but city models/airport terminals and the shipping cranes/bridges that display at sea ports but there is no way to change those without a major model project. A lot of perf gets sucked away by those objects. You mostly see that if you enable SGSS and fly past a airport or larger city with ports. The combination of the models and the transparency super sample of the visual parts really hits performance in any version of FS/P3D. The best course of action is to try and minimize the impact by making sure the 3rd party graphics are made correctly and in many cases after doing so SGSS is no longer need.. there can still be circumstances depending on how things are drawn where nothing will fix it other than SGSS, some bridges, radio towers in the distance for example.. those cant be fixed with texture changes Any airport textures that has no mip maps is a stutter fest waiting to happen on arrival They usually shimmer in the distance too which is corrected with mip maps removing the need for SSGS. A lot of distance shimmers are caused by huge graphics w/o mips or even 1024 graphics with no mip maps |
||
![]() |
||
AnkH ![]() Intermediate Group ![]() Joined: July-05-2013 Points: 96 |
![]() ![]() ![]() ![]() ![]() |
|
In my case, I use the "Texture Optimizer Tool" from Skyrim Nexus LINK REMOVED BECAUSE ITS A DANGEROUS TOOL AND I DONT WANT PEOPLE BLINDLY DAMAGING THEIR FLIGHT SIM INSTALLS to batch convert my FSX textures and bringing them down from those silly HD formats to 1024x1024 textures and adds mipmaps, where there are none. I do honestly not know if this tool is the way to go, but so far it did not destroy anything on my build (and it automatically makes backups of the original texture files, so if something goes wrong, you can easily restore the original textures and try a different approach). The batch conversion capabilities is the thing that I like most, before I was manually converting textures one by another which basically kills you, if you want to do it with all installed addon sceneries, planes and AI traffic.
With this little tool, I now batch converted all my addon scenery textures, plane textures and AI traffic textures in a very short time. Funny fact about those HD textures: I often see peoples FSX.cfg running with TEXTURE_MAX_LOAD=1024, still they use 2048x2048 or even 4096x4096 textures and wondering about OOM and bad performance. Well... |
||
--------------------------------
Chris |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
no, it cant and wont fix the addons for flight sim without a direct list file Its made and designed for games, not FS addons and it would never identify the difference between DXT1, DXT3 and DXT5, or DDS with missing elements in specific product addons
|
||
![]() |
||
AnkH ![]() Intermediate Group ![]() Joined: July-05-2013 Points: 96 |
![]() ![]() ![]() ![]() ![]() |
|
Ok, that is good to know. So what the tool in the end does for FSX based textures is nothing more than resizing the textures? Glad that you pointed that one out, but at least it is a start if the textures are no longer 4096 or 2048 but 1024.
|
||
--------------------------------
Chris |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
I spent a good part of my day off yesterday working on converting and optimizing the Textures of the 737-800. There where 3 files involve with about 150 textures all together. Most of the textures would not even open in Image tool so determining initially which textures needed to be optimized was difficult. What I did was open them in PS first and see where they had alpha channels or not and it they where b&w of greyscale and see what size they where.
I ended up going through a lot of them and if I could take anything away from the exercise it was that it seemed to me that a lot of them where improperly compressed i.e. textures with no alpha channel saved as DTX5. I became quite frustrated with the whole exercise and I am sure I was probably not doing everything exactly right so I gave and deleted the file I was working on. I should have copied it into the SIM first to see what it looked like. The hardest part of following the guide is what to so with textures that don't open in image. It appears that is the first step in determining what you are dealing with. And if I am understanding this correctly PS changes something when it opens the files. |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
If a file wont open in image tool its probably a DDS file but there can be a few others.
What was the file extension for these graphic files that would not open in IT? Typically any DDS graphic will have a .dds file extension in the name As long as you don't 'save' anything that opens in Photoshop it wont change a file that is opened. Any file that opens in PS with the Nvidia DDS plugin is in .DDS format You are correct, one must define the type of graphic file be it .bmp which can be a 8 bit,24bit, 32bit or DXT1-3-5 compressed with the .bmp extension. Or a DDS file With aircraft in Flight sim X there can be a file for bump and specular which is in DDS format with a alpha channel. Its a graphic with a similar file name to a matching graphic, usually named together in a texture folder, that produces the light reflections of the metal skin of a plane, building, or vehicle
|
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
That tool comes with a specific script that is designed for each game the person who made it created so it skips certain graphics, avoids certain directories in each game title and overrides the GUI settings made by a user if certain conditions are met for the game title because the developer knew the tool could trash certain files if it was run on them blindly. Such a tool can actually damage flight sim graphics files because its not made for Flight sim based on the FS-SDK with a script like the script that was included with the tool for the games he listed it was made for. The tool has no idea what the hell it is doing except for the games it was made to be run on.. OR the user knows exactly what they are doing in the GUI before the tool is run. We don't batch run such a tool on a entire FS install. The only way a tool like that might be run is with a user who knows exactly what they are doing by separating the graphics into categories in separate directories first then such a tool 'could be' run on each separate directory with settings in the GUI that may vary for the files specific needs. and even if that were done, such a tool does not properly clean the graphics up so the resize and reconfigure of the files does not effect the image itself Without a batch list that defines each graphic being accessed by that tool, its compression and its specific layer content and the commands to properly preserve and resize for the individual file... no batch tool can generically open, resize and then preserve elements of a graphic file specific individual content and get it right for every file it comes across. That tool makes generic assumptions that may not be right for every file The tool cant 'think' it does what its told to do from a built in script. if the tool was 'smart' and knew what it was doing without input,... it wouldn't need settings I would never run anything like that on a FS install Such tools can be and are very dangerous unless the user knows exactly what they are doing with that tool and all the graphics the tool touches I would avoid such tools like the plague and never run something like that on a FS install directory |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
All the files that I opened had the .dds extension and where all DTX1, 3 or 5. Why they wouldn't open in image tool I don't know. I think I will leave it alone until I get some scenery addons in the sim. I can think of a couple of airports that I might try this out on, but I will leave the NGX alone. It seems to be pretty smooth at as low as 20 fps anyway. Thanks for the help again.
|
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
DDS may not always open in image tool. Image tool does not support all DDS files. When they wont open in image tool then they must be opened using the Nvidia Photoshop DDS tool which is what Toby outlined, or, can be converted/flipped using a old tool called DDS Converter and once edited, converted back
Toby's outline method is more streamlined Some DDS files will open in image tool but usually the more advanced aircraft graphic files wont. But, If it aint broke, don't fix it Downsizing and converting is best done when all addons are fixed, but you can just deal with some and leave others alone. Airports have been designed so bad over the years they are usually a higher priority to fix over a plane, but any addon that runs textures higher than 1024 and with no mip maps is designed by a graphics pin head ![]() |
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
What happened to the guide?
Its gone from the top of Hardware, Software, and Computer Technology |
||
![]() |
||
NickN ![]() Certified Professional ![]() Joined: November-21-2007 Points: 21104 |
![]() ![]() ![]() ![]() ![]() |
|
I don't know how it got moved, its back at the top of the forum
|
||
![]() |
||
Avidean ![]() Senior Member ![]() Joined: February-04-2012 Points: 1349 |
![]() ![]() ![]() ![]() ![]() |
|
thanks :-)
|
||
![]() |
||
jhaley101 ![]() Senior Member ![]() Joined: June-09-2007 Location: Canada Points: 232 |
![]() ![]() ![]() ![]() ![]() |
|
The .pdf link doesn't work anymore
|
||
![]() |
Post Reply ![]() |
|
Tweet |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |