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 update(float s, float r, float b, float dt, __global float4* buffer){
|
|
|
|
size_t i = get_global_id(0);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
buffer[i] = v;
|
|
|
|
}
|
|
|
|
|