#version 120
#define float4 vec4
#define float3 vec3
#define float2 vec2
#define oUV gl_TexCoord[0]
#define tex3D texture3D
#define tex2D texture2D
#define tex1D texture1D


varying vec4 position;
				uniform sampler2D texture2d_1;
	uniform sampler2D texture2d_3;
	uniform sampler2D texture2d_random2;

	uniform float PosY;

varying vec4 Color;
varying float rnd;
uniform int mode;
uniform float Intensity;


void main (void) 
{

if (texture2D (texture2d_1,position.xy).x<0.01) discard;

//float4 TheNormal=(nnormal.xyzz+float4 (1.0))*0.5;
//TheNormal.w=shadow;
float4 Diffuse=gl_PointCoord.xyxy;

float3 Normal=gl_PointCoord.xyx;
Normal.z=1.0;
Normal=normalize (Normal);
gl_FragData[0]=Normal.xyzz;
if (length (gl_PointCoord.xy-vec2 (0.5))>0.5) discard;


//gl_FragData[1]=Color*Color*Color*Color*Color*Color*Color*Color*Color;

float4 Coll=texture2D (texture2d_1,position.xy)+Color;
//+vec4 (0.05,0.0,0.0,0.0);
//Coll=vec4 (1.0);
//Coll+=Color*vec4 (0.2,0.3,0.5,1.0);
gl_FragData[1]=Coll;
gl_FragData[0]=Coll;

//if (texture2D (texture2d_1,position.xy).x<0.03)
//gl_FragData[0]*=Color;

gl_FragData[0].w=0.8*Intensity;
gl_FragData[1].w=0.8*Intensity;
//*rnd*Color.x;
}














