Texture (DEF): Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''texture''' <tilenum> { [...] }
{{Under construction}}
 
<span {{code}}>'''texture''' <tilenum> { [...] }</span> (or '''tile''')


Defines a Hightile texture to replace an ART-file tile. <tilenum> may be a number, or a defined label.
Defines a Hightile texture to replace an ART-file tile. <tilenum> may be a number, or a defined label.
Line 5: Line 7:
== Tokens ==
== Tokens ==


'''pal''' <palnum> { [...] }
<span {{code}}>'''pal''' <palnum> { [...] }</span>


Replaces the palette <palnum>. If a palette has no pal definition palette 0 definition will be used. Tint will not be used on palettes defined with this instruction.
Replaces the palette <palnum>. If a palette has no pal definition palette 0 definition will be used. Tint will not be used on palettes defined with this instruction.


The brace-enclosed block may contain these instructions:
<span {{code}}>'''detail''' { [...] }</span>
 
Defines a [[Detail_mapping|detail texture]] for the texture.
 
<span {{code}}>'''glow''' { [...] }</span>
 
Defines a [[Glow_mapping|glow map]] for the texture.
 
<span {{code}}>'''specular''' { [...] }</span>
 
DESCRIPTION
 
<span {{code}}>'''normal''' { [...] }</span>
 
DESCRIPTION


: {| cellpadding="0" cellspacing="0" border="0"
:: <span {{code}}>'''file''' <filename></span> (or '''name''')
| valign="top" | '''file''' <filename>
| width="20px" |
| valign="top" | (or '''name''')
|-
|}


: Defines which texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
:: Defines which texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.


: '''alphacut''' <cutoff-value>
:: <span {{code}}>'''alphacut''' <value></span>


: Sets the level of transparency at which a pixel in the texture is considered opaque. Pixels with more transparency than the cut-off are not drawn to the screen when rendered. The default setting is 0.32, which is just below the 33% transparency level of Build. If your texture has areas that are more transparent than the default, you can lower the cut-off level to preserve that detail.
:: Sets the level of transparency at which a pixel in the texture is considered opaque. Pixels with more transparency than the cut-off are not drawn to the screen when rendered. The default setting is 0.32, which is just below the 33% transparency level of Build. If your texture has areas that are more transparent than the default, you can lower the cut-off level to preserve that detail.


: '''nocompress'''
:: <span {{code}}>'''nocompress'''</span>


: Prevents the texture from being compressed using S3TC if texture compression is enabled.
:: Prevents the texture from being compressed using S3TC if texture compression is enabled.


: '''nodownsize'''
:: <span {{code}}>'''nodownsize'''</span>


: Prevents the texture from being downsized.
:: Prevents the texture from being downsized.


: '''xscale''' <value>
:: <span {{code}}>'''forcefilter'''</span>
: '''yscale''' <value>


: Sets the scale of the hightile texture in relation to the original texture. A <value> of 1.0 makes it the same size, higher makes it cover more then the original tile and smaller makes it cover a smaller area. '''xscale''' (aka '''scale''', '''detailscale''', '''intensity''') sets the horizontal scale and '''yscale''' sets the vertical scale.
:: Always apply texture filtering regardless of user settings. Useful for UI elements.


'''detail''' { [...] }
:: <span {{code}}>'''artquality'''</span>


Defines a [[Detail_mapping|detail texture]] for the texture. The brace-enclosed block may contain these instructions:
:: Similar to <code>nocompress nodownsize</code>, but smarter. Use if your texture is similar to pixel art, such as textures from Duke 64 that use colors outside the global 256-color palette. Prevents texture from being downsized, but allows S3TC compression if texture compression is set to "aggressive" (aka. r_texcompr 2), which is sometimes necessary on low-end devices such as old ARM hardware.


: '''file''' <filename>
:: <span {{code}}>'''xscale''' <value></span> (or '''detailscale''' / '''scale''' / '''intensity''')<br />
:: <span {{code}}>'''yscale''' <value></span>


: Specifies which detail texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
:: Sets the scale of the hightile texture in relation to the original texture. A <value> of 1.0 makes it the same size, higher makes it cover more then the original tile and smaller makes it cover a smaller area. '''xscale''' (aka '''scale''', '''detailscale''', '''intensity''') sets the horizontal scale and '''yscale''' sets the vertical scale.


: '''scale''' <value>
:: <span {{code}}>'''orig_sizex''' <value></span><br />
:: <span {{code}}>'''orig_sizey''' <value></span>


: <value> is a positive floating-point value that'll determine how much your detail map should repeat on your diffuse map (if you want your detail map to repeat five times, use a 1/5 scale : 0.2).
:: DESCRIPTION


'''glow''' { [...] }
:: <span {{code}}>'''specpower''' <value></span> (or '''specularpower''' / '''parallaxscale''')


Defines a [[Glow_mapping|glow map]] for the texture. The brace-enclosed block may contain these instructions:
:: DESCRIPTION


: '''file''' <filename>
:: <span {{code}}>'''specfactor''' <value></span> (or '''specularfactor''' / '''parallaxbias''')


: Specifies which glow map file to use. This instruction must be supplied.
:: DESCRIPTION


== Examples ==
== Examples ==

Latest revision as of 13:29, 3 April 2023

This page is under construction.
Please help review and edit this page.

texture <tilenum> { [...] } (or tile)

Defines a Hightile texture to replace an ART-file tile. <tilenum> may be a number, or a defined label.

Tokens

pal <palnum> { [...] }

Replaces the palette <palnum>. If a palette has no pal definition palette 0 definition will be used. Tint will not be used on palettes defined with this instruction.

detail { [...] }

Defines a detail texture for the texture.

glow { [...] }

Defines a glow map for the texture.

specular { [...] }

DESCRIPTION

normal { [...] }

DESCRIPTION

file <filename> (or name)
Defines which texture file to use. File may be any PNG, JPG, DDS, TGA, BMP, GIF or PCX file. This instruction must be supplied.
alphacut <value>
Sets the level of transparency at which a pixel in the texture is considered opaque. Pixels with more transparency than the cut-off are not drawn to the screen when rendered. The default setting is 0.32, which is just below the 33% transparency level of Build. If your texture has areas that are more transparent than the default, you can lower the cut-off level to preserve that detail.
nocompress
Prevents the texture from being compressed using S3TC if texture compression is enabled.
nodownsize
Prevents the texture from being downsized.
forcefilter
Always apply texture filtering regardless of user settings. Useful for UI elements.
artquality
Similar to nocompress nodownsize, but smarter. Use if your texture is similar to pixel art, such as textures from Duke 64 that use colors outside the global 256-color palette. Prevents texture from being downsized, but allows S3TC compression if texture compression is set to "aggressive" (aka. r_texcompr 2), which is sometimes necessary on low-end devices such as old ARM hardware.
xscale <value> (or detailscale / scale / intensity)
yscale <value>
Sets the scale of the hightile texture in relation to the original texture. A <value> of 1.0 makes it the same size, higher makes it cover more then the original tile and smaller makes it cover a smaller area. xscale (aka scale, detailscale, intensity) sets the horizontal scale and yscale sets the vertical scale.
orig_sizex <value>
orig_sizey <value>
DESCRIPTION
specpower <value> (or specularpower / parallaxscale)
DESCRIPTION
specfactor <value> (or specularfactor / parallaxbias)
DESCRIPTION

Examples

texture 3586 {
  pal 0 { file "mymod/tree.png" }
  pal 21 { file "mymod/tree_red.png" xscale 2.0 yscale 2.0 alphacut 0 nodownsize nocompress }
  glow { file "mymod/tree_light.png" }
  detail { file "mymod/plant_texture.png" scale 0.5 }
}