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

adds the emissive attribute to the m-video element #184

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

TheCodeTherapy
Copy link
Contributor

This PR adds the emissive attribute for the <m-video> tag on mml-web. This allows the user to specify the emissive strength of the video (how much perceived light it will emit).


What kind of changes does your PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Refactor
  • Tests
  • Other, please describe:

Does your PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe its impact and migration path for existing applications:

Does your PR fulfill the following requirements?

  • All tests are passing
  • The title references the corresponding issue # (if relevant)
2024-07-04.15-23-07.mp4

@@ -232,6 +240,11 @@ export class Video extends TransformableElement {
const video = document.createElement("video");
const material = this.mesh.material;
const videoTexture = new THREE.VideoTexture(video);
if (this.props.emissive > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should use the same code to apply the emissiveness changes on both attribute update and when the material is initially created here (the code here ~matches updateMaterialEmissiveIntensity)

@@ -246,6 +254,9 @@ export class Video extends TransformableElement {
material,
videoTexture,
};
if (this.props.emissive > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can remove this condition to make it clearer that the side-effects on the material can be applied either way

@TheCodeTherapy TheCodeTherapy merged commit e893239 into main Jul 10, 2024
8 checks passed
@TheCodeTherapy TheCodeTherapy deleted the feature/video-emissiveness branch July 10, 2024 12:01
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.

2 participants