diff options
Diffstat (limited to 'js/lib/rdge/materials/uber-material.js')
-rwxr-xr-x | js/lib/rdge/materials/uber-material.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js index a2c782d8..bc2ba340 100755 --- a/js/lib/rdge/materials/uber-material.js +++ b/js/lib/rdge/materials/uber-material.js | |||
@@ -24,8 +24,8 @@ var UberMaterial = function UberMaterial() { | |||
24 | this._environmentAmount = 0.2; // 0 .. 1 | 24 | this._environmentAmount = 0.2; // 0 .. 1 |
25 | 25 | ||
26 | // set the default maps | 26 | // set the default maps |
27 | //this._diffuseMapOb = { 'texture' : 'assets/images/rocky-diffuse.jpg', 'wrap' : 'REPEAT' }; | 27 | this._diffuseMapOb = { 'texture' : 'assets/images/rocky-diffuse.jpg', 'wrap' : 'REPEAT' }; |
28 | this._diffuseMapOb = { 'texture' : 'texture', 'wrap' : 'REPEAT' }; | 28 | //this._diffuseMapOb = { 'texture' : 'texture', 'wrap' : 'REPEAT' }; |
29 | this._normalMapOb = { 'texture': 'assets/images/rocky-normal.jpg', 'wrap': 'REPEAT' }; | 29 | this._normalMapOb = { 'texture': 'assets/images/rocky-normal.jpg', 'wrap': 'REPEAT' }; |
30 | this._specularMapOb = { 'texture': 'assets/images/rocky-spec.jpg', 'wrap': 'REPEAT' }; | 30 | this._specularMapOb = { 'texture': 'assets/images/rocky-spec.jpg', 'wrap': 'REPEAT' }; |
31 | this._environmentMapOb = { 'texture': 'assets/images/silver.png', 'wrap': 'CLAMP', 'envReflection': this._environmentAmount }; | 31 | this._environmentMapOb = { 'texture': 'assets/images/silver.png', 'wrap': 'CLAMP', 'envReflection': this._environmentAmount }; |
@@ -366,9 +366,13 @@ var UberMaterial = function UberMaterial() { | |||
366 | 366 | ||
367 | // duplcate method requirde | 367 | // duplcate method requirde |
368 | this.dup = function () { | 368 | this.dup = function () { |
369 | // allocate a new uber material | ||
370 | var newMat = new UberMaterial(); | ||
371 | 369 | ||
370 | // get the current values; | ||
371 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
372 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
373 | |||
374 | // allocate a new material | ||
375 | var newMat = new UberMaterial(); | ||
372 | newMat._useDiffuseMap = this._useDiffuseMap; | 376 | newMat._useDiffuseMap = this._useDiffuseMap; |
373 | newMat._useEnvironmentMap = this._useEnvironmentMap; | 377 | newMat._useEnvironmentMap = this._useEnvironmentMap; |
374 | newMat._useLights = this._useLights; | 378 | newMat._useLights = this._useLights; |
@@ -376,9 +380,7 @@ var UberMaterial = function UberMaterial() { | |||
376 | newMat._useSpecularMap = this._useSpecularMap; | 380 | newMat._useSpecularMap = this._useSpecularMap; |
377 | newMat.rebuildShader(); | 381 | newMat.rebuildShader(); |
378 | 382 | ||
379 | // copy over the current values; | 383 | // copy over the current values; |
380 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
381 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
382 | var n = propNames.length; | 384 | var n = propNames.length; |
383 | for (var i = 0; i < n; i++) | 385 | for (var i = 0; i < n; i++) |
384 | newMat.setProperty(propNames[i], propValues[i]); | 386 | newMat.setProperty(propNames[i], propValues[i]); |