-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multiplayer FaceCam #624
Multiplayer FaceCam #624
Conversation
…ideo/chunk sending.
…e else has a silver FaceCam.
But everyone but not the server sends it to themselfs too. This should be fixed.
…all clients, but not to themselfs.
…d Network-Test-Stuff into the FaceCam folder.
… Simple fix in FaceCam.cs.
… the size of the FaceCam.
…ped with a little extra space.
Simplified code. Fixed error related to y position. My cat walked over the keyboard this somehow disabled the red square and implemented zoom onto the face instead of jumping right to it.
Co-authored-by: Falko <10247603+falko17@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now! Only needs a review from @koschke (and ideally a test in practice, I only looked at the code.)
Improved error message format.
Shortened long lines. Accepted performance improvement suggested by Visual Studio.
# Conflicts: # Assets/SEE/Net/Network.cs
We want to abstract from the kind of interaction (keyboard or trigger on a VR controller). Moreover, we want to have one single location in the code where all key bindings are defined so that we can check whether there are any conflicts. In fact, a conflict with KeyCode.O existed. Switching the facecam's position on the player is now bound to KeyCode.F3.
FaceCam will instantiated also for a client (may be a temporary change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed a few more issues. In particular, I replaced the reference to Input
and KeyCode
by a more abstract SEEInput
call. Never use Input
and KeyCode
. There was a keybinding conflict in key O. The facecam's position can now be switched by F3.
Otherwise, the code looks good. However, in my test with two different computers, the face mask worked only on the machine acting as the host. On the client machine, it doesn't. I noticed and marked the responsible source code in file PlayerSpawner.cs
, which spawns the FaceCam prefab only on the server. Removing the condition didn't work. There were NetCode errors raised then.
This needs further investigation.
In some not yet investigated case a node exists already in the object manager. We need to look into that. I filed issue #630 for that.
# Conflicts: # .gitattributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few bad patterns I found which you should check.
…-FaceCam # Conflicts: # Assets/SEE/Tools/FaceCam/FaceCam.cs
The check has no type information. In this particular case, the argument is a Texture, not a GameObject and the use of Object.Destroy would have been fine. To deal with similar situations, I generalized Destroyer.Destroy from Component to Object. Removed some redundancy. Fixed bug: Added missing parameter recurseIntoChildren in recursive call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few bad patterns I found which you should check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few more minor improvements and filed a follow-up issue #633.
Can be merged now.
This is a live transmission of the face, in front or above the avatar.
Users with a webcam can enable this feature.
Resolves and closes #560.
Features
Controls
Performance
The host receives all the videos that contain the cropped face and forwards them only to the clients that have not yet received the video.
It tries to use the most direct functions of Unity's "Netcode for GameObjects" as well as the functions from the code used in the OpenCV plugin examples.
Hopefully a more performant implementation of the functions provided by Unity on the OpenCV plugins will also improve the performance of this feature (like the conversion between JPG and 'texture2D' becoming more efficient). Then it may also be possible to switch to unreliable RPCs, as well as possibly choose a different container for network transmission than JPG. It is also possible no conversion from 'texture2D' might be necessary.
Self-adjusting resolution, compression, bitrate and FPS would also be a great addition.