Skip to content

Wrath Blending

fallenoak edited this page Nov 23, 2016 · 29 revisions

Blending States

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

M2 Blending Modes

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:

Default Mapping Table

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

M2 Fog Modes

Because blending modes change how color is applied, fog color needs to be taken into account for more interesting blending modes. The client does this with the s_fogModeList table.

On-Disk Blending Mode Value State State Name Fog Mode Action
4 3 Blend_Add 2 Override fog color to 0x000000 (black)
5 4 Blend_Mod 3* Override fog color to 0xFFFFFF (white)
6 5 Blend_Mod2x 4* Override fog color to 0x808080 (half white)

* indicates theory, not tested

Clone this wiki locally