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.
|
|
|
|
|
|
|
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};
|
|
|
|
//uint4 color = {255 * (x%2), 120 * (y%2), 0, 255};
|
|
|
|
uint4 color = {255, 255, 0, 255};
|
|
|
|
|
|
|
|
write_imageui(output, coord, color);
|
|
|
|
}
|
|
|
|
|
|
|
|
kernel void update(size_t width, size_t height, read_only image2d_t input, write_only image2d_t output){
|
|
|
|
size_t x = get_global_id(0);
|
|
|
|
size_t y = get_global_id(1);
|
|
|
|
|
|
|
|
int2 coord = {x, y};
|
|
|
|
|
|
|
|
const sampler_t samplerA = CLK_NORMALIZED_COORDS_FALSE
|
|
|
|
| CLK_ADDRESS_NONE
|
|
|
|
| CLK_FILTER_NEAREST;
|
|
|
|
uint4 color = read_imageui(input, samplerA, coord).yzxw;
|
|
|
|
color.x = 255 - color.x;
|
|
|
|
write_imageui(output, coord, color);
|
|
|
|
}
|
|
|
|
|