[opengtl-commits] [547] more parameters

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


Revision: 547
Author:   cyrille
Date:     2008-12-18 22:37:57 +0100 (Thu, 18 Dec 2008)

Log Message:
-----------
more parameters

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/examples/Something.shiva
    trunk/OpenGTL/OpenShiva/examples/SuperNova.shiva


Modified: trunk/OpenGTL/OpenShiva/examples/Something.shiva
===================================================================
--- trunk/OpenGTL/OpenShiva/examples/Something.shiva	2008-12-18 21:37:41 UTC (rev 546)
+++ trunk/OpenGTL/OpenShiva/examples/Something.shiva	2008-12-18 21:37:57 UTC (rev 547)
@@ -1,13 +1,47 @@
+<
+  parameters: <
+    colors: <
+      colorrgb: <
+        label: "Object";
+        type: rgb;
+        defaultValue: { 0.2, 0.01, 0.08 };
+      >;
+      colorcenterrgb: <
+        label: "Background";
+        type: rgb;
+        defaultValue: { 1.0, 1.0, 1.0 };
+      >;
+    >;
+    xcenter: <
+      label: "Center x";
+      type: float;
+    >;
+    ycenter: <
+      label: "Center y";
+      type: float;
+    >;
+    phase: <
+      label: "Phase";
+      type: float;
+      defaultValue: 6.0;
+      maxValue: 32.0;
+    >;
+    radiusp: <
+      label: "Radius";
+      type: float;
+      defaultValue: 0.8;
+    >;
+  >;
+>;
 kernel Something
 {
-  const float width = 600.0;
-  const float height = 600.0;
-  const float2 center = { width/2.0, height/2.0 };
+  const float width = 500.0;
+  const float height = 500.0;
+  const float2 center = { width * xcenter, height * ycenter };
   const float PI = 3.14159265;
-  const float4 color1 = { 0.2, 0.01, 0.08, 1.0 };
-  const float4 colorCenter = { 1.0, 1.0, 1.0, 1.0 };
-  const float phase = 6.0;
-  const float radius = 200.0;
+  const float4 color1 = { colorrgb[0], colorrgb[1], colorrgb[2], 1.0 };
+  const float4 colorCenter = { colorcenterrgb[0], colorcenterrgb[1], colorcenterrgb[2], 1.0 };
+  const float radius = 0.2 * (width + height) * radiusp;
   float length( float2 v)
   {
     v *= v;

Modified: trunk/OpenGTL/OpenShiva/examples/SuperNova.shiva
===================================================================
--- trunk/OpenGTL/OpenShiva/examples/SuperNova.shiva	2008-12-18 21:37:41 UTC (rev 546)
+++ trunk/OpenGTL/OpenShiva/examples/SuperNova.shiva	2008-12-18 21:37:57 UTC (rev 547)
@@ -1,3 +1,48 @@
+
+<
+  parameters: <
+    colors: <
+      color1: <
+        type: rgba;
+        defaultValue: { 0.1, 0.1, 0.2, 1.0 };
+      >;
+      color2: <
+        type: rgba;
+        defaultValue: { 0.2, 0.2, 0.4, 1.0 };
+      >;
+      colorCenter: <
+        type: rgba;
+        defaultValue: { 0.9, 0.9, 1.0, 1.0 };
+      >;
+    >;
+    xcenter: <
+      label: "Center x";
+      type: float;
+    >;
+    ycenter: <
+      label: "Center y";
+      type: float;
+    >;
+    phase: <
+      label: "Phase";
+      type: float;
+      minValue: 0.1;
+      defaultValue: 30.0;
+      maxValue: 100.0;
+    >;
+    radiusp: <
+      label: "Inner Radius";
+      type: float;
+      defaultValue: 0.01;
+    >;
+    color2radiusp: <
+      label: "Outter Radius";
+      type: float;
+      defaultValue: 0.02;
+    >;
+  >;
+>;
+
 kernel SuperNova
 {
   const float width = 1000.0;
@@ -2,10 +47,7 @@
   const float height = 1000.0;
-  const float2 center = { width/2.0, height/2.0 };
+  const float wh = 0.25 * (width + height);
+  const float2 center = { width * xcenter, height * ycenter };
   const float PI = 3.14159265;
-  const float4 color1 = { 0.1, 0.1, 0.2, 1.0 };
-  const float4 color2 = { 0.2, 0.2, 0.4, 1.0 };
-  const float4 colorCenter = { 0.9, 0.9, 1.0, 1.0 };
-  const float phase = 30.0;
-  const float radius = 20.0;
-  const float color2radius = 10.0;
+  const float radius = radiusp * wh;
+  const float color2radius = color2radiusp * wh;
   float length( float2 v)


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