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