aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials')
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js44
-rw-r--r--js/lib/rdge/materials/cloud-material.js30
-rw-r--r--js/lib/rdge/materials/deform-material.js42
-rw-r--r--js/lib/rdge/materials/flag-material.js44
-rwxr-xr-xjs/lib/rdge/materials/flat-material.js32
-rw-r--r--js/lib/rdge/materials/fly-material.js42
-rw-r--r--js/lib/rdge/materials/julia-material.js41
-rw-r--r--js/lib/rdge/materials/keleidoscope-material.js42
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js100
-rw-r--r--js/lib/rdge/materials/mandel-material.js41
-rwxr-xr-xjs/lib/rdge/materials/material-parser.js30
-rwxr-xr-xjs/lib/rdge/materials/material.js115
-rw-r--r--js/lib/rdge/materials/plasma-material.js44
-rw-r--r--js/lib/rdge/materials/pulse-material.js44
-rw-r--r--js/lib/rdge/materials/radial-blur-material.js40
-rwxr-xr-xjs/lib/rdge/materials/radial-gradient-material.js126
-rw-r--r--js/lib/rdge/materials/relief-tunnel-material.js40
-rw-r--r--js/lib/rdge/materials/square-tunnel-material.js40
-rw-r--r--js/lib/rdge/materials/star-material.js40
-rw-r--r--js/lib/rdge/materials/taper-material.js59
-rw-r--r--js/lib/rdge/materials/tunnel-material.js42
-rw-r--r--js/lib/rdge/materials/twist-material.js40
-rw-r--r--js/lib/rdge/materials/twist-vert-material.js44
-rwxr-xr-xjs/lib/rdge/materials/uber-material.js49
-rw-r--r--js/lib/rdge/materials/water-material.js43
-rw-r--r--js/lib/rdge/materials/z-invert-material.js40
26 files changed, 1163 insertions, 131 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js
index 99a80da2..97efe441 100755
--- a/js/lib/rdge/materials/bump-metal-material.js
+++ b/js/lib/rdge/materials/bump-metal-material.js
@@ -1,7 +1,31 @@
1/* <copyright> 1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2Copyright (c) 2012, Motorola Mobility, Inc
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3All Rights Reserved.
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4BSD License.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 - Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 - Neither the name of Motorola Mobility nor the names of its contributors
15 may be used to endorse or promote products derived from this software
16 without specific prior written permission.
17
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE.
5</copyright> */ 29</copyright> */
6 30
7var MaterialParser = require("js/lib/rdge/materials/material-parser").MaterialParser; 31var MaterialParser = require("js/lib/rdge/materials/material-parser").MaterialParser;
@@ -20,6 +44,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
20 this._shaderName = "bumpMetal"; 44 this._shaderName = "bumpMetal";
21 45
22 46
47 this._defaultLightDiff = [0.3, 0.3, 0.3, 1.0];
23 this._defaultDiffuseTexture = "assets/images/metal.png"; 48 this._defaultDiffuseTexture = "assets/images/metal.png";
24 this._defaultSpecularTexture = "assets/images/silver.png"; 49 this._defaultSpecularTexture = "assets/images/silver.png";
25 this._defaultNormalTexture = "assets/images/normalMap.png"; 50 this._defaultNormalTexture = "assets/images/normalMap.png";
@@ -43,7 +68,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
43 this._propTypes = ["color", "file", "file", "file" ]; 68 this._propTypes = ["color", "file", "file", "file" ];
44 this._propValues = []; 69 this._propValues = [];
45 70
46 this._propValues[ this._propNames[0] ] = [0.3, 0.3, 0.3, 1.0]; 71 this._propValues[ this._propNames[0] ] = this._defaultLightDiff;
47 this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0); 72 this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0);
48 this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0); 73 this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0);
49 this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0); 74 this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0);
@@ -72,8 +97,19 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
72 this.setShaderValues(); 97 this.setShaderValues();
73 this.update(0); 98 this.update(0);
74 }; 99 };
100
101 this.resetToDefault = function()
102 {
103 this._propValues[ this._propNames[0] ] = this._defaultLightDiff;
104 this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0);
105 this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0);
106 this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0);
107 for (var i=0; i<4; i++)
108 this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] );
109 };
75}; 110};
76 111
112
77/////////////////////////////////////////////////////////////////////////////////////// 113///////////////////////////////////////////////////////////////////////////////////////
78// RDGE shader 114// RDGE shader
79 115
diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js
index fc833565..4e2a1a7c 100644
--- a/js/lib/rdge/materials/cloud-material.js
+++ b/js/lib/rdge/materials/cloud-material.js
@@ -1,7 +1,31 @@
1/* <copyright> 1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2Copyright (c) 2012, Motorola Mobility, Inc
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3All Rights Reserved.
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4BSD License.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 - Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 - Neither the name of Motorola Mobility nor the names of its contributors
15 may be used to endorse or promote products derived from this software
16 without specific prior written permission.
17
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE.
5</copyright> */ 29</copyright> */
6 30
7var MaterialParser = require("js/lib/rdge/materials/material-parser").MaterialParser; 31var MaterialParser = require("js/lib/rdge/materials/material-parser").MaterialParser;
diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js
index 4354408d..6145f1a6 100644
--- a/js/lib/rdge/materials/deform-material.js
+++ b/js/lib/rdge/materials/deform-material.js
@@ -1,8 +1,32 @@
1/* <copyright> 1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2Copyright (c) 2012, Motorola Mobility, Inc
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3All Rights Reserved.
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4BSD License.
5 </copyright> */ 5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 - Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 - Neither the name of Motorola Mobility nor the names of its contributors
15 may be used to endorse or promote products derived from this software
16 without specific prior written permission.
17
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE.
29</copyright> */
6 30
7var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; 31var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial;
8var Texture = require("js/lib/rdge/texture").Texture; 32var Texture = require("js/lib/rdge/texture").Texture;
@@ -74,6 +98,16 @@ var DeformMaterial = function DeformMaterial() {
74 this.setResolution([world.getViewportWidth(), world.getViewportHeight()]); 98 this.setResolution([world.getViewportWidth(), world.getViewportHeight()]);
75 this.update(0); 99 this.update(0);
76 }; 100 };
101
102 this.resetToDefault = function()
103 {
104 this._propValues[this._propNames[0]] = this._defaultTexMap.slice(0);