-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ee5fbd
commit 20cdb98
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |