2012-05-09 15:30:53 +00:00
|
|
|
!!permu FOG
|
|
|
|
//used by both particles and sprites.
|
|
|
|
//note the fog blending mode is all that differs from defaultadditivesprite
|
|
|
|
|
|
|
|
#include "sys/fog.h"
|
|
|
|
#ifdef VERTEX_SHADER
|
|
|
|
attribute vec2 v_texcoord;
|
|
|
|
attribute vec4 v_colour;
|
|
|
|
varying vec2 tc;
|
|
|
|
varying vec4 vc;
|
|
|
|
void main ()
|
|
|
|
{
|
|
|
|
tc = v_texcoord;
|
|
|
|
vc = v_colour;
|
|
|
|
gl_Position = ftetransform();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef FRAGMENT_SHADER
|
|
|
|
uniform sampler2D s_t0;
|
|
|
|
varying vec2 tc;
|
|
|
|
varying vec4 vc;
|
|
|
|
uniform vec4 e_colourident;
|
2017-04-18 11:12:17 +00:00
|
|
|
uniform vec4 e_lmscale;
|
2012-05-09 15:30:53 +00:00
|
|
|
void main ()
|
|
|
|
{
|
2013-04-08 03:51:21 +00:00
|
|
|
vec4 col = texture2D(s_t0, tc);
|
|
|
|
#ifdef MASK
|
2014-01-13 02:42:25 +00:00
|
|
|
if (col.a < float(MASK))
|
2013-04-08 03:51:21 +00:00
|
|
|
discard;
|
|
|
|
#endif
|
2017-04-18 11:12:17 +00:00
|
|
|
gl_FragColor = fog4blend(col * vc * e_colourident * e_lmscale);
|
2012-05-09 15:30:53 +00:00
|
|
|
}
|
|
|
|
#endif
|