-
Notifications
You must be signed in to change notification settings - Fork 65
Wrath Blending
When blending is enabled, Wrath of the Lich King always uses FUNC_ADD
for the blending equation.
State | Name | Src | Dest | Comment |
---|---|---|---|---|
0 |
Blend_Opaque |
ONE |
ZERO |
Blending disabled |
1 |
Blend_AlphaKey |
ONE |
ZERO |
Blending disabled |
2 |
Blend_Alpha |
SRC_ALPHA |
ONE_MINUS_SRC_ALPHA |
Standard blending func |
3 |
Blend_Add |
SRC_ALPHA |
ONE |
Additive blending func |
4 |
Blend_Mod |
DST_COLOR |
ZERO |
Modulative blending func |
5 |
Blend_Mod2x |
DST_COLOR |
SRC_COLOR |
2x modulative blending func |
6 |
Blend_ModAdd |
DST_COLOR |
ONE |
Modulative + additive |
7 |
Blend_InvSrcAlphaAdd |
ONE_MINUS_SRC_ALPHA |
ONE |
M2Material
defines a blendingMode
, but the blendingMode
isn't a direct lookup in the blending states table.
For M2s without header flag 0x08
set, the M2Material
blendingMode
is looked up in a default mapping table:
On-Disk Blending Mode Value | State | State Name | Example |
---|---|---|---|
0 |
0 |
Blend_Opaque |
WORLD\EXPANSION01\DOODADS\GENERIC\DRAENEI\LAMPPOSTS\DR_LAMPPOST_01.m2 |
1 |
1 |
Blend_AlphaKey |
World\GENERIC\NIGHTELF\PASSIVE DOODADS\LAMPS\KalidarStreetLamp02.m2 |
2 |
2 |
Blend_Alpha |
WORLD\EXPANSION01\DOODADS\GENERIC\DRAENEI\LAMPPOSTS\DR_LAMPPOST_01.m2 |
3 |
? | ? | ? |
4 |
3 |
Blend_Add |
World\GENERIC\NIGHTELF\PASSIVE DOODADS\LAMPS\KalidarStreetLamp02.m2 |
5 |
4 |
Blend_Mod |
WORLD\EXPANSION01\DOODADS\THEEXODAR\PASSIVEDOODADS\LIGHT_SCONCES\EXODAR_SCONCE_MAGENTA.M2 |
6 |
5 |
Blend_Mod2x |
World\GENERIC\GNOME\PASSIVE DOODADS\GNOMEMACHINE\GnomeSubwayGlass.m2 |
Typically, fog modes are selected based on the blending mode (see below).
Fog Mode | Action |
---|---|
0 |
Disable fog logic in the shader |
1 |
? no override ? |
2 |
Override fog color to 0x000000 (black) |
3 |
Override fog color to 0xFFFFFF (white) |
4 |
Override fog color to 0x808080 (half white) |
5 |
? related to submerged camera ? |
6 |
? related to liquid plane ? |
Because blending modes change how color is applied, fog color needs to be taken into account for more interesting blending modes.
If M2Material
flag 0x02
is set, fog mode 0
(ie disabled) is always selected.
If M2Material
flag 0x02
is not set, the client maps blending modes to fog modes with the s_fogModeList
table.
On-Disk Blending Mode Value | State | State Name | Fog Mode |
---|---|---|---|
0 |
0 |
Blend_Opaque |
1 * |
1 |
1 |
Blend_AlphaKey |
1 * |
2 |
2 |
Blend_Alpha |
1 * |
3 |
? | ? | ? (2?) * |
4 |
3 |
Blend_Add |
2 |
5 |
4 |
Blend_Mod |
3 |
6 |
5 |
Blend_Mod2x |
4 |
*
indicates theory, not tested
Typically, lighting modes are selected based on the blending mode (see below).
Lighting Mode | Action |
---|---|
0 |
Disable lighting logic in the shader |
1 |
Enable lighting logic in the shader |
If M2Material
flag 0x01
is set, lighting mode 0
(ie disabled) is always selected.
If M2Material
flag 0x01
is not set, the client maps blending modes to lighting modes using the s_shadedList
table.
The client appears to forcibly disable directional lighting logic in the shader for Blend_Mod
and Blend_Mod2x
, but keeps directional lighting enabled for all other blending modes.
On-Disk Blending Mode Value | State | State Name | Lighting Mode |
---|---|---|---|
0 |
0 |
Blend_Opaque |
1 * |
1 |
1 |
Blend_AlphaKey |
1 * |
2 |
2 |
Blend_Alpha |
1 * |
3 |
? | ? |
1 * |
4 |
3 |
Blend_Add |
1 * |
5 |
4 |
Blend_Mod |
0 * |
6 |
5 |
Blend_Mod2x |
0 * |
*
indicates theory, not tested