www.pudn.com > GPUVision_5-13-05-2.zip > Harris.cg


// Main shader. 
void main(half2       iCoords   : TEX0, 
          uniform samplerRECT texture, 
          uniform float threshold, 
 
		  out float4 oColor : COLOR) {  
 
	float4 tmp = 0; 
	for(int i = -1; i <= 1; i++) { 
		for(int j = -1; j <= 1; j++) { 
			float4 data = f4texRECT(texture, iCoords+float2( i,j)); 
			tmp += data.xxyy * data.xyxy; 
		} 
	} 
	float det = tmp.x*tmp.w-tmp.y*tmp.z; 
	if(det < threshold) { 
		discard; 
	} 
	oColor = det; 
//	oColor = abs(tmp*100); 
}