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

				uniform sampler2D texture2d_1;
				uniform sampler2D texture2d_blend;
				uniform float3 ScreenSize;

				/*				uniform sampler1D texture_transfer_function;
				uniform sampler1D texture_palette_function;

					
				uniform float3 VolumeSize;
				uniform float3 RelativeSize;
				uniform float3 Registration_Offset;
				uniform float pet_alpha_blending;
				uniform float3 MousePos;
				uniform int Projection_mode;
uniform float3 InVolumePosition;
				uniform float3 Windowing_Levels;

				uniform float isosurface;
uniform float Sharpening;

*/

				uniform float Limit;







void main (void) 
{


float4 res=tex2D(texture2d_1,oUV.xy);
vec2 SOUV=gl_FragCoord.xy*vec2(1.0/ScreenSize.x,1.0/ScreenSize.y);

float4 back=vec4(1.0)-tex2D(texture2d_blend,SOUV.xy)*1.0;
res=res*back;
//*vec4 (1.0,0.0,0.0,1.0);

back*=1.4;
back=clamp (back,0.0,1.0);

res.w=back.x;
//res.w=0;
//res*=back;
//*vec4 (1.0,0.0,0.0,1.0);
//res=gl_FragCoord.xyxy/640.0;


gl_FragData[0]=res;
	gl_FragData[1]=res;

}














