Sign in to follow this  
Guest cbuchner1

Some ramblings about the new RESAMPLE.EXE and BGL compression

Recommended Posts

Hi there,I ran the resample.exe tool a few times based on the sample data provided by Microsoft.I noticed some compression statistics in the end providing how many "blocks" were compressed and with which particular method. These blocks do not seem to match with the number of texture tiles created by RESAMPLE.EXE hence i assume the blocks are simply a fixed number of bytes long. The tool contains multiple compression methods. It would appear that it always picks the "best" method for each block.PTCSolid BlockBitPack And LZ1BitPack And LZ2BitPack CompressedDelta And LZ2 CompressedDelta And LZ1 CompressedDelta CompressedLZ1 CompressedLZ2 CompressedNot CompressedIs there a way I permanently turn off this compression, leaving RAW data in the BGL file only?I believe this new compression scheme is no longer compatible with the BGLZIP.EXE and BGLINSTALL.EXE tools (for FS 2000) provided by Microsoft for compression/decompression of BGL files.So in essence there is currently no way of taking apart the BGL photo scenery for St Maarten, for example? No way to undo the compression, no way of getting the contents out?I also noticed the RESAMPLE.EXE tool ignores a TextureWidth statement given in the [destination] section of the INF file, it always outputs 256x256 tiles!Would there be any use for the also supported texture output format "BIP" (Band Interleaved per Pixel)? This generates raw binary (RGB+Alpha) data, 8 bits per pixel, with a separate .hdr file containing metadata. MS FSX does not seem to load these BIP files when placed in the add-on scenery folder, so I guess it can't load this format at all.Duh, I need individual files representing individual tiles getting loaded by MS FSX otherwise my Google Maps hack won't work (see other thread).

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

uh, PTC is described in some Microsoft Research paper as a LOSSY image compression algorithm with overlapping block transforms where the coefficients get reordered and then compressed bitplane by bitplane (progressively). Much faster than wavelets apparently.http://research.microsoft.com/~malvar/papers/dcc00.pdfBut considering this, it will not be possible to decompress a BGL file into its components and to build another identical BGL file from those. Similar to decompressing a JPG and then recompressing it again, you WILL lose quality.And i doubt a free (as in beer) and open (as in sourcecode) implementation of PTC would be available. And the compression scheme might also be patent-encumbered. So, forget about public domain BGL decompression utilities for a while, unless explicitly provided by Microsoft ;-(

Share this post


Link to post
Share on other sites

Hi,>I also noticed the RESAMPLE.EXE tool ignores a TextureWidth>statement given in the [destination] section of the INF file,>it always outputs 256x256 tiles!What kind of INF file have you been using? When I use the new resample all textures get packed into the BGL file. So no texture files are created at all.

Share this post


Link to post
Share on other sites

Change the output format to BIP in the .inf file - it is a documented feature - but doesn't seem very useful. The program then creates individual BIP tiles - and files with extension ".hdr" containing some metadata about each tile - look at these files using Notepad, it's interesting.in the [destination] section, tryDestFileType = BIPBecause the BIP tiles are usually 256x256 in size, even if larger texture sizes are explicitly stated I assume this is the case also when selecting BGL as output format. The indication of individual "cells" in the progress report exactly matches the number of tiles generated. So "cell" = "tile" seems to hold. It will report always the same number of cells, regardless whether BIP or BGL output is used.Below you find my .inf file I am currently testing with. The SplitDirLOD directive is quite interesting, it creates subfolders at just like in the main Scenery folder of FSX, matching the QMID=4 grid on the world map which is also depicted in the accompanying HTML documentation of the Terrain SDK.The SplitFileLOD forces the program to generate individual BGL files at any given LOD level. The settings given below would create 96 individual 256x256 tiles at LOD 17. This also applies when using the BGL output format - exactly one BGL file per tile. For the Google Maps photoscenery project I am working on I need to have individual files per tile. If I could also get rid of any BGL compression, that would be sweet. It would allow me to replace the tile's imagery with content from Google Maps quite easily.I fiddled with the compression settings, but to no avail. The CompressionQuality=0 setting applies an extremely lossy compression on the tiles, making these very poor quality. And a setting of 100 doesn't mean "no compression", it just uses the highest quality level for the lossy PTC algorithm.[source]Type = GeoTIFFSourceDir = "SourceData"SourceFile = "MillenniumImage3.Tif"Layer = ImageryVariation = DayNullValue = 255,255,255[Destination]DestDir = "Output"DestBaseFileName = "Millennium_Image"DestFileType = BIPTextureWidth = 1024SplitDirLOD = 2SplitFileLOD = 17LOD = AutoCompressionQuality = 100I think I might use to the "old fashioned" way of creating photoscenery for FS2002 and 2004, using the older SDKs and PhotoSceneryMaker - this generates individual uncompressed BMP files as tiles. The new RESAMPLE.EXE gets me nowhere.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this