2012-05-09 08:30:53 -07:00
|
|
|
!!permu FOG
|
2018-11-27 08:48:19 -08:00
|
|
|
!!samps 1
|
2012-05-09 08:30:53 -07:00
|
|
|
//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
|
|
|
|
varying vec2 tc;
|
|
|
|
varying vec4 vc;
|
|
|
|
uniform vec4 e_colourident;
|
2017-07-03 22:07:51 -07:00
|
|
|
uniform vec4 e_vlscale;
|
2012-05-09 08:30:53 -07:00
|
|
|
void main ()
|
|
|
|
{
|
2013-04-07 20:51:21 -07:00
|
|
|
vec4 col = texture2D(s_t0, tc);
|
|
|
|
#ifdef MASK
|
2014-01-12 18:42:25 -08:00
|
|
|
if (col.a < float(MASK))
|
2013-04-07 20:51:21 -07:00
|
|
|
discard;
|
|
|
|
#endif
|
2017-07-03 22:07:51 -07:00
|
|
|
gl_FragColor = fog4blend(col * vc * e_colourident * e_vlscale);
|
2012-05-09 08:30:53 -07:00
|
|
|
}
|
|
|
|
#endif
|