Strange attractors with OpenCL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

18 lines
580 B

kernel void initialize(size_t width, size_t height, write_only image2d_t output){
size_t x = get_global_id(0);
size_t y = get_global_id(1);
int2 coord = {x, y};
uint4 color = {255 * x / (width - 1), 255 * y / (height - 1), 0, 255};
write_imageui(output, coord, color);
}
kernel void square(global float* input, size_t width, global float* output){
size_t x = get_global_id(0);
size_t y = get_global_id(1);
float i = 2.0 * (input[x + width*y] - 0.5);
output[x + width*y] = 0.5 + 0.5*sin((1.0 - i) * sin(i*i + 6.2*float(x)/width) + cos(1.0/i + 6.2*float(y)/width));
}