Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: suppress console errors when video data is unavailable. #28894

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

aardgoose
Copy link
Contributor

Related issue: #27690, #28868

Using video textures often results in console errors while the video element or stream is unavailable. Add a default 1 x 1 default black video frame to be used in this situation to prevent console errors, mirroring the use of default textures.

Copy link

github-actions bot commented Jul 16, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
683.5 kB (169.2 kB) 683.5 kB (169.2 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
460.7 kB (111.1 kB) 460.7 kB (111.1 kB) +0 B

vv
ccc

create default video frame

fix quote format
format: 'RGBA',
};

this.defaultVideoFrame = defaultVideoFrame = new VideoFrame( new Uint8Array( [ 0, 0, 0, 0xff ] ), init );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that works!? I wasn't aware that you can manually create instances of VideoFrame.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL:

A second constructor enables the creation of a VideoFrame from its binary pixel representation in an ArrayBuffer, a TypedArray, or a DataView.

@Mugen87 Mugen87 added this to the r167 milestone Jul 16, 2024
@RenaudRohlinger
Copy link
Collaborator

The perfect fix doesn't exis.. 😳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants