Jump to content

Blendtable (DEF): Difference between revisions

From EDukeWiki
Fox (talk | contribs)
No edit summary
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''blendtable''' <blendtable> { [...] }
{{Under construction}}


Loads a blend table from a raw image file.
<span {{code}}>'''blendtable''' <blendtable> { [...] }</span>
 
Loads a blend table from a [[raw image file]].


The image file MUST contain a 256 color table of its own. Each pixel will have their matching color in the table converted in the blend table.
The image file MUST contain a 256 color table of its own. Each pixel will have their matching color in the table converted in the blend table.
Line 7: Line 9:
A single image file may contain multiple base palettes, and '''offset''' can used to locate it.
A single image file may contain multiple base palettes, and '''offset''' can used to locate it.


The first ID is reserved to the 33% transparency.
ID 0 is reserved for the base game's original table of 33% transparency.
 
A package for [[Duke Nukem 3D]] with blend tables generated to the same specification as [[Ion Fury]] is available and permitted for use in projects with credit to the author: [[file:duke3d blend package.7z]]


See also [[numalphatables (DEF)|numalphatables]].
See also [[numalphatables (DEF)|numalphatables]].
Line 13: Line 17:
== Tokens ==
== Tokens ==


raw
<span {{code}}>'''raw''' { [...] }
 
:: file


:: offset
DESCRIPTION


glblend
:: <span {{code}}>'''file''' <filename></span>


:: forward
:: DESCRIPTION


:: reverse
:: <span {{code}}>'''offset''' <value></span>


:: both
:: DESCRIPTION


:::: src
<span {{code}}>'''glblend''' { [...] }</span>


:::: sfactor
DESCRIPTION


:::: top
:: <span {{code}}>'''forward''' { [...] }</span><br />
:: <span {{code}}>'''reverse''' { [...] }</span><br />
:: <span {{code}}>'''both''' { [...] }</span>


:::: dst
:: DESCRIPTION


:::: dfactor
:::: <span {{code}}>'''src''' <factor></span> (or '''sfactor''' / '''top''')<br />
:::: <span {{code}}>'''dst''' <factor></span> (or '''dfactor''' / '''bottom''')


:::: bottom
:::: DESCRIPTION


:::: alpha
:::: See [[#Factors|below]].


:::::: ZERO
:::: <span {{code}}>'''alpha''' <value></span>


:::::: ONE
:::: DESCRIPTION


:::::: SRC_COLOR
<span {{code}}>'''copy''' <blendtable></span>


:::::: ONE_MINUS_SRC_COLOR
DESCRIPTION


:::::: SRC_ALPHA
<span {{code}}>'''undef'''</span>


:::::: ONE_MINUS_SRC_ALPHA
DESCRIPTION


:::::: DST_ALPHA
== Factors ==


:::::: ONE_MINUS_DST_ALPHA
[[File:GL blend chart.jpg|thumb|200px|right|Chart explaining the combination of blend modes available in OpenGL.]]


:::::: DST_COLOR
* ZERO
 
* ONE
:::::: ONE_MINUS_DST_COLOR
* SRC_COLOR
 
* ONE_MINUS_SRC_COLOR
copy
* SRC_ALPHA
 
* ONE_MINUS_SRC_ALPHA
undef
* DST_ALPHA
* ONE_MINUS_DST_ALPHA
* DST_COLOR
* ONE_MINUS_DST_COLOR


== Examples ==
== Examples ==
Line 76: Line 84:
  blendtable 1 { raw { file "blend.raw" offset 65536 } }
  blendtable 1 { raw { file "blend.raw" offset 65536 } }
  blendtable 2 { raw { file "blend.raw" offset 131072 } }
  blendtable 2 { raw { file "blend.raw" offset 131072 } }
[[Category:WIP pages]]


[[Category:DEF commands]]
[[Category:DEF commands]]
[[Category:Palette editing]]

Latest revision as of 21:20, 10 March 2026

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

blendtable <blendtable> { [...] }

Loads a blend table from a raw image file.

The image file MUST contain a 256 color table of its own. Each pixel will have their matching color in the table converted in the blend table.

A single image file may contain multiple base palettes, and offset can used to locate it.

ID 0 is reserved for the base game's original table of 33% transparency.

A package for Duke Nukem 3D with blend tables generated to the same specification as Ion Fury is available and permitted for use in projects with credit to the author: File:Duke3d blend package.7z

See also numalphatables.

Tokens

raw { [...] }

DESCRIPTION

file <filename>
DESCRIPTION
offset <value>
DESCRIPTION

glblend { [...] }

DESCRIPTION

forward { [...] }
reverse { [...] }
both { [...] }
DESCRIPTION
src <factor> (or sfactor / top)
dst <factor> (or dfactor / bottom)
DESCRIPTION
See below.
alpha <value>
DESCRIPTION

copy <blendtable>

DESCRIPTION

undef

DESCRIPTION

Factors

Chart explaining the combination of blend modes available in OpenGL.
  • ZERO
  • ONE
  • SRC_COLOR
  • ONE_MINUS_SRC_COLOR
  • SRC_ALPHA
  • ONE_MINUS_SRC_ALPHA
  • DST_ALPHA
  • ONE_MINUS_DST_ALPHA
  • DST_COLOR
  • ONE_MINUS_DST_COLOR

Examples

The following PNG image contains the blend table in Duke Nukem 3D v1.5:

This example will load 3 blend tables in the same file:

blendtable 0 { raw { file "blend.raw" } }
blendtable 1 { raw { file "blend.raw" offset 65536 } }
blendtable 2 { raw { file "blend.raw" offset 131072 } }