Skip to content

Commit b4624d2

Browse files
authored
fix: Split existing lines over 120 chars triggering the linter (#80)
1 parent 8e10ff4 commit b4624d2

File tree

2 files changed

+43
-40
lines changed

2 files changed

+43
-40
lines changed

Asset/Art/dds/dds_files_and_dxt_compression.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ have their own use cases and advantages, so higher numbers are not just "better"
1111

1212
The advantage of these compression formats compared to something more common like JPEG is that they can be uploaded to
1313
the GPU directly and always stay fully compressed in GPU memory. With hundreds of megabytes of textures this adds up
14-
quickly and allows us to improve performance (less memory bandwidth used) and target lower end/older GPUs with less VRAM.
15-
The decompression is implemented directly in hardware and happens transparently on memory access. The key ingredient for
16-
this to work is that the format is made out of independent 4x4 blocks of pixels that can be decompressed individually
17-
instead of the entire texture at once.
14+
quickly and allows us to improve performance (less memory bandwidth used) and target lower end/older GPUs with
15+
less VRAM. The decompression is implemented directly in hardware and happens transparently on memory access. The key
16+
ingredient for this to work is that the format is made out of independent 4x4 blocks of pixels that can be decompressed
17+
individually instead of the entire texture at once.
1818

1919
A more thorough look at the details of the compression formats can be found here:
2020
<http://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/>
@@ -32,30 +32,31 @@ The DXT-Formats mostly differ in their handling of the alpha channel (usually us
3232
The data rate is constant regardless of image content: 4 bits per pixel for BC1 and BC4 and 8 bits per pixel for every
3333
other format. This means that BC1 should be used where applicable to save memory, don't forget the 1 bit of alpha comes
3434
(almost) free! BC2 use cases are rare, usually you probably want BC3. A nice overview of features and use cases for all
35-
BCn formats can be found here (<https://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/#comparison-table>).
36-
Missing in this table is a particular trick for using DXT5 for better quality normal or bump maps explained here, also called
37-
DXT5nm or DXT5-xGxR and has direct support by a few tools (e.g. NVTT, see below).
38-
39-
The more modern BC4-7 formats should generally be avoided for now since the older Renegade-compatible W3D engine can't load
40-
them at all, W3D 5.0 (APB, AR and BFD) can't load them yet (though afaik it would be trivial to add support) and most
41-
importantly, 3ds Max and many other programs cannot open them
35+
BCn formats can be found here
36+
(<https://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/#comparison-table>).
37+
Missing in this table is a particular trick for using DXT5 for better quality normal or bump maps explained here,
38+
also called DXT5nm or DXT5-xGxR and has direct support by a few tools (e.g. NVTT, see below).
39+
40+
The more modern BC4-7 formats should generally be avoided for now since the older Renegade-compatible W3D engine can't
41+
load them at all, W3D 5.0 (APB, AR and BFD) can't load them yet (though afaik it would be trivial to add support) and
42+
most importantly, 3ds Max and many other programs cannot open them
4243
(BCn App Support <https://github.com/GameTechDev/Intel-Texture-Works-Plugin/wiki/BCn-App-Support>).
4344
Nevertheless, we might have a specific need for one of these formats in the future that warrants their use despite the
4445
tooling issues and we can always just use the uncompressed source texture for the .max files.
4546

46-
At some point in the future, I will specifically take a look at BC5 for optimum quality normal maps and general BC7 vs. BC3
47-
quality since it should be tremendously better in most use cases at the same size. BC7 instead of BC1 should not be used
48-
frivolously due to being twice the size and also less amenable to further compression (e.g. zip) since it actually carries
49-
so much more information, but when you really need a near-lossless result, this will do it. Since the BC7 format is so much
50-
more complex, some encoders can take many hours for a single texture at high quality, but there are some faster ones out
51-
there (see below, so far I only tried Compressonator for BC7, will revisit this at some point).
47+
At some point in the future, I will specifically take a look at BC5 for optimum quality normal maps and general BC7
48+
vs.BC3 quality since it should be tremendously better in most use cases at the same size. BC7 instead of BC1 should
49+
not be used frivolously due to being twice the size and also less amenable to further compression (e.g. zip) since it
50+
actually carries so much more information, but when you really need a near-lossless result, this will do it. Since the
51+
BC7 format is so much more complex, some encoders can take many hours for a single texture at high quality, but there
52+
are some faster ones out there (see below, so far I only tried Compressonator for BC7, will revisit this at some point).
5253

5354
## Which Exporter to Use?
5455

5556
This is where we get the reason why I wrote this post in the first place. I noticed some textures looking awfully blocky
5657
ingame with obviously off-color artifacts, which was caused by an extremely bad DXT encoder. I then set out to compare
57-
different compressors and stared at textures for hours (I also used PSNR metrics, but visual inspection was much more useful).
58-
In total I tested 7 different tools with two DXT1 textures we had uncompressed sources for.
58+
different compressors and stared at textures for hours (I also used PSNR metrics, but visual inspection was much
59+
more useful). In total I tested 7 different tools with two DXT1 textures we had uncompressed sources for.
5960

6061
First of all here's my personal ranking in terms of output quality:
6162

@@ -70,31 +71,32 @@ First of all here's my personal ranking in terms of output quality:
7071
- DirectXTex (<https://github.com/Microsoft/DirectXTex>)
7172
- DDS Converter (<http://www.ddsconverter.com/> but I'd rather you throw it deep into the sea)
7273

73-
To motivate you to switch from a different tool, let me detail the issues encountered with the different encoders (comparison
74-
images are in the spoiler below).
74+
To motivate you to switch from a different tool, let me detail the issues encountered with the different encoders
75+
(comparison images are in the spoiler below).
7576

76-
No matter which tool you use, make sure it generates mipmaps unless it's a UI texture. Some will do this by default, some
77-
don't (Compressonator). Some tools also offer the ability to specify gamma/sRGB for mipmap generation. This should be set
78-
to sRGB/2.2 (default for most tools). If you're unsure about gamma, use a checkerboard texture to replace a terrain texture
79-
ingame, disable anisotropic filtering and look off into the distance, with proper gamma it should look about medium gray
80-
(with lighting taken into account), otherwise it will look darker (like here <https://paroj.github.io/gltut/Texturing/Tut16%20Mipmaps%20and%20Linearity.html>).
77+
No matter which tool you use, make sure it generates mipmaps unless it's a UI texture. Some will do this by default,
78+
some don't (Compressonator). Some tools also offer the ability to specify gamma/sRGB for mipmap generation. This should
79+
be set to sRGB/2.2 (default for most tools). If you're unsure about gamma, use a checkerboard texture to replace a
80+
terrain texture ingame, disable anisotropic filtering and look off into the distance, with proper gamma it should look
81+
about medium gray (with lighting taken into account), otherwise it will look darker
82+
(like here <https://paroj.github.io/gltut/Texturing/Tut16%20Mipmaps%20and%20Linearity.html>).
8183

8284
If you're working with tiled textures (terrain, walls), make sure you're telling the compressor so it doesn't break the
8385
smooth tiling (e.g. -wrap for Crunch, -repeat for NVTT), though the difference is usually minimal.
8486

85-
Crunch was originally developed for a more advanced purpose, so make sure you only use the command line options that produce
86-
a "normal" non-clustered output (in particular, do not use -bitrate or -quality). In terms of visual quality, it particularly
87-
excels at gradients and dark areas.
87+
Crunch was originally developed for a more advanced purpose, so make sure you only use the command line options that
88+
produce a "normal" non-clustered output (in particular, do not use -bitrate or -quality). In terms of visual quality,
89+
it particularly excels at gradients and dark areas.
8890

89-
NVTT is very close overall, with Crunch displaying better performance on gradients, while NVTT beats it at high-frequency
90-
detail. Note: Do not use this tool for BC7, unless you want to literally wait for days for a single texture even with the
91-
"fast" encoding option.
91+
NVTT is very close overall, with Crunch displaying better performance on gradients, while NVTT beats it at
92+
high-frequency detail. Note: Do not use this tool for BC7, unless you want to literally wait for days for a single
93+
texture even with the "fast" encoding option.
9294

93-
Compressonator is one of the few tools to feature both a GUI and a command line interface, although the GUI can a bit weird
94-
to use. Make sure you generate mipmaps explicitly and set the quality to 1.0. In my experience the quality is always
95-
slightly behind Crunch/NVTT, but it's definitely not bad and it has been recommended a lot in the past. It can also compress
96-
to BC7 within a reasonable amount of time (35 seconds for a 4k texture with quality=0.05, though without comparison I
97-
can't speak for its visual quality).
95+
Compressonator is one of the few tools to feature both a GUI and a command line interface, although the GUI can a bit
96+
weird to use. Make sure you generate mipmaps explicitly and set the quality to 1.0. In my experience the quality is
97+
always slightly behind Crunch/NVTT, but it's definitely not bad and it has been recommended a lot in the past. It can
98+
also compress to BC7 within a reasonable amount of time (35 seconds for a 4k texture with quality=0.05, though without
99+
comparison I can't speak for its visual quality).
98100

99101
Nvidia's Photoshop plugin for some reason continues to use a very old version of their texture tools (NVTT is basically
100102
a complete rewrite). It generally looks most similar to Crunch, suggesting a commonality in the algorithm used. However,

SourceCode/Builds/build_with_msvc6.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ understanding of how C++ is compiled is necessary. This includes knowing what th
2121

2222
Download and install the following tools and software needed for compilation.
2323

24-
> **ℹ️ Setup Note:** For simplicity, this guide will use the installers for Git and CMake and assumes the user will use the
25-
default install folder for Visual Studio 6.0 Portable.
24+
> **ℹ️ Setup Note:** For simplicity, this guide will use the installers for Git and CMake and assumes the
25+
user will use the default install folder for Visual Studio 6.0 Portable.
2626

2727
### Visual Studio 6.0 Portable
2828

@@ -160,7 +160,8 @@ cmake --workflow --preset vc6-profile
160160

161161
You will find a bunch of files in `build\vc6\<game name>` and a file called `generalszh.exe` or `generalsv.exe`.
162162

163-
For detailed information about each build configuration and their specific purposes, see the [Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration).
163+
For detailed information about each build configuration and their specific purposes, see the
164+
[Build Configurations Overview](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_configuration).
164165

165166
### Install the game executable
166167

0 commit comments

Comments
 (0)