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 7, 2018
1 parent 7ee5fbd commit 20cdb98
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions DCTL_OFX/Random_03_OFX.dctl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Random 03 OFX DCTL

DEFINE_UI_PARAMS(TIME, Adjust, 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;

float time = (TIME * 50) - 10;

float2 position = make_float2( X / width, Y / height ) / 4.0f;
float color = 0.0f;
color += _sinf( position.x * _cosf( time / 15.0f ) * 80.0f ) + _cosf( position.y * _cosf( time / 15.0f ) * 10.0f );
color += _sinf( position.y * _sinf( time / 10.0f ) * 40.0f ) + _cosf( position.x * _sinf( time / 25.0f ) * 40.0f );
color += _sinf( position.x * _sinf( time / 5.0f ) * 10.0f ) + _sinf( position.y * _sinf( time / 35.0f ) * 80.0f );
color *= _sinf( time / 10.0f ) * 0.5f;

float3 RGB = make_float3( color, color * 0.5f, _sinf( color + time / 3.0f ) * 0.75f);

return RGB;
}

0 comments on commit 20cdb98

Please sign in to comment.