diff options
Diffstat (limited to 'js/lib/rdge/materials/bump-metal-material.js')
-rwxr-xr-x | js/lib/rdge/materials/bump-metal-material.js | 14 |
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 99a80da2..ea3322cf 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js | |||
@@ -20,6 +20,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() { | |||
20 | this._shaderName = "bumpMetal"; | 20 | this._shaderName = "bumpMetal"; |
21 | 21 | ||
22 | 22 | ||
23 | this._defaultLightDiff = [0.3, 0.3, 0.3, 1.0]; | ||
23 | this._defaultDiffuseTexture = "assets/images/metal.png"; | 24 | this._defaultDiffuseTexture = "assets/images/metal.png"; |
24 | this._defaultSpecularTexture = "assets/images/silver.png"; | 25 | this._defaultSpecularTexture = "assets/images/silver.png"; |
25 | this._defaultNormalTexture = "assets/images/normalMap.png"; | 26 | this._defaultNormalTexture = "assets/images/normalMap.png"; |
@@ -43,7 +44,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() { | |||
43 | this._propTypes = ["color", "file", "file", "file" ]; | 44 | this._propTypes = ["color", "file", "file", "file" ]; |
44 | this._propValues = []; | 45 | this._propValues = []; |
45 | 46 | ||
46 | this._propValues[ this._propNames[0] ] = [0.3, 0.3, 0.3, 1.0]; | 47 | this._propValues[ this._propNames[0] ] = this._defaultLightDiff; |
47 | this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0); | 48 | this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0); |
48 | this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0); | 49 | this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0); |
49 | this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0); | 50 | this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0); |
@@ -72,8 +73,19 @@ var BumpMetalMaterial = function BumpMetalMaterial() { | |||
72 | this.setShaderValues(); | 73 | this.setShaderValues(); |
73 | this.update(0); | 74 | this.update(0); |
74 | }; | 75 | }; |
76 | |||
77 | this.resetToDefault = function() | ||
78 | { | ||
79 | this._propValues[ this._propNames[0] ] = this._defaultLightDiff; | ||
80 | this._propValues[ this._propNames[1] ] = this._defaultDiffuseTexture.slice(0); | ||
81 | this._propValues[ this._propNames[2] ] = this._defaultNormalTexture.slice(0); | ||
82 | this._propValues[ this._propNames[3] ] = this._defaultSpecularTexture.slice(0); | ||
83 | for (var i=0; i<4; i++) | ||
84 | this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] ); | ||
85 | }; | ||
75 | }; | 86 | }; |
76 | 87 | ||
88 | |||
77 | /////////////////////////////////////////////////////////////////////////////////////// | 89 | /////////////////////////////////////////////////////////////////////////////////////// |
78 | // RDGE shader | 90 | // RDGE shader |
79 | 91 | ||