Переглянути джерело

Merge pull request #7648 from sebavan/master

Fix #7645 video texture poster is inverted
David Catuhe 5 роки тому
батько
коміт
28bef53030

+ 1 - 0
dist/preview release/what's new.md

@@ -338,6 +338,7 @@
 - Fix subSurface parameters not copied in the PBR clone methods ([Popov72](https://github.com/Popov72))
 - Fix for bug where round-tripped glTF imported scenes are encapsulated in a second root node ([#6349](https://github.com/BabylonJS/Babylon.js/issues/6349))([drigax](https://github.com/drigax) & [noalak](https://github.com/noalak))
 - Fix `HDRCubeTexture` construction, `generateHarmonics` was not properly taken into account ([Popov72](https://github.com/Popov72))
+- VideoTexture poster respects invertY ([Sebavan](https://github.com/sebavan/)
 
 ## Breaking changes
 

+ 18 - 0
src/Layers/highlightLayer.ts

@@ -686,6 +686,24 @@ export class HighlightLayer extends EffectLayer {
     }
 
     /**
+     * Remove all the meshes currently referenced in the highlight layer
+     */
+    public removeAllMeshes(): void {
+        if (!this._meshes) {
+            return;
+        }
+
+        for (const uniqueId in this._meshes) {
+            if (this._meshes.hasOwnProperty(uniqueId)) {
+                const mesh = this._meshes[uniqueId];
+                if (mesh) {
+                    this.removeMesh(mesh.mesh);
+                }
+            }
+        }
+    }
+
+    /**
      * Force the stencil to the normal expected value for none glowing parts
      */
     private _defaultStencilReference(mesh: Mesh) {

+ 1 - 1
src/Materials/Textures/videoTexture.ts

@@ -131,7 +131,7 @@ export class VideoTexture extends Texture {
         const videoHasEnoughData = (this.video.readyState >= this.video.HAVE_CURRENT_DATA);
         if (settings.poster &&
             (!settings.autoPlay || !videoHasEnoughData)) {
-            this._texture = this._engine.createTexture(settings.poster!, false, true, scene);
+            this._texture = this._engine.createTexture(settings.poster!, false, !this.invertY, scene);
             this._displayingPosterTexture = true;
         }
         else if (videoHasEnoughData) {