Blendtable (DEF): Difference between revisions
| No edit summary | Hendricks266 (talk | contribs) No edit summary | ||
| (11 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| {{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 13: | Line 15: | ||
| == Tokens == | == Tokens == | ||
| raw | <span {{code}}>'''raw''' { [...] } | ||
| :: file | |||
| :: offset | DESCRIPTION | ||
| glblend | |||
| :: forward | :: <span {{code}}>'''file''' <filename></span> | ||
| :: reverse | |||
| :: both | :: DESCRIPTION | ||
| :: | |||
| :::: sfactor | :: <span {{code}}>'''offset''' <value></span> | ||
| :::: dst | :: DESCRIPTION | ||
| ::::  | |||
| ::::  | <span {{code}}>'''glblend''' { [...] }</span> | ||
| :::: alpha | |||
| ::::: | DESCRIPTION | ||
| :: <span {{code}}>'''forward''' { [...] }</span><br /> | |||
| :: <span {{code}}>'''reverse''' { [...] }</span><br /> | |||
| :: <span {{code}}>'''both''' { [...] }</span> | |||
| :: DESCRIPTION | |||
| :::: <span {{code}}>'''src''' <factor></span> (or '''sfactor''' / '''top''')<br /> | |||
| :: | :::: <span {{code}}>'''dst''' <factor></span> (or '''dfactor''' / '''bottom''') | ||
| :::: DESCRIPTION | |||
| :::: See [[#Factors|below]]. | |||
| :::: <span {{code}}>'''alpha''' <value></span> | |||
| :::: DESCRIPTION | |||
| <span {{code}}>'''copy''' <blendtable></span> | |||
| DESCRIPTION | |||
| <span {{code}}>'''undef'''</span> | |||
| DESCRIPTION | |||
| == Factors == | |||
| [[File:GL blend chart.jpg|thumb|200px|right|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: | |||
| [[File:Duke3d transpal.png]] | |||
| 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 } } | |||
| [[Category:DEF commands]] | [[Category:DEF commands]] | ||
Latest revision as of 14:10, 22 March 2021
|  | 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.
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> (or sfactor / top)
- dst <factor> (or dfactor / bottom)
 
- src <factor> (or sfactor / top)
 
 
- DESCRIPTION
 
 
 
- See below.
 
 
 
- alpha <value>
 
 
 
- DESCRIPTION
 
 
 
copy <blendtable>
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 } }
 
	