Blendtable (DEF): Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Fox (talk | contribs)
No edit summary
Line 41: Line 41:
:::: alpha
:::: alpha


:::::: ZERO
copy


:::::: ONE
undef
 
:::::: SRC_COLOR
 
:::::: ONE_MINUS_SRC_COLOR


:::::: SRC_ALPHA
== Factors ==


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


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


== Examples ==
== Examples ==

Revision as of 04:12, 22 February 2020

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.

The first ID is reserved to the 33% transparency.

See also numalphatables.

Tokens

raw { [...] }

file
offset

glblend { [...] }

forward { [...] }
reverse { [...] }
both { [...] }
src
sfactor
top
dst
dfactor
bottom
alpha

copy

undef

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 } }