_shadowmap_OMNI.vsh
{
	include deforms.inc
	uniform	mat4	u_ModelViewProjectionMatrix;
	out	vec3	Position;
	#if defined(ALPHATEST)
		out	vec4	color;
		out	vec2	texCoord;
		include colorGenLit.inc
		include tcGen_noFog.inc
	#endif
	void main(void)
	{
		mat2 dummy;
		vec4 glVertex = DeformGeometry(dummy);
		#if defined(ALPHATEST)
			color = colorGenLit(glVertex.xyz, u_gen, u_parm0, u_parm1, u_parm2);
			tcGen(texCoord, glVertex.xyz);
		#endif
		vec4 pos = u_ModelViewProjectionMatrix * glVertex;
		gl_Position = pos;
		Position = pos.xyz;
	}
}

_shadowmap_OMNI.fsh
{
	in	vec3	Position;
	out	float	fragData;
	#if defined(ALPHATEST)
		uniform sampler2D	u_ColorMap;
		uniform float		u_ColorMapSwizzle;
		uniform float		u_AlphaTestValue;
		in	vec4		color;
		in	vec2		texCoord;
		include Texture.inc
	#endif
	void main(void)
	{
		#if defined(ALPHATEST)
			vec4 pix = TextureLod(u_ColorMap, texCoord, 0.0, u_ColorMapSwizzle) * color;
			include alpha_test.inc
		#endif
		fragData = length(Position);
	}
}


_shadowmap_multitexture_OMNI.vsh
{
	include deforms.inc
	uniform	mat4	u_ModelViewProjectionMatrix;
	out	vec3	Position;
	#if defined(ALPHATEST)
		uniform	vec4	u_gen_t2;
		uniform	vec4	u_parm0_t2;
		uniform	vec4	u_parm1_t2;
		uniform	vec4	u_parm2_t2;
		out	vec4	color0;
		out	vec4	color1;
		out	vec4	texCoords;
		include colorGenLit.inc
		include tcGen_multitexture_noFog.inc
	#endif
	void main(void)
	{
		mat2 dummy;
		vec4 glVertex = DeformGeometry(dummy);
		#if defined(ALPHATEST)
			tcGen(texCoords.xy, texCoords.zw, glVertex.xyz);
			color0 = colorGenLit(glVertex.xyz, u_gen, u_parm0, u_parm1, u_parm2);
			color1 = colorGenLit(glVertex.xyz, u_gen_t2, u_parm0_t2, u_parm1_t2, u_parm2_t2);
		#endif
		vec4 pos = u_ModelViewProjectionMatrix * glVertex;
		gl_Position = pos;
		Position = pos.xyz;
	}
}

_shadowmap_multitexture_OMNI.fsh
{
	in	vec3	Position;
	out	float	fragData;
	#if defined(ALPHATEST)
		uniform float		u_AlphaTestValue;
		uniform sampler2D	u_ColorMap0;
		uniform float		u_ColorMap0Swizzle;
		uniform sampler2D	u_ColorMap1;
		uniform float		u_ColorMap1Swizzle;
		uniform vec2		u_Blend;
		in	vec4	color0;
		in	vec4	color1;
		in	vec4	texCoords;
		include Blend.inc
		include Texture.inc
	#endif
	void main(void)
	{
		#if defined(ALPHATEST)
			vec4 d = TextureLod(u_ColorMap0, texCoords.xy, 0.0, u_ColorMap0Swizzle) * color0;
			vec4 s = TextureLod(u_ColorMap1, texCoords.zw, 0.0, u_ColorMap1Swizzle) * color1;
			vec4 pix = Blend(s, d, u_Blend);
			include alpha_test.inc
		#endif
		fragData = length(Position);
	}
}



/// Projectors and Sun lights works with depth buffer only!
_shadowmap_PROJ.vsh
{
	include deforms.inc
	uniform	mat4	u_ModelViewProjectionMatrix;
	#if defined(ALPHATEST)
		out	vec4	color;
		out	vec2	texCoord;
		include colorGenLit.inc
		include tcGen_noFog.inc
	#endif
	void main(void)
	{
		mat2 dummy;
		vec4 glVertex = DeformGeometry(dummy);
		#if defined(ALPHATEST)
			color = colorGenLit(glVertex.xyz, u_gen, u_parm0, u_parm1, u_parm2);
			tcGen(texCoord, glVertex.xyz);
		#endif
		gl_Position = u_ModelViewProjectionMatrix * glVertex;
	}
}

_shadowmap_PROJ.fsh
{
	out	float	fragData;
	#if defined(ALPHATEST)
		uniform sampler2D	u_ColorMap;
		uniform float		u_ColorMapSwizzle;
		uniform float		u_AlphaTestValue;
		in	vec4		color;
		in	vec2		texCoord;
		include Texture.inc
	#endif
	void main(void)
	{
		#if defined(ALPHATEST)
			vec4 pix = TextureLod(u_ColorMap, texCoord, 0.0, u_ColorMapSwizzle) * color;
			include alpha_test.inc
		#endif
		fragData = 0.0;		// No color output, only depth = gl_FragCoord.z;
	}
}


_shadowmap_multitexture_PROJ.vsh
{
	include deforms.inc
	uniform	mat4	u_ModelViewProjectionMatrix;
	#if defined(ALPHATEST)
		uniform	vec4	u_gen_t2;
		uniform	vec4	u_parm0_t2;
		uniform	vec4	u_parm1_t2;
		uniform	vec4	u_parm2_t2;
		out	vec4	color0;
		out	vec4	color1;
		out	vec4	texCoords;
		include colorGenLit.inc
		include tcGen_multitexture_noFog.inc
	#endif
	void main(void)
	{
		mat2 dummy;
		vec4 glVertex = DeformGeometry(dummy);
		#if defined(ALPHATEST)
			tcGen(texCoords.xy, texCoords.zw, glVertex.xyz);
			color0 = colorGenLit(glVertex.xyz, u_gen, u_parm0, u_parm1, u_parm2);
			color1 = colorGenLit(glVertex.xyz, u_gen_t2, u_parm0_t2, u_parm1_t2, u_parm2_t2);
		#endif
		gl_Position = u_ModelViewProjectionMatrix * glVertex;
	}
}

_shadowmap_multitexture_PROJ.fsh
{
	out	float	fragData;
	#if defined(ALPHATEST)
		uniform float		u_AlphaTestValue;
		uniform sampler2D	u_ColorMap0;
		uniform float		u_ColorMap0Swizzle;
		uniform sampler2D	u_ColorMap1;
		uniform float		u_ColorMap1Swizzle;
		uniform vec2		u_Blend;
		in	vec4	color0;
		in	vec4	color1;
		in	vec4	texCoords;
		include Blend.inc
		include Texture.inc
	#endif
	void main(void)
	{
		#if defined(ALPHATEST)
			vec4 d = TextureLod(u_ColorMap0, texCoords.xy, 0.0, u_ColorMap0Swizzle) * color0;
			vec4 s = TextureLod(u_ColorMap1, texCoords.zw, 0.0, u_ColorMap1Swizzle) * color1;
			vec4 pix = Blend(s, d, u_Blend);
			include alpha_test.inc
		#endif
		fragData = 0.0;		// No color output, only depth = gl_FragCoord.z;
	}
}
