aboutsummaryrefslogtreecommitdiff
path: root/js/models/materials-model.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/models/materials-model.js')
-rwxr-xr-xjs/models/materials-model.js68
1 files changed, 39 insertions, 29 deletions
diff --git a/js/models/materials-model.js b/js/models/materials-model.js
index 44364aa2..20ef317a 100755
--- a/js/models/materials-model.js
+++ b/js/models/materials-model.js
@@ -16,12 +16,14 @@ var LinearGradientMaterial = require("js/lib/rdge/materials/linear-gradient-mate
16var RadialGradientMaterial = require("js/lib/rdge/materials/radial-gradient-material").RadialGradientMaterial; 16var RadialGradientMaterial = require("js/lib/rdge/materials/radial-gradient-material").RadialGradientMaterial;
17var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial; 17var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial;
18var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial; 18var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial;
19var CloudMaterial = require("js/lib/rdge/materials/cloud-material").CloudMaterial;
19var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial; 20var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial;
20var RaidersMaterial = require("js/lib/rdge/materials/radial-blur-material").RaidersMaterial; 21var RaidersMaterial = require("js/lib/rdge/materials/radial-blur-material").RaidersMaterial;
21var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial; 22var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial;
22var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; 23var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial;
23var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial; 24var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial;
24var ReliefTunnelMaterial = require("js/lib/rdge/materials/relief-tunnel-material").ReliefTunnelMaterial; 25var ReliefTunnelMaterial = require("js/lib/rdge/materials/relief-tunnel-material").ReliefTunnelMaterial;
26var FlagMaterial = require("js/lib/rdge/materials/flag-material").FlagMaterial;
25var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial; 27var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial;
26var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial; 28var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial;
27var WaterMaterial = require("js/lib/rdge/materials/water-material").WaterMaterial; 29var WaterMaterial = require("js/lib/rdge/materials/water-material").WaterMaterial;
@@ -30,6 +32,8 @@ var ZInvertMaterial = require("js/lib/rdge/materials/z-invert-material").ZInvert
30var DeformMaterial = require("js/lib/rdge/materials/deform-material").DeformMaterial; 32var DeformMaterial = require("js/lib/rdge/materials/deform-material").DeformMaterial;
31var StarMaterial = require("js/lib/rdge/materials/star-material").StarMaterial; 33var StarMaterial = require("js/lib/rdge/materials/star-material").StarMaterial;
32var TwistMaterial = require("js/lib/rdge/materials/twist-material").TwistMaterial; 34var TwistMaterial = require("js/lib/rdge/materials/twist-material").TwistMaterial;
35var TwistVertMaterial = require("js/lib/rdge/materials/twist-vert-material").TwistVertMaterial;
36var TaperMaterial = require("js/lib/rdge/materials/taper-material").TaperMaterial;
33var JuliaMaterial = require("js/lib/rdge/materials/julia-material").JuliaMaterial; 37var JuliaMaterial = require("js/lib/rdge/materials/julia-material").JuliaMaterial;
34var KeleidoscopeMaterial = require("js/lib/rdge/materials/keleidoscope-material").KeleidoscopeMaterial; 38var KeleidoscopeMaterial = require("js/lib/rdge/materials/keleidoscope-material").KeleidoscopeMaterial;
35var MandelMaterial = require("js/lib/rdge/materials/mandel-material").MandelMaterial; 39var MandelMaterial = require("js/lib/rdge/materials/mandel-material").MandelMaterial;
@@ -41,33 +45,37 @@ exports.MaterialsModel = Montage.create(Component, {
41 value: false 45 value: false
42 }, 46 },
43 47
44 deserializedFromTemplate: { 48 deserializedFromTemplate: {
45 value: function() { 49 value: function() {
46 // Load all the materials 50 // Load all the materials
47 this.addMaterial(new FlatMaterial()); 51 this.addMaterial(new BumpMetalMaterial());
48 this.addMaterial(new LinearGradientMaterial()); 52 this.addMaterial(new CloudMaterial());
49 this.addMaterial(new RadialGradientMaterial()); 53 this.addMaterial(new DeformMaterial());
50 this.addMaterial(new BumpMetalMaterial()); 54 this.addMaterial(new FlagMaterial());
51 this.addMaterial(new UberMaterial()); 55 this.addMaterial(new FlatMaterial());
52 this.addMaterial(new RadialBlurMaterial()); 56 this.addMaterial(new FlyMaterial());
53 this.addMaterial(new RaidersMaterial()); 57 this.addMaterial(new JuliaMaterial());
54 this.addMaterial(new PlasmaMaterial()); 58 this.addMaterial(new KeleidoscopeMaterial());
55 this.addMaterial(new PulseMaterial()); 59 this.addMaterial(new LinearGradientMaterial());
56 this.addMaterial(new TunnelMaterial()); 60 this.addMaterial(new MandelMaterial());
57 this.addMaterial(new ReliefTunnelMaterial()); 61 this.addMaterial(new PlasmaMaterial());
58 this.addMaterial(new SquareTunnelMaterial()); 62 this.addMaterial(new PulseMaterial());
59 this.addMaterial(new FlyMaterial()); 63 this.addMaterial(new ParisMaterial());
60 this.addMaterial(new WaterMaterial()); 64 this.addMaterial(new RadialGradientMaterial());
61 this.addMaterial(new ParisMaterial()); 65 this.addMaterial(new RadialBlurMaterial());
62 this.addMaterial(new ZInvertMaterial()); 66 this.addMaterial(new RaidersMaterial());
63 this.addMaterial(new DeformMaterial()); 67 this.addMaterial(new ReliefTunnelMaterial());
64 this.addMaterial(new StarMaterial()); 68 this.addMaterial(new SquareTunnelMaterial());
65 this.addMaterial(new TwistMaterial()); 69 this.addMaterial(new StarMaterial());
66 this.addMaterial(new JuliaMaterial()); 70 this.addMaterial(new TaperMaterial());
67 this.addMaterial(new KeleidoscopeMaterial()); 71 this.addMaterial(new TunnelMaterial());
68 this.addMaterial(new MandelMaterial()); 72 this.addMaterial(new TwistMaterial());
69 } 73 this.addMaterial(new TwistVertMaterial());
70 }, 74 this.addMaterial(new WaterMaterial());
75 this.addMaterial(new ZInvertMaterial());
76 this.addMaterial(new UberMaterial());
77 }
78 },
71 79
72 _materials : { 80 _materials : {
73 value: AppModel.materials 81 value: AppModel.materials
@@ -116,7 +124,7 @@ exports.MaterialsModel = Montage.create(Component, {
116 value: function (materialName) { 124 value: function (materialName) {
117 var index = this.getIndexOfMaterial(materialName); 125 var index = this.getIndexOfMaterial(materialName);
118 if(index !== -1) { 126 if(index !== -1) {
119 return this._materials[index].dup(); 127 return this._materials[index];
120 } 128 }
121 } 129 }
122 }, 130 },
@@ -127,7 +135,7 @@ exports.MaterialsModel = Montage.create(Component, {
127 { 135 {
128 var index = this.getIndexOfMaterialByShader( shaderName ); 136 var index = this.getIndexOfMaterialByShader( shaderName );
129 if (index >= 0) 137 if (index >= 0)
130 return this._materials[index].dup(); 138 return this._materials[index];
131 } 139 }
132 }, 140 },
133 141
@@ -226,6 +234,7 @@ exports.MaterialsModel = Montage.create(Component, {
226 case "radialGradient": mat = new RadialGradientMaterial(); break; 234 case "radialGradient": mat = new RadialGradientMaterial(); break;
227 case "bumpMetal": mat = new BumpMetalMaterial(); break; 235 case "bumpMetal": mat = new BumpMetalMaterial(); break;
228 case "uber": mat = new UberMaterial(); break; 236 case "uber": mat = new UberMaterial(); break;
237 case "cloud": mat = new CloudMaterial(); break;
229 238
230 case "taper": mat = new TaperMaterial(); break; 239 case "taper": mat = new TaperMaterial(); break;
231 case "twistVert": mat = new TwistVertMaterial(); break; 240 case "twistVert": mat = new TwistVertMaterial(); break;
@@ -235,6 +244,7 @@ exports.MaterialsModel = Montage.create(Component, {
235 case "tunnel": mat = new TunnelMaterial(); break; 244 case "tunnel": mat = new TunnelMaterial(); break;
236 case "reliefTunnel": mat = new ReliefTunnelMaterial(); break; 245 case "reliefTunnel": mat = new ReliefTunnelMaterial(); break;
237 case "squareTunnel": mat = new SquareTunnelMaterial(); break; 246 case "squareTunnel": mat = new SquareTunnelMaterial(); break;
247 case "flag": mat = new FlagMaterial(); break;
238 case "fly": mat = new FlyMaterial(); break; 248 case "fly": mat = new FlyMaterial(); break;
239 case "water": mat = new WaterMaterial(); break; 249 case "water": mat = new WaterMaterial(); break;
240 case "paris": mat = new ParisMaterial(); break; 250 case "paris": mat = new ParisMaterial(); break;