TEXTURES

From ZDoom Wiki

Jump to: navigation, search

(development version only) TEXTURES is used to define composite textures in ZDoom. It is a text-based replacement format for the original TEXTURE1 and TEXTURE2 lumps. This lump was previously named HIRESTEX but its name was changed to reflect its meaning. HIRESTEX lumps are still read but that name is deprecated as of now.

Contents

Composite Textures

(development version only)

To define a new composite texture, use the texture keyword. A new sprite can be defined in the same manner using the sprite keyword. Either way, the format is the same:

texture Name, Width, Height
sprite Name, Width, Height

Name is the name of the new composite texture/sprite. Width and Height are integers that define the width and height of the "canvas" for the composite image. Note that this is not the scaled size -- those are defined by the X/YScale parameters within the texture/sprite parameter block. (See below)

Following this line is an optional parameter block enclosed in curly-braces ({}) where different options and the patches that make up the composite image will be listed.

The following options are available:

  • XScale <value>
Defines the amount by which to scale the width of the image. This uses an inverted scale. 2 scales the texture to 1/2 size, 4 scales to 1/4 size, etc.
  • YScale <value>
Defines the amount by which to scale the height of the image. This uses an inverted scale. 2 scales the texture to 1/2 size, 4 scales to 1/4 size, etc.
  • Offset <horz>, <vert>
Specifies the horizontal and vertical offset for a sprite image.
  • WorldPanning
Specifies that texture offsets should be applied in world units, rather than by pixels in the texture. This allows scaled textures to be offset properly when replacing lower resolution textures in an existing map.
  • NoDecals
Do not allow decals on this texture.
  • NullTexture
The image will never actually be drawn. This duplicates the behavior of AASHITTY and other special textures.

In addition to these options, the Patch keyword and block is used to add new patches to the composite image. The formatting is as follows:

Patch Name, X-Origin, Y-Origin

Name is the name of the patch to add. X/Y-Origin define where in the "canvas" to place the patch, starting at the top-left pixel of the patch and drawing right and downward.

Similar to the texture construct, the Patch option can optionally have its own parameter block, also enclosed in curly-braces. These options are available within this block:

  • FlipX
Flips the patch right-to-left within the image.
  • FlipY
Flips the patch upside down.
  • Rotate <value>
Rotates the patch within the image. Value is defined in degrees. Currently only multiples of 90 are valid (-90/0/90/180).
  • Translation <string>
Applies a translation to this patch before inserting it in the composite image. <string> can be either one of the built in translations or a custom translation string consisting of the colors to remap from and to. (See below)

note: Translation and Blend are mutually incompatible and cannot be both used on the same patch.

  • Blend <color>[,<a>]
  • Blend <r>,<g>,<b>[,<a>]
Blends a color into the patch before applying it to the composite image. Blend can either be followed by a color from the color table (e.g. "Blue") or a custom color consisting of red, green and blue values separated by commas. An alpha value can be optionally supplied in either cases, which indicates how much intensity the blended color should have. 1.0 is the default, with smaller values meaning less blend.

note: Blend and Translation are mutually incompatible and cannot be both used on the same patch.

  • Alpha <value>
Specifies the patch's translucency (0.0-1.0) when adding it to the image. Default is 1.0 (Fully opaque). Use the Style property to control how the translucency is applied.
  • Style <type>
Defines the render style for a translucent patch. See below.

There may be as many Patch statements and blocks present as needed to create the final composite image.

Translations

The colors of each patch can be translated independently as they are applied to the composite image.

To use one of the built in translation types, following the Translation property with one of:

  • Inverse
  • Gold
  • Red
  • Green
  • Ice
  • Desaturate

In addition to these translation types, a custom translation can be defined using the same syntax as CreateTranslation.

Translucency

Patches can be applied to the composite image using translucency. To do this, use the Alpha property to control how opaque the patch will be, and the Style property to control the type of translucency. Available values for Style are:

  • Copy
  • Blend
  • Add
  • Subtract
  • ReverseSubtract
  • Modulate
  • CopyAlpha

(Need more info on these modes!)

Examples

This creates a composite ladder texture by applying several copies of the same patch and rotating them 90 degrees:

texture ALADDER2, 72, 256
{
   XScale 1.0
   YScale 1.0
   Patch RW45_1, 0, 0
   {
      rotate 90
   }
   Patch RW45_1, 0, 64
   {
      rotate 90
   }
   Patch RW45_1, 0, 128
   {
      rotate 90
   }
   Patch RW45_1, 0, 172
   {
      rotate 90
   }
}

Hi-Res Textures (deprecated)

Warning: Please consider using the more robust composite texture definition feature instead. These old HIRESTEX commands are considered deprecated and won't get updated anymore in the future.


To replace an original texture, sprite or graphic use:

remap texturename hireslumpname

And to define a new Hi-Res texture use:

define lumpname scaledwidth scaledheight

Hi-Res texture lumps must not be placed between TX markers. When using Zips the lumps must be in the patches/ folder. For compatibility the graphics/ folder is checked as well.

Handling for ZDoom 2.2.0: Hi-Res texture lumps must not be placed between TX markers. When using Zips the lumps must be in the graphics/ folder.


xscale 8 yscale 8 is normal

xscale 16 yscale 16 is halfsize

xscale 32 yscale 32 is quartersized

xscale 64 yscale 64 is eighths

For Example:

A texture "HIRES100" that should be 64x by 128y but is 256x by 512y would be xscale 32 yscale 32.

Personal tools