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.
 
 
 

22 lines
414 B

kernel void update(__constant float* p, __global float4 * buffer){
size_t i = get_global_id(0);
const float s = p[0];
const float r = p[1];
const float b = p[2];
const float dt = p[3];
const float4 w = buffer[i];
float4 v = w;
v.x += dt * s * (w.y - w.x);
v.y += dt * (w.x * (r - w.z) - w.y);
v.z += dt * (w.x * w.y - b * w.z);
// if(sin(0.1 * v.x) > 0.3){
// v *= 1.0012f;
// }
buffer[i] = v;
}