From 747206932d637d1930ec6c44e29d194e02c677f1 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Tue, 15 Jul 2025 23:40:59 +0200 Subject: [PATCH 1/3] Textures: Fix dimensions of video frames. --- src/renderers/common/Textures.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderers/common/Textures.js b/src/renderers/common/Textures.js index 36daedc4e915b7..ed37b0cfc543ac 100644 --- a/src/renderers/common/Textures.js +++ b/src/renderers/common/Textures.js @@ -372,6 +372,12 @@ class Textures extends DataMap { target.height = image.videoHeight || 1; target.depth = 1; + } else if ( image instanceof VideoFrame ) { + + target.width = image.displayWidth || 1; + target.height = image.displayHeight || 1; + target.depth = 1; + } else { target.width = image.width || 1; From 20d5343839a97bada4542d49d645cab12b2ac907 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Tue, 15 Jul 2025 23:49:13 +0200 Subject: [PATCH 2/3] Source: Fix `getSize()`. --- src/textures/Source.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/textures/Source.js b/src/textures/Source.js index 7d894869f7bedb..610ff8d3ef9ed3 100644 --- a/src/textures/Source.js +++ b/src/textures/Source.js @@ -73,6 +73,12 @@ class Source { } + /** + * Returns the dimensions of the source into the given target vector. + * + * @param {(Vector2|Vector3)} target - The target object the result is written into. + * @return {(Vector2|Vector3)} The dimensions of the source. + */ getSize( target ) { const data = this.data; @@ -81,6 +87,10 @@ class Source { target.set( data.videoWidth, data.videoHeight ); + } else if ( data instanceof VideoFrame ) { + + target.set( data.displayHeight, data.displayWidth ); + } else if ( data !== null ) { target.set( data.width, data.height, data.depth || 0 ); From 370d5205fee2d4adcb30f91e3b5dc6deb1959d6b Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Wed, 16 Jul 2025 00:37:28 +0200 Subject: [PATCH 3/3] Source: Fix z coordinate for video-like sources. --- src/textures/Source.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textures/Source.js b/src/textures/Source.js index 610ff8d3ef9ed3..2b718a10b03000 100644 --- a/src/textures/Source.js +++ b/src/textures/Source.js @@ -85,11 +85,11 @@ class Source { if ( data instanceof HTMLVideoElement ) { - target.set( data.videoWidth, data.videoHeight ); + target.set( data.videoWidth, data.videoHeight, 0 ); } else if ( data instanceof VideoFrame ) { - target.set( data.displayHeight, data.displayWidth ); + target.set( data.displayHeight, data.displayWidth, 0 ); } else if ( data !== null ) {