Problem Geographic mapping problem

xjflcf520

Member
Joined
Feb 26, 2021
Messages
70
Reaction score
6
Points
23
Location
Chana
Geographic maps are not displayed in the D3D9 Client
I intercepted a geographic image in the map software as a texture for a specific area. The image engine that comes with the orbiter can be displayed normally, but the texture cannot be loaded normally when displayed using the D3D9 Client.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
Sorry but I have no idea of what you are talking about. What is a "geographic map" ? A "geographic image" ? What do you mean by "intercepted" (you send fighters to intercept a bomber) ?

"Image engine" makes little sense, I guess you mean "graphic client".

What I can roughly guess is that you are trying to display a planet surface texture, and that for some reason it doesn't work with D3D9. If it is so, you should post in the D3D9 Client (by Jarmonik) development thread.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
And also: There is not one map (tile), but many:
See:

So taking just this map
Political-World-Map-3360.jpg

isn't enough, you have to do some processing.
The "detail-levels" available can possibly be reduced to be just one (MaxPatchResolution = 1), but I have never felt to try ;)
 

xjflcf520

Member
Joined
Feb 26, 2021
Messages
70
Reaction score
6
Points
23
Location
Chana
My problem is that when I make a texture map for a certain area and use D3D9 Client to open the orbiter, the map cannot be displayed.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
It's possible that the *.dds image is corrupt somehow and DirectX 9 doesn't understand it. (This would not be the first time.) What software are you using and could you try an other one.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Since we are on "that topic"....
A while ago I tried to create a dds tile[1] just to see how it would look; and I I had to say it was harder than it looked.

Can you recommend a "any-PNG-with-alpha-channel-to-DDS-converter" that reliably creates Orbiter-compatible DDS files?

I would like to stay with my current habit of using Paint.NET for most of the editing, but those DDS exports all seem to be not perfect rsp. plain wrong ;)
A png2dds.exe would be my dream application!
I know that gimp can do this, but as I'm not using that very often (once every century), it usually takes me ages just to draw a rectangle :D

And than "all those options" when exporting to DDS[2] ...
DDSoptions.png

Thanks in advance for tips
Kuddel

[*] areal shot of my parents home town or something like that ;)
[2] O.K. that might be a Paint.NET specific thing.
 

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
696
Reaction score
259
Points
78
Location
This place called "home".
[...]
Can you recommend a "any-PNG-with-alpha-channel-to-DDS-converter" that reliably creates Orbiter-compatible DDS files?
[...]

For my (very limited) work with textures, I first save the texture in Paint.NET as DXT5 (if no transparency, then as DXT1). Then it works with D3D9Client, but if using inline graphics, I then have to use ORBITER_ROOT\Utils\DxTex.exe by opening the saved texture in it, Format->Change image format->DXT5 (or again DXT1 if using non-transparent), and then save again.

Doing this for every single texture is bothersome, but I haven't found any alternative way to get fully compatible textures.
I looked into possibly creating a Python script which did this for me for an entire folder, but didn't find enough documentation to begin the task. And PIL (Python imaging library) doesn't support saving DDS. Ugh.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
@asbjos : Thank you very much!
Regarding the 2nd step (converting to DXT5/DXT1 again) Microsoft's texconv.exe [1] might be easier to use, as it provides lots of command-line options ;)

Code:
Microsoft (R) DirectX Texture Converter [DirectXTex] Version 2021.6.10.1
Copyright (C) Microsoft Corp.

Usage: texconv <options> <files>

   -r                  wildcard filename search is recursive
     -r:flatten        flatten the directory structure (default)
     -r:keep           keep the directory structure
   -flist <filename>   use text file with a list of input files (one per line)

   -w <n>              width
   -h <n>              height
   -m <n>              miplevels
   -f <format>         format

   -if <filter>        image filtering
   -srgb{i|o}          sRGB {input, output}

   -px <string>        name prefix
   -sx <string>        name suffix
   -o <directory>      output directory
   -l                  force output filename to lower case
   -y                  overwrite existing output file (if any)
   -ft <filetype>      output file type

   -hflip              horizonal flip of source image
   -vflip              vertical flip of source image

   -sepalpha           resize/generate mips alpha channel separately
                       from color channels
   -keepcoverage <ref> Preserve alpha coverage in mips for alpha test ref

   -nowic              Force non-WIC filtering
   -wrap, -mirror      texture addressing mode (wrap, mirror, or clamp)
   -pmalpha            convert final texture to use premultiplied alpha
   -alpha              convert premultiplied alpha to straight alpha
   -at <threshold>     Alpha threshold used for BC1, RGBA5551, and WIC
                       (defaults to 0.5)

   -fl <feature-level> Set maximum feature level target (defaults to 11.0)
   -pow2               resize to fit a power-of-2, respecting aspect ratio

   -nmap <options>     converts height-map to normal-map
                       options must be one or more of
                          r, g, b, a, l, m, u, v, i, o
   -nmapamp <weight>   normal map amplitude (defaults to 1.0)

                       (DDS input only)
   -t{u|f}             TYPELESS format is treated as UNORM or FLOAT
   -dword              Use DWORD instead of BYTE alignment
   -badtails           Fix for older DXTn with bad mipchain tails
   -fixbc4x4           Fix for odd-sized BC files that Direct3D can't load
   -xlum               expand legacy L8, L16, and A8P8 formats

                       (DDS output only)
   -dx10               Force use of 'DX10' extended header
   -dx9                Force use of legacy DX9 header

                       (TGA output only)
   -tga20              Write file including TGA 2.0 extension area

                       (BMP, PNG, JPG, TIF, WDP output only)
   -wicq <quality>     When writing images with WIC use quality (0.0 to 1.0)
   -wiclossless        When writing images with WIC use lossless mode
   -wicmulti           When writing images with WIC encode multiframe images

   -nologo             suppress copyright message
   -timing             Display elapsed processing time

   -singleproc         Do not use multi-threaded compression
   -gpu <adapter>      Select GPU for DirectCompute-based codecs (0 is default)
   -nogpu              Do not use DirectCompute-based codecs

   -bc <options>       Sets options for BC compression
                       options must be one or more of
                          d, u, q, x
   -aw <weight>        BC7 GPU compressor weighting for alpha error metric
                       (defaults to 1.0)

   -c <hex-RGB>        colorkey (a.k.a. chromakey) transparency
   -rotatecolor <rot>  rotates color primaries and/or applies a curve
   -nits <value>       paper-white value in nits to use for HDR10 (def: 200.0)
   -tonemap            Apply a tonemap operator based on maximum luminance
   -x2bias             Enable *2 - 1 conversion cases for unorm/pos-only-float
   -inverty            Invert Y (i.e. green) channel values
   -reconstructz       Rebuild Z (blue) channel assuming X/Y are normals
   -swizzle <rgba>     Swizzle image channels using HLSL-style mask

   <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 BGR FP16 FP32 BPTC
      BPTC_FLOAT

   <filter>: POINT LINEAR CUBIC FANT BOX TRIANGLE POINT_DITHER
      LINEAR_DITHER CUBIC_DITHER FANT_DITHER BOX_DITHER TRIANGLE_DITHER
      POINT_DITHER_DIFFUSION LINEAR_DITHER_DIFFUSION CUBIC_DITHER_DIFFUSION
      FANT_DITHER_DIFFUSION BOX_DITHER_DIFFUSION TRIANGLE_DITHER_DIFFUSION

   <rot>: 709to2020 2020to709 709toHDR10 HDR10to709 P3to2020
      P3toHDR10 709toDisplayP3 DisplayP3to709

   <filetype>: BMP JPG JPEG PNG DDS TGA HDR TIF TIFF WDP HDP JXR
      PPM PFM

   <feature-level>: 9.1 9.2 9.3 10.0 10.1 11.0 11.1 12.0 12.1

   <adapter>:
      0: VID:8086, PID:1912 - Intel(R) HD Graphics 530
      1: VID:1414, PID:008C - Microsoft Basic Render Driver

So I could do a simple texconv.exe -f DXT5 foo.transp.png rsp. texconv.exe -f DXT1 foo.png

Again, thanks a lot,
Kuddel

[1] https://github.com/microsoft/DirectXTex/releases/download/jun2021/texconv.exe
https://github.com/microsoft/DirectXTex
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
I also had issues with Paint.net, .dds export is somehow "unreliable".
GIMP 2.0 works (if you survive the interface).
 
Top