Browse Source

Adding effect.setArray

Deltakosh 11 years ago
parent
commit
85b1425483
3 changed files with 14 additions and 2 deletions
  1. 4 0
      Babylon/Materials/babylon.effect.js
  2. 7 0
      Babylon/babylon.engine.js
  3. 3 2
      babylon.1.9.0.js

+ 4 - 0
Babylon/Materials/babylon.effect.js

@@ -193,6 +193,10 @@ var BABYLON = BABYLON || {};
         this._valueCache[uniformName][2] = z;
         this._valueCache[uniformName][3] = w;
     };
+    
+    BABYLON.Effect.prototype.setArray = function (uniformName, array) {
+        this._engine.setArray(this.getUniform(uniformName), array);
+    };
 
     BABYLON.Effect.prototype.setMatrices = function (uniformName, matrices) {
         this._engine.setMatrices(this.getUniform(uniformName), matrices);

+ 7 - 0
Babylon/babylon.engine.js

@@ -455,6 +455,13 @@ var BABYLON = BABYLON || {};
 
         this._currentEffect = effect;
     };
+    
+    BABYLON.Engine.prototype.setArray = function (uniform, array) {
+        if (!uniform)
+            return;
+
+        this._gl.uniform1fv(uniform, array);
+    };
 
     BABYLON.Engine.prototype.setMatrices = function (uniform, matrices) {
         if (!uniform)

File diff suppressed because it is too large
+ 3 - 2
babylon.1.9.0.js