<jittershader name="accum.erase">
	<description>
	Accumulator
	</description>
	<param name="erase_color" type="vec4" default="0. 0. 0. 0.1">
		<description>fade amount</description>
	</param>
	<param name="tex0" type="int" default="0" />
	<param name="tex1" type="int" default="1" />
	<language name="glsl" version="1.0">
		<bind param="erase_color" program="fp" />
		<bind param="tex0" program="fp" />
		<bind param="tex1" program="fp" />
		<program name="vp" type="vertex" source="sh.passthru.xform.vp.glsl" />
		<program name="fp" type="fragment">
<![CDATA[

// texcoords
varying vec2 texcoord0;
varying vec2 texcoord1;

// samplers
uniform sampler2DRect tex0;
uniform sampler2DRect tex1;

// accum amount
uniform vec4 erase_color;

void main() {
	vec4 current = texture2DRect(tex0, texcoord0);
	vec4 previous = texture2DRect(tex1, texcoord1);

	previous = mix(previous, erase_color, erase_color.a);
	vec4 res = mix(previous, current, current.a);
	
	gl_FragColor = res;
}

]]>
		</program>
	</language>
</jittershader>
