Skip to content

Commit

Permalink
Introduce VideoFrameTexture. (#1501)
Browse files Browse the repository at this point in the history
* Introduce VideoFrameTexture.

* Update three.js

* Add examples

* Update

* Remove examples

* Update
  • Loading branch information
Methuselah96 authored Jan 19, 2025
1 parent d765c6a commit f2c0265
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const exceptionList = [
'webgpu_tsl_transpiler',
'webgpu_tsl_vfx_linkedparticles',
'webgpu_tsl_vfx_tornado',
'webgpu_video_frame',
'webgpu_volume_cloud',
'webgpu_volume_perlin',
'webxr_vr_handinput_cubes',
Expand Down
1 change: 1 addition & 0 deletions types/three/src/Three.Core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,6 @@ export * from "./textures/DepthTexture.js";
export * from "./textures/FramebufferTexture.js";
export * from "./textures/Source.js";
export * from "./textures/Texture.js";
export * from "./textures/VideoFrameTexture.js";
export * from "./textures/VideoTexture.js";
export { createCanvasElement } from "./utils.js";
27 changes: 27 additions & 0 deletions types/three/src/textures/VideoFrameTexture.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
MagnificationTextureFilter,
Mapping,
MinificationTextureFilter,
PixelFormat,
TextureDataType,
Wrapping,
} from "../constants.js";
import { VideoTexture } from "./VideoTexture.js";

declare class VideoFrameTexture extends VideoTexture {
constructor(
mapping?: Mapping,
wrapS?: Wrapping,
wrapT?: Wrapping,
magFilter?: MagnificationTextureFilter,
minFilter?: MinificationTextureFilter,
format?: PixelFormat,
type?: TextureDataType,
anisotropy?: number,
);

// FIXME Replace with VideoFrame when we no longer need to support TypeScript 5.0
setFrame(frane: unknown): void;
}

export { VideoFrameTexture };

0 comments on commit f2c0265

Please sign in to comment.