#version 420

uniform isampler2D intRands;
uniform sampler2D floatRands;
in vec2 fragTexCoord;

uniform float lowerBound, upperBound;

out vec4 result;

void main( void ) 
{
	vec4 intRand   = texture( intRands, fragTexCoord );
	vec4 floatRand = texture( floatRands, fragTexCoord );
	
	bool isValid   = (floatRand.x > lowerBound) && (floatRand.x < upperBound);
	
    result = isValid ? 
				(vec4( intRand ) / 65535.0) : 
				vec4(0,0,0,1) ;
}