Pixel shader logic for mixing colors: Difference between revisions

From wowdev
Jump to navigation Jump to search
Line 7: Line 7:
vec4 ''tex2'' - color from second texture<br>
vec4 ''tex2'' - color from second texture<br>
vec4 ''submeshColor'' - value for current animation and animation time from [[M2#Colors|M2Color]] (M2Color.color lands into ''submeshColor.rgb'', ''M2Color.color'' goes ''into M2Color.a''). If [[M2#Colors|M2Color]] is not present in M2 file, this values is (1.0, 1.0, 1.0, 1.0)<br>
vec4 ''submeshColor'' - value for current animation and animation time from [[M2#Colors|M2Color]] (M2Color.color lands into ''submeshColor.rgb'', ''M2Color.color'' goes ''into M2Color.a''). If [[M2#Colors|M2Color]] is not present in M2 file, this values is (1.0, 1.0, 1.0, 1.0)<br>
float ''transparency'' - value for current animation and animation time from [[M2#Transparency|M2TextureWeight]]. If [[M2#Transparency|M2TextureWeight]] doesnt exists in M2 file, this value is 1.0
float ''transparency'' - value for current animation and animation time from [[M2#Transparency|M2TextureWeight]]. If [[M2#Transparency|M2TextureWeight]] doesnt exists in M2 file, this value is 1.0<br>
vec4 ''meshResColor'' - the combined color of several variables:
vec4 ''meshResColor'' - the combined color of several variables:
* for M2 spawned from MDDF chunk of Adt:  
* for M2 spawned from MDDF chunk of Adt:  

Revision as of 11:37, 30 August 2016

WoW combines colors of textures in shader. The actual formula used depends on shader used.

Symbols

vec4 tex1 - color from first texture
vec4 tex2 - color from second texture
vec4 submeshColor - value for current animation and animation time from M2Color (M2Color.color lands into submeshColor.rgb, M2Color.color goes into M2Color.a). If M2Color is not present in M2 file, this values is (1.0, 1.0, 1.0, 1.0)
float transparency - value for current animation and animation time from M2TextureWeight. If M2TextureWeight doesnt exists in M2 file, this value is 1.0
vec4 meshResColor - the combined color of several variables:

  • for M2 spawned from MDDF chunk of Adt:
  • for M2 spawned from MDDF chunk of WMO:
    • if M2 is contained:
    • otherwise:

vec4 finalColor - the result of combining

M2 shaders

Combiners_Opaque

finalColor.rgb = tex.rgb * meshResColor.rgb;
finalColor.a = meshResColor.a;

WMO shaders