diff options
author | hwc487 | 2012-03-30 06:23:53 -0700 |
---|---|---|
committer | hwc487 | 2012-03-30 06:23:53 -0700 |
commit | 947bad893335e1023bcbe177ff8db454c27c4bf8 (patch) | |
tree | 8e4ab2a709e638f21b50f55b6e1842699b46accc /js/lib | |
parent | 2ab7fbef0df37f0c2bb6a4447f03993b9d50b5d0 (diff) | |
download | ninja-947bad893335e1023bcbe177ff8db454c27c4bf8.tar.gz |
converted materials to new texture structure
Diffstat (limited to 'js/lib')
-rw-r--r-- | js/lib/rdge/materials/deform-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/fly-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/julia-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/keleidoscope-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/mandel-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/pulse-material.js | 8 | ||||
-rw-r--r-- | js/lib/rdge/materials/square-tunnel-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/star-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/tunnel-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/twist-material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/water-material.js | 4 | ||||
-rw-r--r-- | js/lib/rdge/materials/z-invert-material.js | 5 |
12 files changed, 59 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index dfd89d12..c7bfe67a 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var DeformMaterial = function DeformMaterial() { | 10 | var DeformMaterial = function DeformMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -68,6 +69,10 @@ var DeformMaterial = function DeformMaterial() { | |||
68 | this._shader['default'].u_time.set( [this._time] ); | 69 | this._shader['default'].u_time.set( [this._time] ); |
69 | } | 70 | } |
70 | 71 | ||
72 | // set up the texture | ||
73 | var texMapName = this._propValues[this._propNames[0]]; | ||
74 | this._glTex = new Texture( world, texMapName ); | ||
75 | |||
71 | // set the shader values in the shader | 76 | // set the shader values in the shader |
72 | this.updateTexture(); | 77 | this.updateTexture(); |
73 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 78 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
diff --git a/js/lib/rdge/materials/fly-material.js b/js/lib/rdge/materials/fly-material.js index bd92ecd8..81cd1522 100644 --- a/js/lib/rdge/materials/fly-material.js +++ b/js/lib/rdge/materials/fly-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var FlyMaterial = function FlyMaterial() { | 10 | var FlyMaterial = function FlyMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -61,6 +62,10 @@ var FlyMaterial = function FlyMaterial() { | |||
61 | this._shader['default'].u_time.set( [this._time] ); | 62 | this._shader['default'].u_time.set( [this._time] ); |
62 | } | 63 | } |
63 | 64 | ||
65 | // set up the texture | ||
66 | var texMapName = this._propValues[this._propNames[0]]; | ||
67 | this._glTex = new Texture( world, texMapName ); | ||
68 | |||
64 | // set the shader values in the shader | 69 | // set the shader values in the shader |
65 | this.updateTexture(); | 70 | this.updateTexture(); |
66 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 71 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
diff --git a/js/lib/rdge/materials/julia-material.js b/js/lib/rdge/materials/julia-material.js index a85bd6f7..c1eb2b6d 100644 --- a/js/lib/rdge/materials/julia-material.js +++ b/js/lib/rdge/materials/julia-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var JuliaMaterial = function JuliaMaterial() { | 10 | var JuliaMaterial = function JuliaMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -59,6 +60,10 @@ var JuliaMaterial = function JuliaMaterial() { | |||
59 | this._shader['default'].u_time.set( [this._time] ); | 60 | this._shader['default'].u_time.set( [this._time] ); |
60 | } | 61 | } |
61 | 62 | ||
63 | // set up the texture | ||
64 | var texMapName = this._propValues[this._propNames[0]]; | ||
65 | this._glTex = new Texture( world, texMapName ); | ||
66 | |||
62 | // set the shader values in the shader | 67 | // set the shader values in the shader |
63 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 68 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
64 | this.update( 0 ); | 69 | this.update( 0 ); |
diff --git a/js/lib/rdge/materials/keleidoscope-material.js b/js/lib/rdge/materials/keleidoscope-material.js index 16d1ccfa..a687bd59 100644 --- a/js/lib/rdge/materials/keleidoscope-material.js +++ b/js/lib/rdge/materials/keleidoscope-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var KeleidoscopeMaterial = function KeleidoscopeMaterial() { | 10 | var KeleidoscopeMaterial = function KeleidoscopeMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -68,6 +69,10 @@ var KeleidoscopeMaterial = function KeleidoscopeMaterial() { | |||
68 | this._shader['default'].u_time.set( [this._time] ); | 69 | this._shader['default'].u_time.set( [this._time] ); |
69 | } | 70 | } |
70 | 71 | ||
72 | // set up the texture | ||
73 | var texMapName = this._propValues[this._propNames[0]]; | ||
74 | this._glTex = new Texture( world, texMapName ); | ||
75 | |||
71 | // set the shader values in the shader | 76 | // set the shader values in the shader |
72 | this.updateTexture(); | 77 | this.updateTexture(); |
73 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 78 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
diff --git a/js/lib/rdge/materials/mandel-material.js b/js/lib/rdge/materials/mandel-material.js index e7b105e1..4babe239 100644 --- a/js/lib/rdge/materials/mandel-material.js +++ b/js/lib/rdge/materials/mandel-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var MandelMaterial = function MandelMaterial() { | 10 | var MandelMaterial = function MandelMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -70,6 +71,10 @@ var MandelMaterial = function MandelMaterial() { | |||
70 | this._shader['default'].u_time.set( [this._time] ); | 71 | this._shader['default'].u_time.set( [this._time] ); |
71 | } | 72 | } |
72 | 73 | ||
74 | // set up the texture | ||
75 | var texMapName = this._propValues[this._propNames[0]]; | ||
76 | this._glTex = new Texture( world, texMapName ); | ||
77 | |||
73 | // set the shader values in the shader | 78 | // set the shader values in the shader |
74 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 79 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
75 | this.update( 0 ); | 80 | this.update( 0 ); |
diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js index b12e9dd5..f7f6c7ae 100644 --- a/js/lib/rdge/materials/pulse-material.js +++ b/js/lib/rdge/materials/pulse-material.js | |||
@@ -4,8 +4,9 @@ | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | var Material = require("js/lib/rdge/materials/material").Material; | 7 | var Material = require("js/lib/rdge/materials/material").Material; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
9 | |||
9 | /////////////////////////////////////////////////////////////////////// | 10 | /////////////////////////////////////////////////////////////////////// |
10 | // Class GLMaterial | 11 | // Class GLMaterial |
11 | // RDGE representation of a material. | 12 | // RDGE representation of a material. |
@@ -24,8 +25,8 @@ var PulseMaterial = function PulseMaterial() | |||
24 | this._name = "PulseMaterial"; | 25 | this._name = "PulseMaterial"; |
25 | this._shaderName = "pulse"; | 26 | this._shaderName = "pulse"; |
26 | 27 | ||
27 | this._texMap = 'assets/images/cubelight.png'; | 28 | //this._texMap = 'assets/images/cubelight.png'; |
28 | //this._texMap = 'texture'; | 29 | this._texMap = 'texture'; |
29 | 30 | ||
30 | this._time = 0.0; | 31 | this._time = 0.0; |
31 | this._dTime = 0.01; | 32 | this._dTime = 0.01; |
@@ -117,6 +118,7 @@ var PulseMaterial = function PulseMaterial() | |||
117 | this._shader['default'].u_time.set( [this._time] ); | 118 | this._shader['default'].u_time.set( [this._time] ); |
118 | } | 119 | } |
119 | 120 | ||
121 | // set up the texture | ||
120 | var texMapName = this._propValues[this._propNames[0]]; | 122 | var texMapName = this._propValues[this._propNames[0]]; |
121 | this._glTex = new Texture( world, texMapName ); | 123 | this._glTex = new Texture( world, texMapName ); |
122 | 124 | ||
diff --git a/js/lib/rdge/materials/square-tunnel-material.js b/js/lib/rdge/materials/square-tunnel-material.js index 9264872f..6e987fdc 100644 --- a/js/lib/rdge/materials/square-tunnel-material.js +++ b/js/lib/rdge/materials/square-tunnel-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 7 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
8 | var Texture = require("js/lib/rdge/texture").Texture; | ||
8 | 9 | ||
9 | var SquareTunnelMaterial = function SquareTunnelMaterial() { | 10 | var SquareTunnelMaterial = function SquareTunnelMaterial() { |
10 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
@@ -63,6 +64,10 @@ var SquareTunnelMaterial = function SquareTunnelMaterial() { | |||
63 | this._shader['default'].u_time.set( [this._time] ); | 64 | this._shader['default'].u_time.set( [this._time] ); |
64 | } | 65 | } |
65 | 66 | ||
67 | // set up the texture | ||
68 | var texMapName = this._propValues[this._propNames[0]]; | ||
69 | this._glTex = new Texture( world, texMapName ); | ||
70 | |||
66 | // set the shader values in the shader | 71 | // set the shader values in the shader |
67 | this.updateTexture(); | 72 | this.updateTexture(); |
68 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | 73 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); |
diff --git a/js/lib/rdge/materials/star-material.js b/js/lib/rdge/materials/star-material.js index d7d797e4..1506927b 100644 --- a/js/lib/rdge/materials/star-material.js +++ b/js/lib/rdge/materials/star-material.js | |||
@@ -5,6 +5,7 @@ | |||