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

Fix darkened video-texture-target #5604

Merged
merged 1 commit into from
Jul 25, 2022
Merged

Conversation

takahirox
Copy link
Contributor

Fixes: #5599

This PR fixes darkened video-texture-target problem caused when upgrading our Three.js to r141.

Refer to "Fix darkened camera view" PR #5577 for the details because the root issue is same.

This commit fixes darkened video-texture-target problem
caused when upgrading our Three.js to r141.

Refer to "Fix darkened camera view" commit for the details
because the root issue is same.
material.map.isVideoTexture = true;
material.map.update = () => {
// Only update the renderTarget when the screens are in view
material.onBeforeRender = () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note to reviews: I assume material.onBeforeRender isn't set anywhere else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh wow I didn't realize this existed for materials. Well that makes things simple. We should probably use that for camera tool too then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me. Opened #5607

Copy link
Contributor

@netpro2k netpro2k left a comment

Choose a reason for hiding this comment

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

Did not realize materials had onBeforeRender as well, that makes this way simpler than I was thinking!

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.

video-texture-target is darkened since THREE 141 update
2 participants