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

Update VideoTexture doc with note about using RGBA format to avoid Firefox performance issue. #21746

Merged
merged 3 commits into from
Apr 29, 2021

Conversation

jlivak
Copy link
Contributor

@jlivak jlivak commented Apr 29, 2021

There's an issue with Firefox desktop that causes RGBFormat on a video texture to destroy performance. When testing with a single 4K 360 video, frame times on Firefox with RGBFormat were ~200x RGBAFormat. (62ms vs .32ms)

I propose defaulting to RGBAFormat to avoid this.

There's an issue with Firefox desktop that causes RGBFormat on a video texture to destroy performance.  When testing with a single 4K 360 video, frame times on Firefox with RGBFormat were ~200x RGBAFormat.  (62ms vs .32ms)  I propose defaulting to RGBAFormat to avoid this.
@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 29, 2021

How about reporting this performance issue to Mozilla instead?

https://bugzilla.mozilla.org/

As long as no other browser are affected, it's better to keep the more correct default value RGBFormat. Simply because most videos do not need an alpha channel.

@jlivak
Copy link
Contributor Author

jlivak commented Apr 29, 2021

There definitely should be a mozilla bug report as well, however the main concern here is just helping people who want a quick video texture implementation to have it working across browsers without needing to hunt down solutions for per-browser issues.

If you'd prefer to keep the more sensible value of RGBFormat, even if it means VideoTexture doesn't work across-browser out of the box, maybe just a callout in the docs page for VideoTexture that the filter defaults to RGB but if performance issues are encountered to try changing it to RGBA?

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 29, 2021

Adding a note to the docs sounds good! The format parameter is listed in the ctor description. I think this would be a good place to mentioned the default RGBFormat and this issue.

@jlivak
Copy link
Contributor Author

jlivak commented Apr 29, 2021

Alright cool, that works for me. Reverted the VideoTexture.js change and updated the VideoTexture doc page.

Also mozilla bug report for future visibility: https://bugzilla.mozilla.org/show_bug.cgi?id=1708491

@jlivak jlivak changed the title VideoTexture should use RGBA format to avoid firefox performance issue. Update VideoTexture doc with note about using RGBA format to avoid Firefox performance issue. Apr 29, 2021
@Mugen87 Mugen87 merged commit 54a207c into mrdoob:dev Apr 29, 2021
@Mugen87 Mugen87 added this to the r129 milestone Apr 29, 2021
@aardgoose
Copy link
Contributor

I suspect this is a similar issue to this one:

https://bugzilla.mozilla.org/show_bug.cgi?id=1486454

@mrdoob
Copy link
Owner

mrdoob commented May 3, 2021

Thanks!

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.

4 participants