[opengtl-commits] [683] add a See effect

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 683
Author:   cyrille
Date:     2009-03-25 16:25:42 +0100 (Wed, 25 Mar 2009)

Log Message:
-----------
add a See effect

Added Paths:
-----------
    trunk/shiva-collections/filters/Sea.shiva


Added: trunk/shiva-collections/filters/Sea.shiva
===================================================================
--- trunk/shiva-collections/filters/Sea.shiva	                        (rev 0)
+++ trunk/shiva-collections/filters/Sea.shiva	2009-03-25 15:25:42 UTC (rev 683)
@@ -0,0 +1,48 @@
+<
+  parameters: <
+    t: <
+      label: "Time";
+      type: float;
+    >;
+    amp1: <
+      label: "Horizontal amplitude";
+      type: float;
+      minValue: 0;
+      maxValue: 100;
+      defaultValue: 5;
+    >;
+    amp2: <
+      label: "Vertical amplitude";
+      type: float;
+      minValue: 0;
+      maxValue: 100;
+      defaultValue: 10;
+    >;
+    wv: <
+      label: "Wave length";
+      type: float;
+      minValue: 0;
+      maxValue: 100;
+      defaultValue: 10;
+    >;
+  >;
+>;  
+kernel ZigZag
+{  
+  const float width = 500.0;
+  const float height = 753.0;
+  const float2 center = { width * 0.5, height * 0.5 };
+  const float PI2 = 2 * 3.14159265;
+  const float q = t * PI2;
+  void evaluatePixel(image img, out pixel result)
+  {
+    float s = sin(q + wv * height / ( height - result.coord.y + 0.1) );
+    float2 displacement = float2( s * amp1, s * amp2);
+    result = img.sampleNearest( result.coord + displacement );
+    result[3] = 1.0;
+  }
+  region changed(region changed_input_region, int input_index, region input_DOD[])
+  {
+    return changed_input_region;
+  }
+}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/