aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/bump-metal-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/bump-metal-material.js')
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js
index 3db3df1d..97efe441 100755
--- a/js/lib/rdge/materials/bump-metal-material.js
+++ b/js/lib/rdge/materials/bump-metal-material.js
@@ -44,6 +44,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
44 this._shaderName = "bumpMetal"; 44 this._shaderName = "bumpMetal";
45 45
46 46
47 this._defaultLightDiff = [0.3, 0.3, 0.3, 1.0];
47 this._defaultDiffuseTexture = "assets/images/metal.png"; 48 this._defaultDiffuseTexture = "assets/images/metal.png";
48 this._defaultSpecularTexture = "assets/images/silver.png"; 49 this._defaultSpecularTexture = "assets/images/silver.png";
49 this._defaultNormalTexture = "assets/images/normalMap.png"; 50 this._defaultNormalTexture = "assets/images/normalMap.png";
@@ -67,7 +68,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
67 this._propTypes = ["color", "file", "file", "file" ]; 68 this._propTypes = ["color", "file", "file", "file" ];
68 this._propValues = []; 69 this._propValues = [];
69 70
70 this._propValues[ this._propNames[0] ] = [0.3, 0.3, 0.3, 1.0]; 71 this._propValues[ this._propNames[0] ] = this._defaultLightDiff;
71 this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0); 72 this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0);
72 this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0); 73 this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0);
73 this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0); 74 this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0);
@@ -96,8 +97,19 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
96 this.setShaderValues(); 97 this.setShaderValues();
97 this.update(0); 98 this.update(0);
98 }; 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 };
99}; 110};
100 111
112
101/////////////////////////////////////////////////////////////////////////////////////// 113///////////////////////////////////////////////////////////////////////////////////////
102// RDGE shader 114// RDGE shader
103 115