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

Webcam Avatars #3925

Merged
merged 20 commits into from
Feb 22, 2021
Merged

Webcam Avatars #3925

merged 20 commits into from
Feb 22, 2021

Conversation

robertlong
Copy link
Contributor

@robertlong robertlong commented Feb 17, 2021

You can now share your webcam to your avatar! On supported avatars, a "Avatar Camera" button will appear in the Share menu. Click it to use your webcam with your avatar.

Avatar creators can add this functionality to their own avatars by adding the webcam-texture-target component to the material they want to set the webcam to. This will swap out the base color map with a video texture. The other maps and base color factor will still be applied, making it possible to better integrate the webcam into your avatar.

To Do:

  • Finish featured webcam avatars
  • Add webcam-texture-target instructions to docs
  • Add screenshot to PR and tag with whats-new
  • Investigate additional bandwidth requirements from increased webcam usage

@robertlong robertlong requested review from johnshaughnessy and netpro2k and removed request for johnshaughnessy February 17, 2021 21:40
@robertlong robertlong linked an issue Feb 17, 2021 that may be closed by this pull request
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.

Mostly lgtm. Main thing I think we need to resolve is it looks like we are not using the actual material the component is on to decide what material to render the video on. We should either take that into account or just make this a component you add to a mesh instead of a material.

src/components/gltf-model-plus.js Outdated Show resolved Hide resolved
src/components/gltf-model-plus.js Show resolved Hide resolved
src/components/player-info.js Outdated Show resolved Hide resolved
src/components/gltf-model-plus.js Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/react-components/room/SharePopoverContainer.js Outdated Show resolved Hide resolved
Copy link
Contributor

@johnshaughnessy johnshaughnessy left a comment

Choose a reason for hiding this comment

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

lgtm - I couldn't tell just by eyeballing it whether it was resilient to having people change their avatars. (I'm guessing that if you change to an avatar that has a webcam-texture-target, your client should either keep streaming or re-stream your video and if it does not have a webcam-texture-target, streaming should end.)

src/components/player-info.js Outdated Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/components/webcam-texture-target.js Outdated Show resolved Hide resolved
src/react-components/room/useAvatar.js Show resolved Hide resolved
@robertlong
Copy link
Contributor Author

(I'm guessing that if you change to an avatar that has a webcam-texture-target, your client should either keep streaming or re-stream your video and if it does not have a webcam-texture-target, streaming should end.)

It ends the stream and you need to restart the stream if you change from one avatar to another with the webcam-texture-target component. I think this is acceptable UX and it simplifies the code a little bit.

@robertlong
Copy link
Contributor Author

I've gone over most of the PR feedback. Thank you both for the reviews! @netpro2k and I discussed revisiting material components as a concept when we move to @takahirox's GLTFLoader plugin system. Right now it doesn't make too much sense to inflate a component that is attached to an entity for every usage of a material. Especially if that material is used more than once. We'll probably want a system to handle the single material instance in that case.

Also this component is pretty close to what is needed for streaming to multiple screens in a scene or this Spoke issue Hubs-Foundation/Spoke#1099

@robertlong robertlong dismissed netpro2k’s stale review February 22, 2021 23:49

I fixed all of the issues

@robertlong
Copy link
Contributor Author

Pushing this out so we can test a little easier. Look out for the featured webcam avatars soon 👀

@robertlong robertlong merged commit a3a36f3 into master Feb 22, 2021
@robertlong robertlong deleted the feature/avatar-webcam-texture branch February 22, 2021 23:50
@yajo
Copy link

yajo commented Feb 26, 2021

How can this feature be tested? 😻

@astrojuanlu
Copy link

I'd love to give this a spin as well :) Too bad there are no screenshots here!

@johnshaughnessy
Copy link
Contributor

@astrojuanlu @yajo This feature is already live. Here are some example avatars using webcams surfaces:
https://hubs.mozilla.com/avatars/RATQPDA
https://hubs.mozilla.com/avatars/2BtycVC

@yajo
Copy link

yajo commented Mar 20, 2021

@TheBricktop
Copy link

@astrojuanlu @yajo This feature is already live. Here are some example avatars using webcams surfaces:
https://hubs.mozilla.com/avatars/RATQPDA
https://hubs.mozilla.com/avatars/2BtycVC
Can You share a source of this avatars? (blend maybe?)

@hbaileylxd
Copy link

hbaileylxd commented Dec 15, 2021

@robertlong etc...

Hello! This is so great and we want to use it for our Christmas party, but when i try this my webcam "on" light lights up, but I get a red dot above my camera share button and my friends cannot see my video, even though i have chosen Webcam astronaut or Webcam Hologram. Have checked, and my browser, Chrome, is set to allow the site access to my camera ok. Also we can share video using the "camera" option but the whole reason to use this is to have the video in your avatar. Any ideas?

Many thanks!
Helen

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.

Floating webcam view above avatars that follows each avatar
7 participants