aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-19 15:59:38 -0700
committerValerio Virgillito2012-07-19 15:59:38 -0700
commitb05137f559b6445017973d550fab5e43d6f4df57 (patch)
tree6554afcb8c3b8d83d1e9bb33241e239773f396e8
parentfc13ef1e806116bb7ece5bb06604fa4f5714a6ed (diff)
parent431b6fa7610e59074b4ebb3e9e712672f185b8ad (diff)
downloadninja-b05137f559b6445017973d550fab5e43d6f4df57.tar.gz
Merge branch 'RadialBlur' of https://github.com/ericmueller/ninja
-rw-r--r--assets/canvas-runtime.js4
-rw-r--r--assets/descriptor.json6
-rw-r--r--assets/images/bluesky.png (renamed from assets/images/paris.png)bin4108 -> 4108 bytes
-rw-r--r--assets/images/darkblur.png (renamed from assets/images/raiders.png)bin5674 -> 5674 bytes
-rw-r--r--assets/shaders/Paris.frag.glsl68
-rw-r--r--js/io/system/ninjalibrary.json2
-rwxr-xr-xjs/lib/geom/geom-obj.js4
-rw-r--r--js/lib/rdge/materials/radial-blur-material.js14
-rw-r--r--js/lib/rdge/materials/water-material.js14
-rwxr-xr-xjs/models/materials-model.js18
-rw-r--r--js/panels/Materials/materials-data.json18
11 files changed, 44 insertions, 104 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js
index 4ab377c6..4181dd89 100644
--- a/assets/canvas-runtime.js
+++ b/assets/canvas-runtime.js
@@ -635,11 +635,11 @@ NinjaCvsRt.RuntimeGeomObj = Object.create(Object.prototype, {
635 case "plasma": mat = Object.create(NinjaCvsRt.RuntimePlasmaMaterial, {}); break; 635 case "plasma": mat = Object.create(NinjaCvsRt.RuntimePlasmaMaterial, {}); break;
636 case "taper": mat = Object.create(NinjaCvsRt.RuntimeTaperMaterial, {}); break; 636 case "taper": mat = Object.create(NinjaCvsRt.RuntimeTaperMaterial, {}); break;
637 637
638 case "paris": 638 case "blueSky":
639 case "water": mat = Object.create(NinjaCvsRt.RuntimeWaterMaterial, {}); break; 639 case "water": mat = Object.create(NinjaCvsRt.RuntimeWaterMaterial, {}); break;
640 640
641 case "deform": 641 case "deform":
642 case "raiders": 642 case "darkBlur":
643 case "tunnel": 643 case "tunnel":
644 case "reliefTunnel": 644 case "reliefTunnel":
645 case "squareTunnel": 645 case "squareTunnel":
diff --git a/assets/descriptor.json b/assets/descriptor.json
index d9d74e6b..db824387 100644
--- a/assets/descriptor.json
+++ b/assets/descriptor.json
@@ -20,9 +20,9 @@
20 "images/cubelight.png", 20 "images/cubelight.png",
21 "images/random_normal.png", 21 "images/random_normal.png",
22 "images/white.png", 22 "images/white.png",
23 "images/paris.png", 23 "images/bluesky.png",
24 "images/powderblue.png", 24 "images/powderblue.png",
25 "images/raiders.png", 25 "images/darkblur.png",
26 "images/us_flag.png", 26 "images/us_flag.png",
27 "shaders/Basic.frag.glsl", 27 "shaders/Basic.frag.glsl",
28 "shaders/TwistVert.vert.glsl", 28 "shaders/TwistVert.vert.glsl",
@@ -34,9 +34,9 @@
34 "shaders/linearGradient.frag.glsl", 34 "shaders/linearGradient.frag.glsl",
35 "shaders/linearGradient.vert.glsl", 35 "shaders/linearGradient.vert.glsl",
36 "shaders/plasma.frag.glsl", 36 "shaders/plasma.frag.glsl",
37 "shaders/Paris.frag.glsl",
38 "shaders/plasma.vert.glsl", 37 "shaders/plasma.vert.glsl",
39 "shaders/Pulse.frag.glsl", 38 "shaders/Pulse.frag.glsl",
39 "shaders/radialBlur.frag.glsl",
40 "shaders/radialGradient.frag.glsl", 40 "shaders/radialGradient.frag.glsl",
41 "shaders/radialGradient.vert.glsl", 41 "shaders/radialGradient.vert.glsl",
42 "shaders/test_fshader.glsl", 42 "shaders/test_fshader.glsl",
diff --git a/assets/images/paris.png b/assets/images/bluesky.png
index b7ef6c7b..b7ef6c7b 100644
--- a/assets/images/paris.png
+++ b/assets/images/bluesky.png
Binary files differ
diff --git a/assets/images/raiders.png b/assets/images/darkblur.png
index 64c39c89..64c39c89 100644
--- a/assets/images/raiders.png
+++ b/assets/images/darkblur.png
Binary files differ
diff --git a/assets/shaders/Paris.frag.glsl b/assets/shaders/Paris.frag.glsl
deleted file mode 100644
index 690b1453..00000000
--- a/assets/shaders/Paris.frag.glsl
+++ /dev/null
@@ -1,68 +0,0 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4
5uniform sampler2D u_tex0;
6uniform float u_time;
7uniform vec2 u_resolution;
8const float PI = 3.1415926535897932;
9
10//speed
11
12const float speed = 0.1;
13const float speed_x = 0.075;
14const float speed_y = 0.000;
15
16// geometry
17const float intensity = 1.5;
18const int steps = 8;
19//const float frequency = 4.0;
20const float frequency = 2.0;
21const int angle = 7; // better when a prime
22
23// reflection and emboss
24const float delta = 20.;
25const float intence = 400.;
26const float emboss = 0.3;
27
28//---------- crystals effect
29
30 float col(vec2 coord)
31 {
32 float delta_theta = 2.0 * PI / float(angle);
33 float col = 0.0;
34 float theta = 0.0;
35 for (int i = 0; i < steps; i++)
36 {
37 vec2 adjc = coord;
38 theta = delta_theta*float(i);
39 adjc.x += cos(theta)*u_time*speed + u_time * speed_x;
40 adjc.y -= sin(theta)*u_time*speed - u_time * speed_y;
41 col = col + cos( (adjc.x*cos(theta) - adjc.y*sin(theta))*frequency)*intensity;
42 }
43
44 return cos(col);
45 }
46
47//---------- main
48
49void main(void)
50{
51vec2 p = (gl_FragCoord.xy) / u_resolution.xy, c1 = p, c2 = p;
52float cc1 = col(c1);
53
54c2.x += u_resolution.x/delta;
55float dx = emboss*(cc1-col(c2))/delta;
56
57c2.x = p.x;
58c2.y += u_resolution.y/delta;
59float dy = emboss*(cc1-col(c2))/delta;
60
61c1.x += dx;
62c1.y = -(c1.y+dy);
63
64float alpha = 1.+dot(dx,dy)*intence;
65gl_FragColor = texture2D(u_tex0,c1)*(alpha);
66// gl_FragColor = vec4(col(p),0,0,1);
67
68}
diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json
index bbf53144..6b74b04f 100644
--- a/js/io/system/ninjalibrary.json
+++ b/js/io/system/ninjalibrary.json
@@ -1,6 +1,6 @@
1{ 1{
2 "libraries": [ 2 "libraries": [
3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.11.2.1"}, 3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.11.2.1"},
4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.6.0.4"} 4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.6.0.5"}
5 ] 5 ]
6} \ No newline at end of file 6} \ No newline at end of file
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index 3cd3a89b..e0ed51fb 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -385,8 +385,8 @@ exports.GeomObj = Object.create(Object.prototype, {
385 case "plasma": 385 case "plasma":
386 case "deform": 386 case "deform":
387 case "water": 387 case "water":
388 case "paris": 388 case "blueSky":
389 case "raiders": 389 case "darkBlur":
390 case "tunnel": 390 case "tunnel":
391 case "reliefTunnel": 391 case "reliefTunnel":
392 case "squareTunnel": 392 case "squareTunnel":
diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js
index 1f89f79e..2d26638b 100644
--- a/js/lib/rdge/materials/radial-blur-material.js
+++ b/js/lib/rdge/materials/radial-blur-material.js
@@ -176,22 +176,22 @@ var radialBlurMaterialDef =
176}; 176};
177 177
178 178
179var RaidersMaterial = function RaidersMaterial() { 179var DarkBlurMaterial = function DarkBlurMaterial() {
180 // initialize the inherited members 180 // initialize the inherited members
181 this.inheritedFrom = RadialBlurMaterial; 181 this.inheritedFrom = RadialBlurMaterial;
182 this.inheritedFrom(); 182 this.inheritedFrom();
183 183
184 this._name = "Raiders"; 184 this._name = "Dark Blur";
185 this._shaderName = "raiders"; 185 this._shaderName = "darkBlur";
186 186
187 this._texMap = 'assets/images/raiders.png'; 187 this._texMap = 'assets/images/darkblur.png';
188 this._propValues[this._propNames[0]] = this._texMap.slice(0); 188 this._propValues[this._propNames[0]] = this._texMap.slice(0);
189 189
190 190
191 // duplicate method required 191 // duplicate method required
192 this.dup = function (world) { 192 this.dup = function (world) {
193 // allocate a new uber material 193 // allocate a new uber material
194 var newMat = new RaidersMaterial(); 194 var newMat = new DarkBlurMaterial();
195 195
196 // copy over the current values; 196 // copy over the current values;
197 var propNames = [], propValues = [], propTypes = [], propLabels = []; 197 var propNames = [], propValues = [], propTypes = [], propLabels = [];
@@ -204,10 +204,10 @@ var RaidersMaterial = function RaidersMaterial() {
204 }; 204 };
205} 205}
206 206
207RaidersMaterial.prototype = new Material(); 207DarkBlurMaterial.prototype = new Material();
208 208
209if (typeof exports === "object") { 209if (typeof exports === "object") {
210 exports.RaidersMaterial = RaidersMaterial; 210 exports.DarkBlurMaterial = DarkBlurMaterial;
211} 211}
212 212
213 213
diff --git a/js/lib/rdge/materials/water-material.js b/js/lib/rdge/materials/water-material.js
index c7e7313c..9997244c 100644
--- a/js/lib/rdge/materials/water-material.js
+++ b/js/lib/rdge/materials/water-material.js
@@ -165,16 +165,16 @@ var waterMaterialDef =
165 } 165 }
166}; 166};
167 167
168var ParisMaterial = function ParisMaterial() 168var BlueSkyMaterial = function BlueSkyMaterial()
169{ 169{
170