/***************************************************************************** * * Author: Andy Zupko * http://blog.zupko.info * * Write me if you use this for anything cool! * *****************************************************************************/ kernel cos2 { parameter float2 center < minValue: float2(0.0, 0.0); maxValue:float2(2000.0, 2000.0); defaultValue:float2(100.0,100.0); >; parameter float spread < defaultValue:30.0; minValue:1.0; maxValue:100.0; >; void evaluatePixel(image4 inImage, out pixel4 result) { float2 coord = outCoord(); float2 pos = coord-center; float dist = length(pos); float4 color = sampleNearest(inImage, coord); float cosn = 0.25+cos((dist*dist)/(spread))*0.75; float4 a = color*float4(cosn, cosn, cosn, 1.0); result = a; } /* region generated() { return region(float4(0,0,width,height)); }*/ }