Parcourir la source

Adding effect.setArray

Deltakosh il y a 11 ans
Parent
commit
85b1425483
3 fichiers modifiés avec 14 ajouts et 2 suppressions
  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)

Fichier diff supprimé car celui-ci est trop grand
+ 3 - 2
babylon.1.9.0.js