// Chunk showing defaults for all textures. Each file wanting custom
// behavior will get listed later. If they don't have a value for an
// entry, the one from the default will be used instead.

[__DEFAULT_BZ2DXTOPTIONS__]
// If Skip is true, file skipped (and rest of options are ignored)
Skip = false

// true = higher quality (==slower). false = lower qualty(faster)
HighQuality = true

// How many mips will be generated. Valid values are 1..32, with
// values outside that range set to 32. If 1, then only the original
// size image will be output. If 2, then the original size and one
// size smaller (half-width, half-height) will be output. Items
// will be mipped down until either axis reaches 4 pixels, or this
// clamp, whatever comes first.
NumMips = 32

// What scaling algorithm is used for all resizes applying to this
// texture. Valid values are:
//	SCALEALGORITHM_NEAREST = 0
//	SCALEALGORITHM_LINEAR = 1
//	SCALEALGORITHM_BILINEAR = 2
//	SCALEALGORITHM_BOX = 3
//	SCALEALGORITHM_TRIANGLE = 4
//	SCALEALGORITHM_BELL = 5
//	SCALEALGORITHM_BSPLINE = 6
//	SCALEALGORITHM_LANCZOS3 = 7
//	SCALEALGORITHM_MITCHELL = 8
//
// Google these if you don't recognize what they look like.  Lanczos3
// is regarded as producing the best-looking results, so values
// outside 0..8 are changed to 7.
ScaleAlgorithm = 7

// DXT type for 24/32 bit images (determined at load time). Valid
// values are 1, 3 or 5, with default 24-bit type as DXT1, default 32-bit
// type is DXT5. Used when ForceDXT (below) is -1
DXT24Type = 1
DXT32Type = 5

// Valid values are -1, 1, 3 or 5, with illegal values treated as -1.
// If 1, 3 or 5, then the autodetermined 24/32 bit type is ignored, and
// the selection is used. If -1, then it uses the autodetermined
// type above.
ForceDXT = -1

// Whether DXT1 compression is allowed to use '3 color' mode or not.
// That mode can (and does) lead to black areas looking transparent.
// DXTGen before version 23 defaulted this to true; this option is
// exposed for some backwards compatability.
Allow3ColorModeDXT1 = false

// 32-bit textures using draw_planar need to have their outer border's
// pixels set to alpha 0 at lower mips, or things look really ugly on
// ATI graphics cards. (nVidia cards are just fine, go figure). This
// value is the # of pixels to ensure are all transparent at the
// borders. If this is 0 (default), then nothing is done to the
// image. If 1, then 1 pixel is set to RGBA(0,0,0,0) at the edges, if
// 2, then 2 pixels are zapped. Valid values are 0..4, with values
// outside of that range treated as 0.
PlanarAlphaBorder = 0

// Options allowing the editing of textures before they're compressed.
// Per-mip options, if not default, will ALSO be done. Basically,
// these 'Pre*' options are done to the file right after it's read in;
// the per-mip options are done in addition.

// If > 1, file sized to this width/height before any other
// processing.  If < 1, then size is left untouched.
PreScaleX = -1
PreScaleY = -1

// If > 0, does that many passes blurring the texture.
PreBlur = 0

// If > 0, does that many passes of a gaussian blur of the texture.
PreGaussianBlur = 0

// Valid values are -0.5 .. 1.7. Default = 1.0 (skip), otherwise
// adjusts the contrast of the image
PreContrast = 1.0

// Valid values are 0.0 .. 2.0. Default = 1.0 (skip), otherwise
// adjusts the gamma of the image
PreGamma = 1.0

// Valid values are 0.0 .. 2.5f for Sharpen, 0..65536 for
// SharpenPasses If Sharpen is not 1.0 (default), and SharpenPasses is
// >= 1, then it sharpens the image
PreSharpen = 1.0
PreSharpenPasses = 1

// Valid values are 0.0 .. 1.0. If this value is > 0.0, then it adds
// noise to the image
PreAddNoise = 0.0

// Valid values are 1 .. 65536. If this value is > 1, then it turns
// the image into a bunch of NxN solid pixels
PrePixelize = 1

// Default (false): leave untouched. If true, equalizes the image
PreEqualize = false

// Default (false): leave untouched. If true, negates the image
PreNegate = false

// Default (false): leave untouched. If true, embosses the image
PreEmboss = false

// Default (false): leave untouched. If true, 'alienifies' the image.
// (Don't laugh, that's what the OpenILU docs calls it. I can't really
// see a good purpose for doing this, but it was trivial to add
// support for it.)
PreAlienify = false

// Clamps for min & max ranges on channels for opaque & transparent
// textures. These are not done as part of the 'pre' pass; they're
// defaults that feed into the per-mip options
OpaqueDefaultMinR = 0
OpaqueDefaultMinG = 0
OpaqueDefaultMinB = 0
OpaqueDefaultMinA = 255
OpaqueDefaultMaxR = 255
OpaqueDefaultMaxG = 255
OpaqueDefaultMaxB = 255
OpaqueDefaultMaxA = 255

TransparentDefaultMinR = 0
TransparentDefaultMinG = 0
TransparentDefaultMinB = 0
TransparentDefaultMinA = 0
TransparentDefaultMaxR = 255
TransparentDefaultMaxG = 255
TransparentDefaultMaxB = 255
TransparentDefaultMaxA = 255

// Per-mip options. All of these are read in, and can be
// used. Further, all of these have a suffix on them, 0..9. That
// allows the option to be controlled per mipmap. Mip 0 is the largest
// item written out to the file, mip 1 is the next largest, all the
// way down to mip 9.  (10 mips is sufficient to do 2048, 1024, 512,
// 256, 128, 64, 32, 16, 8, .. 4; 2048 is the largest texture size
// supported by DX9, and 4x4 is the smallest DXT texture size)

// These options are applied in the same order as they're listed in
// this file. Use the VerboseCompress# option to see the same.

// Further, if you're curious as to what these options do, I encourage
// you to (1) read the OpenIL documentation at
// http://openil.sourceforge.net/docs/index.php , and/or (2) use the
// DoPreview0..DoPreview9 option to dump out .tgas of each level to
// see what it's doing.


// --- Begin per-mip options. Uncomment and separate them to use

// VerboseCompress0 .. VerboseCompress9 = false
//  - If true, will spam with lots of info about what it's doing to the mip

// ScaleAlgorithm0 .. ScaleAlgorithm9 = <ScaleAlgorithm>
//  - Allows setting of the compression algorithm per mip

// BlurCount0 .. BlurCount9 = 0
//  - If > 0, does that many passes blurring the texture.

// GaussianBlurCount0 .. GaussianBlurCount9 = 0
//  - If > 0, does that many passes of a gaussian blur of the texture.

// Contrast0 .. Contrast9 = 1.0
//  - Valid values are -0.5 .. 1.7. Default = 1.0 (skip), otherwise
//    adjusts the contrast of the image

// Gamma0 .. Gamma9 = 1.0
//  - Valid values are 0.0 .. 2.0. Default = 1.0 (skip), otherwise
//    adjusts the gamma of the image

// Sharpen0 .. Sharpen9 = 1.0
// SharpenPasses0 .. SharpenPasses9 = 1
//  - Valid values are 0.0 .. 2.5f for Sharpen, 0..65536 for SharpenPasses
//    If Sharpen is not 1.0 (default), and SharpenPasses is >= 1, then
//    it sharpens the image

// AddNoise0 .. AddNoise9 = 0.0
//  - Valid values are 0.0 .. 1.0. If this value is > 0.0, then it
//    adds noise to the image

// Pixelize0 .. Pixelize9 = 1
//  - Valid values are 1 .. 65536. If this value is > 1, then it
//    turns the image into a bunch of NxN solid pixels

// DoEqualize0 .. DoEqualize9 = false
//  - Default (false): leave untouched. If true, equalizes the image

// DoNegate0 .. DoNegate9 = false
//  - Default (false): leave untouched. If true, negates the image

// DoEmboss0 .. DoEmboss9 = false
//  - Default (false): leave untouched. If true, embosses the image

// DoAlienify .. DoAlienify9 = false
//  - Default (false): leave untouched. If true, 'alienify' the image


// Per-mip adjustments of channel clamps
// OpaqueMinR0 .. OpaqueMinR9 = <OpaqueDefaultMinR>
// OpaqueMinG0 .. OpaqueMinG9 = <OpaqueDefaultMinG>
// OpaqueMinB0 .. OpaqueMinB9 = <OpaqueDefaultMinB>
// OpaqueMinA0 .. OpaqueMinA9 = <OpaqueDefaultMinA>
// OpaqueMaxR0 .. OpaqueMaxR9 = <OpaqueDefaultMaxR>
// OpaqueMaxG0 .. OpaqueMaxG9 = <OpaqueDefaultMaxG>
// OpaqueMaxB0 .. OpaqueMaxB9 = <OpaqueDefaultMaxB>
// OpaqueMaxA0 .. OpaqueMaxA9 = <OpaqueDefaultMaxA>

// TransparentMinR0 .. TransparentMinR9 = <TransparentDefaultMinR>
// TransparentMinG0 .. TransparentMinG9 = <TransparentDefaultMinG>
// TransparentMinB0 .. TransparentMinB9 = <TransparentDefaultMinB>
// TransparentMinA0 .. TransparentMinA9 = <TransparentDefaultMinA>
// TransparentMaxR0 .. TransparentMaxR9 = <TransparentDefaultMaxR>
// TransparentMaxG0 .. TransparentMaxG9 = <TransparentDefaultMaxG>
// TransparentMaxB0 .. TransparentMaxB9 = <TransparentDefaultMaxB>
// TransparentMaxA0 .. TransparentMaxA9 = <TransparentDefaultMaxA>


// DoPreview0 .. DoPreview9 = false
//  - If true, will write out a .tga file with the contents of that
//    mip just before doing the .dxtbz2 compression. This allows you to
//    see what the results are.

// --- End per-mip options



// Conditions, all with names starting with 'If'. If a condition is
// not the default value (as shown in this block), it is considered.
// All considered conditions must be passed for the rule to pass.

// Width/Height checks. For these, 'Eq' is ==, 'NEq' is !=, 'Lt' is
// <, 'Gt' is >, 'LtEq' is <=, and GtEq is >=. For all of these, if
// the value is < 0 (default), it skips the rule.
IfWidthEq = -1
IfHeightEq = -1
IfWidthNEq = -1
IfHeightNEq = -1
IfWidthLt = -1
IfHeightLt = -1
IfWidthGt = -1
IfHeightGt = -1
IfWidthLtEq = -1
IfHeightLtEq = -1
IfWidthGtEq = -1
IfHeightGtEq = -1

// Filename checks. This checks the filename (not the full path to the
// file, just 'wire_fvarch.tga', for example. This is a regular
// expression, with '*' turned into '.*' to be more like windows file
// globbing. A blank string means the condition is not considered.
// The regular expression is treated as case-insensitive, just like
// the Windows filesystem.
IfFilenameMatches = ""

// Pathname checks. This checks the *full* path on disk. Otherwise,
// see the filename section above for info.
IfPathnameMatches = ""

// Comment to be printed when all conditions succeed and the rule is
// applied. (Prints in blue) Useful for debugging.
IfComment = ""

/// -------------------------------------------------------------
// General rules
//
// Rules have name starting with "__RULE", and must continue in
// numerical order. If a number is skipped, then searching for more
// rules stops. The first matching rule (i.e. lowest numbered rule) is
// applied, and the rest are skipped, if multiple rules could apply to
// an image.

[__RULE1]
IfWidthEq = 640
IfHeightEq = 480
PreScaleX = 1024
PreScaleY = 1024
NumMips = 3 // 1024x1024, 512x512, 256x256
IfComment = "Shell background -> 1024x1024, 3 mips "

[__RULE2]
IfFilenameMatches = "wire_*"
NumMips = 1
IfComment = "Wireframe: scale to 128x128, 1 mip "
PreScaleX = 128
PreScaleY = 128

[__RULE3]
IfFilenameMatches = "icon_*"
NumMips = 1
IfComment = "Icon: Scale to 32x32, 1 mip "
PreScaleX = 32
PreScaleY = 32

[__RULE4]
IfFilenameMatches = "cmnd_*"
NumMips = 1
IfComment = "cmnd_: 1 mip "

[__RULE5]
IfFilenameMatches = "*volumetexture*"
Skip = true 

[__RULE6]
IfPathnameMatches = "*\\interface\\*"
NumMips = 1
IfComment = "Interface folder. No rescale "

[__RULE7]
IfWidthEq = 256
IfHeightEq = 256
PreScaleX = 512
PreScaleY = 512
IfComment = "Upscale 256x256 -> 512x512 "
// Add a small amount of noise to the largest mip -- the one that was
// just created.
AddNoise0 = 0.08

[__RULE8]
IfWidthEq = 128
IfHeightEq = 128
PreScaleX = 256
PreScaleY = 256
IfComment = "Upscale 128x128 -> 256x256 "
// Add a small amount of noise to the largest mip -- the one that
// was just created.
AddNoise0 = 0.05

/// -------------------------------------------------------------
// Individual file overrides
// All of these have just the base name, no file extension like .tga

[bewes01]
Skip = true // Brad Pickering's son. Not used ingame

// Items to force to 1 mip level, only.
[bzone]
NumMips = 1

[cursor]
NumMips = 1

[hp_cannon]
NumMips = 1

[hp_gun]
NumMips = 1

[hp_mortar]
NumMips = 1

[hp_rocket]
NumMips = 1

[hp_shield]
NumMips = 1

[hp_special]
NumMips = 1

[ir_cann]
NumMips = 1

[ir_com]
NumMips = 1

[ir_horn]
NumMips = 1

[ir_mag]
NumMips = 1

[ir_mort]
NumMips = 1

[ir_rckt]
NumMips = 1

[ir_shad]
NumMips = 1

[sr_cann]
NumMips = 1

[sr_mort]
NumMips = 1

[sr_rcksp]
NumMips = 1

// Items added NM 4/19/06 to clamp to only 1 mip level
[object]
NumMips = 1

[select]
NumMips = 1

[square]
NumMips = 1

[target]
NumMips = 1

[gcomet]
NumMips = 1

[ghornet]
NumMips = 1

[gmaggun]
NumMips = 1

[gshadow]
NumMips = 1

[colorize]
NumMips = 1

[gauge]
NumMips = 1

[flag_generic]
NumMips = 1

// Items referenced by draw_planar, so they need the border param set
// Added NM 4/22/06

[ring]
PlanarAlphaBorder = 2

[splash]
PlanarAlphaBorder = 2

[grndchar]
PlanarAlphaBorder = 2

[blast]
PlanarAlphaBorder = 2

[lightflare]
PlanarAlphaBorder = 2

[lighthalo] //glock
PlanarAlphaBorder = 2



