diff options
author | Jonathan Duran | 2012-03-15 13:46:53 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-03-15 13:46:53 -0700 |
commit | cc57a3dff8f504526bbf41a8b01c412c4788424a (patch) | |
tree | 9127331e952ef1da6faa331ec0bb49ea3acfb980 /js/helper-classes/backup-delete/Materials/StarMaterial.js | |
parent | 0893ba7f5d1f03099c7b5f8c53ce750e412023cd (diff) | |
parent | e6bfd7fb3d3324bea5dbc05350832a9e25c6c00d (diff) | |
download | ninja-cc57a3dff8f504526bbf41a8b01c412c4788424a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Conflicts:
js/controllers/selection-controller.js
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/helper-classes/backup-delete/GLBrushStroke.js
js/helper-classes/backup-delete/GLCircle.js
js/helper-classes/backup-delete/GLGeomObj.js
js/helper-classes/backup-delete/GLRectangle.js
js/helper-classes/backup-delete/GLSubpath.js
js/helper-classes/backup-delete/GLWorld.js
js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
js/helper-classes/backup-delete/Materials/DeformMaterial.js
js/helper-classes/backup-delete/Materials/FlatMaterial.js
js/helper-classes/backup-delete/Materials/FlyMaterial.js
js/helper-classes/backup-delete/Materials/JuliaMaterial.js
js/helper-classes/backup-delete/Materials/KeleidoscopeMaterial.js
js/helper-classes/backup-delete/Materials/LinearGradientMaterial.js
js/helper-classes/backup-delete/Materials/MandelMaterial.js
js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
js/helper-classes/backup-delete/Materials/PulseMaterial.js
js/helper-classes/backup-delete/Materials/RadialBlurMaterial.js
js/helper-classes/backup-delete/Materials/RadialGradientMaterial.js
js/helper-classes/backup-delete/Materials/ReliefTunnelMaterial.js
js/helper-classes/backup-delete/Materials/SquareTunnelMaterial.js
js/helper-classes/backup-delete/Materials/StarMaterial.js
js/helper-classes/backup-delete/Materials/TaperMaterial.js
js/helper-classes/backup-delete/Materials/TunnelMaterial.js
js/helper-classes/backup-delete/Materials/TwistMaterial.js
js/helper-classes/backup-delete/Materials/TwistVertMaterial.js
js/helper-classes/backup-delete/Materials/UberMaterial.js
js/helper-classes/backup-delete/Materials/WaterMaterial.js
js/helper-classes/backup-delete/Materials/ZInvertMaterial.js
js/lib/drawing/world.js
js/preloader/Preloader.js
js/stage/layout.js
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/helper-classes/backup-delete/Materials/StarMaterial.js')
-rw-r--r-- | js/helper-classes/backup-delete/Materials/StarMaterial.js | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/js/helper-classes/backup-delete/Materials/StarMaterial.js b/js/helper-classes/backup-delete/Materials/StarMaterial.js deleted file mode 100644 index ea8e4edb..00000000 --- a/js/helper-classes/backup-delete/Materials/StarMaterial.js +++ /dev/null | |||
@@ -1,133 +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 | |||
9 | /////////////////////////////////////////////////////////////////////// | ||
10 | // Class GLMaterial | ||
11 | // RDGE representation of a material. | ||
12 | /////////////////////////////////////////////////////////////////////// | ||
13 | function StarMaterial() | ||
14 | { | ||
15 | // initialize the inherited members | ||
16 | this.inheritedFrom = PulseMaterial; | ||
17 | this.inheritedFrom(); | ||
18 | |||
19 | /////////////////////////////////////////////////////////////////////// | ||
20 | // Instance variables | ||
21 | /////////////////////////////////////////////////////////////////////// | ||
22 | this._name = "StarMaterial"; | ||
23 | this._shaderName = "star"; | ||
24 | |||
25 | this._texMap = 'assets/images/rocky-normal.jpg'; | ||
26 | |||
27 | this._time = 0.0; | ||
28 | this._dTime = 0.01; | ||
29 | |||
30 | /////////////////////////////////////////////////////////////////////// | ||
31 | // Properties | ||
32 | /////////////////////////////////////////////////////////////////////// | ||
33 | // all defined in parent PulseMaterial.js | ||
34 | // load the local default value | ||
35 | this._propValues[ this._propNames[0] ] = this._texMap.slice(0); | ||
36 | |||
37 | /////////////////////////////////////////////////////////////////////// | ||
38 | // Material Property Accessors | ||
39 | /////////////////////////////////////////////////////////////////////// | ||
40 | |||
41 | /////////////////////////////////////////////////////////////////////// | ||
42 | |||
43 | |||
44 | /////////////////////////////////////////////////////////////////////// | ||
45 | // Methods | ||
46 | /////////////////////////////////////////////////////////////////////// | ||
47 | // duplcate method requirde | ||
48 | this.dup = function( world ) | ||
49 | { | ||
50 | // allocate a new uber material | ||
51 | var newMat = new StarMaterial(); | ||
52 | |||
53 | // copy over the current values; | ||
54 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
55 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | ||
56 | var n = propNames.length; | ||
57 | for (var i=0; i<n; i++) | ||
58 | newMat.setProperty( propNames[i], propValues[i] ); | ||
59 | |||
60 | return newMat; | ||
61 | } | ||
62 | |||
63 | this.init = function( world ) | ||
64 | { | ||
65 | // save the world | ||
66 | if (world) this.setWorld( world ); | ||
67 | |||
68 | // set up the shader | ||
69 | this._shader = new jshader(); | ||
70 | this._shader.def = starMaterialDef; | ||
71 | this._shader.init(); | ||
72 | |||
73 | // set up the material node | ||
74 | this._materialNode = createMaterialNode("starMaterial_" + world.generateUniqueNodeID()); | ||
75 | this._materialNode.setShader(this._shader); | ||
76 | |||
77 | this._time = 0; | ||
78 | if (this._shader && this._shader.default) | ||
79 | this._shader.default.u_time.set( [this._time] ); | ||
80 | |||
81 | // set the shader values in the shader | ||
82 | this.updateTexture(); | ||
83 | this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); | ||
84 | this.update( 0 ); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | /////////////////////////////////////////////////////////////////////////////////////// | ||
89 | // RDGE shader | ||
90 | |||
91 | // shader spec (can also be loaded from a .JSON file, or constructed at runtime) | ||
92 | var starMaterialDef = | ||
93 | {'shaders': | ||
94 | { | ||
95 | 'defaultVShader':"assets/shaders/Basic.vert.glsl", | ||
96 | 'defaultFShader':"assets/shaders/Star.frag.glsl" | ||
97 | }, | ||
98 | 'techniques': | ||
99 | { | ||
100 | 'default': | ||
101 | [ | ||
102 | { | ||
103 | 'vshader' : 'defaultVShader', | ||
104 | 'fshader' : 'defaultFShader', | ||
105 | // attributes | ||
106 | 'attributes' : | ||
107 | { | ||
108 | 'vert' : { 'type' : 'vec3' }, | ||
109 | 'normal' : { 'type' : 'vec3' }, | ||
110 | 'texcoord' : { 'type' : 'vec2' } | ||
111 | }, | ||
112 | // parameters | ||
113 | 'params' : | ||
114 | { | ||
115 | 'u_tex0': { 'type' : 'tex2d' }, | ||
116 | 'u_time' : { 'type' : 'float' }, | ||
117 | 'u_resolution' : { 'type' : 'vec2' }, | ||
118 | }, | ||
119 | |||
120 | // render states | ||
121 | 'states' : | ||
122 | { | ||
123 | 'depthEnable' : true, | ||
124 | 'offset':[1.0, 0.1] | ||
125 | }, | ||
126 | }, | ||
127 | ] | ||
128 | } | ||
129 | }; | ||
130 | |||
131 | |||
132 | |||
133 | |||