seed r109 - in trunk/examples: . shader
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r109 - in trunk/examples: . shader
- Date: Tue, 4 Nov 2008 11:57:23 +0000 (UTC)
Author: racarr
Date: Tue Nov 4 11:57:23 2008
New Revision: 109
URL: http://svn.gnome.org/viewvc/seed?rev=109&view=rev
Log:
Some example clean up, in the never ending march towards release.
Modified:
trunk/examples/clutter.js
trunk/examples/notify-test.js
trunk/examples/shader/default.glsl
Modified: trunk/examples/clutter.js
==============================================================================
--- trunk/examples/clutter.js (original)
+++ trunk/examples/clutter.js Tue Nov 4 11:57:23 2008
@@ -77,11 +77,11 @@
text.x = stage.width/2;
text.y = stage.height/2;
- (Clutter.effect_fade(effect,text,0)).signal_completed.connect(
- Clutter.main_quit);
+ Clutter.effect_fade(effect,text,0);
for (i in rectangles)
{
- Clutter.effect_fade(effect, rectangles[i], 0);
+ Clutter.effect_move(effect, rectangles[i], Math.random()*stage.width,
+ Math.random()*stage.height);
}
});
Modified: trunk/examples/notify-test.js
==============================================================================
--- trunk/examples/notify-test.js (original)
+++ trunk/examples/notify-test.js Tue Nov 4 11:57:23 2008
@@ -9,11 +9,12 @@
{
var notification =
new Notify.Notification({summary: "File Notification",
- body : "This is a poor libnotify example" });
+ body : "It's not clear what notification system this file is providing an example of." });
notification.set_timeout(5000);
notification.show();
}
+Seed.print("Monitoring files in current directory");
Notify.init("Seed Test!");
file = Gio.file_new_for_path(".");
Modified: trunk/examples/shader/default.glsl
==============================================================================
--- trunk/examples/shader/default.glsl (original)
+++ trunk/examples/shader/default.glsl Tue Nov 4 11:57:23 2008
@@ -1,11 +1,24 @@
-uniform sampler2D sampler0;
-
-void main(void)
+uniform float radius = 10;
+uniform sampler2D rectTexture;
+uniform float x_step = 0.0001, y_step = 0.0001;
+
+void main()
{
- vec4 sample;
- sample = texture2D(sampler0,
- gl_TexCoord[0].st);
- gl_FragColor = 1-sample;
- gl_FragColor.a = gl_Color.a;
-}
-
+ vec4 color = texture2D(rectTexture, gl_TexCoord[0].st);
+ float u;
+ float v;
+ int count = 1;
+ for (u=-radius;u<radius;u++)
+ for (v=-radius;v<radius;v++)
+ {
+ color += texture2D(rectTexture,
+ vec2(gl_TexCoord[0].s + u
+ * 2.0 * x_step,
+ gl_TexCoord[0].t + v
+ * 2.0 * y_step));
+ count ++;
+ }
+
+ gl_FragColor = color / float(count);
+ gl_FragColor = gl_FragColor * gl_Color;
+}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]