Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
baldavenger committed Aug 3, 2018
1 parent d88599d commit 89c9e0f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions DCTL_OFX/Satin_OFX.dctl
@@ -0,0 +1,33 @@
// Satin OFX DCTL

DEFINE_UI_PARAMS(MAX_ITER, Satin, DCTLUI_SLIDER_INT, 2, 1, 5, 1)
DEFINE_UI_PARAMS(time, Motion, DCTLUI_SLIDER_FLOAT, 0, 0, 1, 0.001)

__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B)
{
float X = (float)p_X;
float Y = (float)p_Y;
float width = (float)p_Width;
float height = (float)p_Height;
Y = height - Y;
float2 uv = make_float2(X / width, Y / height);
float TIME = time * 20;

float2 p = uv * 8;
float2 i = p;
float c = 0;
float inten = 0.15f;
float r = length(p + make_float2(_sinf(TIME), _sinf(TIME * 0.433f + 2)) * 3);

for (int n = 0; n < MAX_ITER; n++) {
float t = r - TIME * (1 - (1.9f / (n + 1)));
t = r - TIME / (n + 0.6f);
i = i - (p + make_float2(_cosf(t - i.x - r) + _sinf(t + i.y), _sinf(t - i.y) + _cosf(t + i.x) + r));
c += 1 / length( make_float2((_sinf(i.x + t) / inten), (_cosf(i.y + t) / inten)));
}
c /= MAX_ITER;
r = 1.5f - 0.25f * r;

float3 RGB = make_float3(c, c, c) * make_float3(2.4f, 2, 2.5f) - 0.15f;
return RGB;
}

0 comments on commit 89c9e0f

Please sign in to comment.