David Catuhe il y a 9 ans
Parent
commit
6352e161e1

Fichier diff supprimé car celui-ci est trop grand
+ 7750 - 7749
dist/preview release/babylon.d.ts


Fichier diff supprimé car celui-ci est trop grand
+ 3 - 3
dist/preview release/babylon.js


+ 4 - 3
dist/preview release/babylon.max.js

@@ -52852,6 +52852,7 @@ var BABYLON;
         function LensFlare(size, position, color, imgUrl, system) {
             this.size = size;
             this.position = position;
+            this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
             this.dispose = function () {
                 if (this.texture) {
                     this.texture.dispose();
@@ -53008,18 +53009,18 @@ var BABYLON;
             engine.enableEffect(this._effect);
             engine.setState(false);
             engine.setDepthBuffer(false);
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_ONEONE);
             // VBOs
             engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect);
             // Flares
             for (var index = 0; index < this.lensFlares.length; index++) {
                 var flare = this.lensFlares[index];
+                engine.setAlphaMode(flare.alphaMode);
                 var x = centerX - (distX * flare.position);
                 var y = centerY - (distY * flare.position);
                 var cw = flare.size;
                 var ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true);
-                var cx = 2 * (x / globalViewport.width) - 1.0;
-                var cy = 1.0 - 2 * (y / globalViewport.height);
+                var cx = 2 * (x / (globalViewport.width + globalViewport.x * 2)) - 1.0;
+                var cy = 1.0 - 2 * (y / (globalViewport.height + globalViewport.y * 2));
                 var viewportMatrix = BABYLON.Matrix.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);
                 this._effect.setMatrix("viewportMatrix", viewportMatrix);
                 // Texture

Fichier diff supprimé car celui-ci est trop grand
+ 3 - 3
dist/preview release/babylon.noworker.js


+ 1 - 0
src/LensFlare/babylon.lensFlare.js

@@ -4,6 +4,7 @@ var BABYLON;
         function LensFlare(size, position, color, imgUrl, system) {
             this.size = size;
             this.position = position;
+            this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
             this.dispose = function () {
                 if (this.texture) {
                     this.texture.dispose();

+ 3 - 3
src/LensFlare/babylon.lensFlareSystem.js

@@ -136,18 +136,18 @@ var BABYLON;
             engine.enableEffect(this._effect);
             engine.setState(false);
             engine.setDepthBuffer(false);
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_ONEONE);
             // VBOs
             engine.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect);
             // Flares
             for (var index = 0; index < this.lensFlares.length; index++) {
                 var flare = this.lensFlares[index];
+                engine.setAlphaMode(flare.alphaMode);
                 var x = centerX - (distX * flare.position);
                 var y = centerY - (distY * flare.position);
                 var cw = flare.size;
                 var ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true);
-                var cx = 2 * (x / globalViewport.width) - 1.0;
-                var cy = 1.0 - 2 * (y / globalViewport.height);
+                var cx = 2 * (x / (globalViewport.width + globalViewport.x * 2)) - 1.0;
+                var cy = 1.0 - 2 * (y / (globalViewport.height + globalViewport.y * 2));
                 var viewportMatrix = BABYLON.Matrix.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);
                 this._effect.setMatrix("viewportMatrix", viewportMatrix);
                 // Texture