Blendtable (DEF): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
'''raw''' { [...] } | '''raw''' { [...] } | ||
Description. | |||
:: offset | :: '''file''' <filename> | ||
:: Description. | |||
:: '''offset''' <value> | |||
:: Description. | |||
'''glblend''' { [...] } | '''glblend''' { [...] } | ||
Description. | |||
:: '''reverse''' { [...] } | :: '''forward''' { [...] }<br />'''reverse''' { [...] }<br />'''both''' { [...] } | ||
:: | :: Description. | ||
:::: src | :::: {| cellpadding="0" cellspacing="0" border="0" | ||
| valign="top" | '''src''' <factor><br />'''dst''' <factor> | |||
| width="20px" | | |||
| valign="top" | (or '''sfactor''' / '''top''')<br />(or '''dfactor''' / '''bottom''') | |||
|- | |||
|} | |||
:::: | :::: Description. | ||
:::: | :::: See [[#Factors|below]]. | ||
:::: | :::: '''alpha''' <value> | ||
:::: | :::: Description. | ||
'''copy''' <> | |||
Description. | |||
'''undef''' <> | |||
Description. | |||
== Factors == | == Factors == | ||
[[File:GL blend chart.jpg|thumb|right|Chart explaining the combination of blend modes available in OpenGL.]] | [[File:GL blend chart.jpg|thumb|300px|right|Chart explaining the combination of blend modes available in OpenGL.]] | ||
* ZERO | * ZERO |
Revision as of 03:23, 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 { [...] }
Description.
- file <filename>
- Description.
- offset <value>
- Description.
glblend { [...] }
Description.
- forward { [...] }
reverse { [...] }
both { [...] }
- forward { [...] }
- Description.
src <factor>
dst <factor>(or sfactor / top)
(or dfactor / bottom)
- Description.
- See below.
- alpha <value>
- Description.
copy <>
Description.
undef <>
Description.
Factors
- 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 } }