• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS Converting MSFS DDS textures to PNG

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,866
Country
us-wisconsin
You can use Microsoft's texconv to convert MSFS DDS textures to PNG for use in your Blender or 3dsMax projects. I made a folder with texconv.exe and a batch file to convert files from the "input" to "output" folders. Copy the MSFS textures to "input", run the batch file, and find the PNG files in "output". Then double-click the ConvertTextures.bat
It converts the files, and then adjusts the file extension to .png or ,tif as needed.
MSFS_Convert.zip
 

Lagaffe

Resource contributor
Messages
851
Country
france
Thanks you very much for this stuff.
I already use texconv inside the FSW plugin but in some cases (texture folder dnot at the right place), it hangs. With this BAT, it is possible to solve theses bad cases.

Did you know if it is possible to do the opposite and to obtain useable textures under MSFS ?
I have some texture that fspackagetools cann't or doesn't convert in DDS and no explication in the ConsoleLog. I have modify your BAT in order to produce DDS: it run OK but the result is strange ...
Of course, I can test under MSFS but it will take several tests to find the right parameters so if you had a track this would be a plus

What I test: texconv.exe -r:keep input\*.png -o output -f:rgba -ft:dds
But we can use a lot of format:
<format>: R32G32B32A32_FLOAT R32G32B32A32_UINT R32G32B32A32_SINT
R32G32B32_FLOAT R32G32B32_UINT R32G32B32_SINT R16G16B16A16_FLOAT
R16G16B16A16_UNORM R16G16B16A16_UINT R16G16B16A16_SNORM
R16G16B16A16_SINT R32G32_FLOAT R32G32_UINT R32G32_SINT
R10G10B10A2_UNORM R10G10B10A2_UINT R11G11B10_FLOAT R8G8B8A8_UNORM
R8G8B8A8_UNORM_SRGB R8G8B8A8_UINT R8G8B8A8_SNORM R8G8B8A8_SINT
R16G16_FLOAT R16G16_UNORM R16G16_UINT R16G16_SNORM R16G16_SINT
R32_FLOAT R32_UINT R32_SINT R8G8_UNORM R8G8_UINT R8G8_SNORM
R8G8_SINT R16_FLOAT R16_UNORM R16_UINT R16_SNORM R16_SINT
R8_UNORM R8_UINT R8_SNORM R8_SINT A8_UNORM R9G9B9E5_SHAREDEXP
R8G8_B8G8_UNORM G8R8_G8B8_UNORM BC1_UNORM BC1_UNORM_SRGB BC2_UNORM
BC2_UNORM_SRGB BC3_UNORM BC3_UNORM_SRGB BC4_UNORM BC4_SNORM
BC5_UNORM BC5_SNORM B5G6R5_UNORM B5G5R5A1_UNORM B8G8R8A8_UNORM
B8G8R8X8_UNORM R10G10B10_XR_BIAS_A2_UNORM B8G8R8A8_UNORM_SRGB
B8G8R8X8_UNORM_SRGB BC6H_UF16 BC6H_SF16 BC7_UNORM BC7_UNORM_SRGB
AYUV Y410 Y416 YUY2 Y210 Y216 B4G4R4A4_UNORM
DXT1 DXT2 DXT3 DXT4 DXT5 RGBA BGRA FP16 FP32 BPTC
BPTC_FLOAT

I thought I read that the format was BC5 signed but this format don't be present in the texconv's help.
Ref: https://www.fsdeveloper.com/forum/threads/normal-map-introduces-excessive-gloss.457592

This post (https://forums.flightsimulator.com/t/resize-norm-dds-textures/563494) seems to indicate this infos:
ALBD - .DDS- BC1 (Linear, DXT1)
ALBD (Blurred) - .DDS- BC3 (Linear, DXT5)
NORM - .DDS- BC5 (Linear, Signed)
COMP & Decals - .DDS- BC7 (Linear, DX 11+)

PS: I have found a good link to have information about texconv : https://github.com/Microsoft/DirectXTex/wiki/Texconv
 
Last edited:

=rk=

Resource contributor
Messages
4,407
Country
us-washington
It is a better conversion than if we simply open a .png.dds in Photoshop and export the .png. However, when I run SIMPLEAIRCRAFT_COCKPIT_NORM.PNG.DDS through the process and then compare it to the original SimpleAircraft_COCKPIT_norm.png, this is what I get with the two images side by side, original on the left:

SimpleAircraft.png


The color mismatch is evidence of the FSPackagetool.exe texture compression. Normal textures map height through the range of color and since the relative color range appears to be about the same, the fidelity should be the same as the original. Obviously, if this difference were spread across a single model, the darker normal mapped polygons would appear farther away than the lighter. Repetitive cycles of building Package textures and then reconverting them would eventually result in normal textures shaded outside the visible range. Although Texconv is Microsoft software, the GitHub page does not directly address the MSFS compression algorithm, so it will be important to use the a lossless format when applying this technique.

It is recommended to use a lossless format at 16 bits per pixel, such as the 16 bpp *.PNG format. This is especially important for roughness, metal and/or occlusion maps, where Microsoft Flight Simulator remaps the data to a curve to have more precision in the dark areas before compressing (which is then remapped again later in the shader). [SDK]

Granted, most models from which we want to rip textures do not have .png versions with which to compare, or we'd just copy those instead. The evidence developers should make the comparison at all is in the External Asset Creation section of the SDK where it warns us about the algorithm.
As to doing something with the ripped textures, the real challenge for 3ds Max users is accessing the Asobo/Microsoft geometry. There are no community supported importers that I can find and the only commercial converter does not include the Asobo specific changes to the glTF format. What remains are the various paths through Blender into FBX and you should see what ends up in the workspace.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,866
Country
us-wisconsin
Hi Rick.
What the result is from the sim's dds compilation is the image on the right above. The sim's internal compiler drops the G channel and replaces it with medium gray. Texconv just gives correct channel it reads... in this case medium gray, and the PNG works fine in the sim.
Another thing is that we are used to DDS being flipped vertically. The MSFS compiler does not flip the PNG when making the DDS. It seems to just use DDS for compression.
 

Attachments

  • rhumbaflappy-airport-41wi-elkhorn.zip
    1.9 MB · Views: 41
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,866
Country
us-wisconsin
Hi Didier.
Maybe this to create compiled DDS?
Code:
texconv.exe -r:keep input\*alb*.png -o output -f:BC1_UNORM -ft:dds
texconv.exe -r:keep input\*comp*.png -o output -f:BC7_UNORM -ft:dds
texconv.exe -r:keep input\*nor*.png -o output -f:BC5_SNORM -ft:dds
pause
The names of the PNGs would need to contain alb, comp, or nor. It seems odd that the MSFS compiler would compile to 3 different formats.
 

Pyscen

Resource contributor
Messages
2,985
Country
us-texas
The Normal map needs to be in 16F (Floating) when in the PNG format. The channels in this case will be in the proper placement then.
 

=rk=

Resource contributor
Messages
4,407
Country
us-washington
The sim's internal compiler drops the G channel and replaces it with medium gray. Texconv just gives correct channel it reads... in this case medium gray, and the PNG works fine in the sim.
If you're saying this only happens on the first reconversion, that's fine if true, but with little to no opportunity to sample glTF flies, it's greatest utility is for Blender users.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,866
Country
us-wisconsin
Hi Didier.
Maybe this to create compiled DDS?
Code:
texconv.exe -r:keep input\*alb*.png -o output -f:BC1_UNORM -ft:dds
texconv.exe -r:keep input\*comp*.png -o output -f:BC7_UNORM -ft:dds
texconv.exe -r:keep input\*nor*.png -o output -f:BC5_SNORM -ft:dds
pause
The names of the PNGs would need to contain alb, comp, or nor. It seems odd that the MSFS compiler would compile to 3 different formats.
What I'm seeing is:
Comp (ORM) PNGs are converted to DXT1. There is no alpha.
Albedo are DXT1 if no transparency, else DXT5.
Normals are BC5s with no alpha channel.
EMIT are DXT5 (assuming transparency?)

All the default DDS textures are mipped anywhere from 10 to 12 mips in what I looked at.

This comes from nvddsinfo.exe
I'm not sure you couldn't make the COMP as DXT5, even though the alpha channel isn't used.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,866
Country
us-wisconsin
Did you know if it is possible to do the opposite and to obtain useable textures under MSFS ?
I have some texture that fspackagetools cann't or doesn't convert in DDS and no explication in the ConsoleLog. I have modify your BAT in order to produce DDS: it run OK but the result is strange ...
Of course, I can test under MSFS but it will take several tests to find the right parameters so if you had a track this would be a plus
Hi Didier.
nvidia-texture-tools can make DDS textures using nvcompress.exe
NVCompress.zip
 

Lagaffe

Resource contributor
Messages
851
Country
france
Thanks Dicks for your informations,

Yesterday compiling a nieme time, I paid a little more attention to the logs because of an error that I was trying to solve and I could see some interesting lines concerning the textures.

Compiling Material Lib files from source folder W:\MSFS Projects\_Aircrafts\xxx-boeing-stearman-model-75\PackageSources\MaterialLibs\GAS-Stearman\...
Compiling texture file Textures\Fire.png...
[CONVERTING BITMAP] 14091488729734547271
[BITMAP CONVERTED] 2D BM_BC7_UNORM(RGBA) 512x512 14091488729734547271
Compiling texture file Textures\Flame.png...
[CONVERTING BITMAP] 11808747740342240900
[BITMAP CONVERTED] 2D BM_BC7_UNORM(RGBA) 512x512 11808747740342240900
Compiling texture file texture\Seam_albd.png...
[CONVERTING BITMAP] 2049321997223252343
[BITMAP CONVERTED] 2D BM_BC3_UNORM 512x512 2049321997223252343
Compiling texture file texture\Seam_comp.png...
[CONVERTING BITMAP] 14819773077148382329
[BITMAP CONVERTED] 2D BM_BC1_UNORM 512x512 14819773077148382329
Compiling texture file texture\Seam_nrm.png...
[CONVERTING BITMAP] 18082004507761369301
[BITMAP CONVERTED] 2D BM_BC5_SNORM 512x512 18082004507761369301
Compiling texture file texture.artemis\Decal_albd.png...
[CONVERTING BITMAP] 12778421080863420680
[BITMAP CONVERTED] 2D BM_BC3_UNORM 2048x2048 12778421080863420680
Compiling texture file texture\R670_albd.png...
[CONVERTING BITMAP] 17665843475720941717
[BITMAP CONVERTED] 2D BM_BC1_UNORM 2048x2048 17665843475720941717
Compiling texture file texture.artemis\b75_misc_albd.png...
[CONVERTING BITMAP] 10868907083573552801
[BITMAP CONVERTED] 2D BM_BC1_UNORM 1024x1024 10868907083573552801
Compiling texture file texture\b75_misc_comp.png...
[CONVERTING BITMAP] 8682924090128732558
[BITMAP CONVERTED] 2D BM_BC1_UNORM 1024x1024 8682924090128732558
Theses lines bring also information about formats to use.
seam_albd => BC3_UNORM but R670_albd and b75_misc_albd => BC1_UNORM
comp => BC1_UNORM
norm => BC5_UNORM

The best is to try :cool:
 
Top