aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/helper-classes/backup-delete/Materials/PlasmaMaterial.js')
-rw-r--r--js/helper-classes/backup-delete/Materials/PlasmaMaterial.js134
1 files changed, 0 insertions, 134 deletions
diff --git a/js/helper-classes/backup-delete/Materials/PlasmaMaterial.js b/js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
deleted file mode 100644
index a65f3a33..00000000
--- a/js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
+++ /dev/null
@@ -1,134 +0,0 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7///////////////////////////////////////////////////////////////////////
8// Class GLMaterial
9// RDGE representation of a material.
10///////////////////////////////////////////////////////////////////////
11function PlasmaMaterial()
12{
13 // initialize the inherited members
14 this.inheritedFrom = GLMaterial;
15 this.inheritedFrom();
16
17 ///////////////////////////////////////////////////////////////////////
18 // Instance variables
19 ///////////////////////////////////////////////////////////////////////
20 this._name = "PlasmaMaterial";
21 this._shaderName = "plasma";
22
23 this._time = 0.0;
24 this._dTime = 0.01;
25 this._speed = 1.0;
26
27 this._color = [1,0,0,1];
28
29
30 ///////////////////////////////////////////////////////////////////////
31 // Property Accessors
32 ///////////////////////////////////////////////////////////////////////
33 this.getShaderName = function() { return this._shaderName; }
34
35 this.isAnimated = function() { return true; }
36
37 ///////////////////////////////////////////////////////////////////////
38 // Material Property Accessors
39 ///////////////////////////////////////////////////////////////////////
40 this._propNames = ["color"];
41 this._propLabels = ["Color"];
42 this._propTypes = ["color"];
43 this._propValues = [];
44
45 this._propValues[ this._propNames[0] ] = this._color;
46
47 this.setProperty = function( prop, value )
48 {
49 // make sure we have legitimate imput
50 if (this.validateProperty( prop, value ))
51 {
52 this._color = value.slice(0);
53 this._shader.default[prop].set(value);
54 }
55 }
56 ///////////////////////////////////////////////////////////////////////
57
58 ///////////////////////////////////////////////////////////////////////
59 // Methods
60 ///////////////////////////////////////////////////////////////////////
61 // duplcate method requirde
62 this.dup = function() { return new PlasmaMaterial(); }
63
64 this.init = function()
65 {
66 // set up the shader
67 this._shader = new jshader();
68 this._shader.def = plasmaShaderDef;
69 this._shader.init();
70
71 // set the default value
72 this._time = 0;
73 this._shader.default.u_time = this._time;
74 this.setProperty( "color", [this._time, 0, 0, 1] );
75
76 // set up the material node
77 this._materialNode = createMaterialNode("plasmaMaterial");
78 this._materialNode.setShader(this._shader);
79 }
80
81 this.update = function( time )
82 {
83 this._shader.default.u_time = this._time;
84 var color = this.getProperty( "color" );
85 color[0] = this._time;
86 this.setProperty( "color", color );
87 //console.log( "update color to: " + color );
88 this._time += this._dTime;
89 }
90
91}
92
93///////////////////////////////////////////////////////////////////////////////////////
94// RDGE shader
95
96// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
97var plasmaShaderDef =
98{'shaders':
99 {
100 'defaultVShader':"assets/shaders/plasma.vert.glsl",
101 'defaultFShader':"assets/shaders/plasma.frag.glsl",
102 },
103 'techniques':
104 {
105 'default':
106 [
107 {
108 'vshader' : 'defaultVShader',
109 'fshader' : 'defaultFShader',
110 // attributes
111 'attributes' :
112 {
113 'vert' : { 'type' : 'vec3' },
114 'normal' : { 'type' : 'vec3' },
115 'texcoord' : { 'type' : 'vec2' },
116 },
117 // parameters
118 'params' :
119 {
120 'u_time' : { 'type' : 'float' },
121 'color' : { 'type' : 'vec4' }
122 },
123
124 // render states
125 'states' :
126 {
127 'depthEnable' : true,
128 'offset':[1.0, 0.1]
129 },
130 },
131 ]
132 }
133};
134