Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Third Party VR - Photonserver transfer Material colour

Discussion in 'Multiplayer' started by Barrendo, Aug 18, 2018.

  1. Barrendo

    Barrendo

    Joined:
    May 1, 2018
    Posts:
    1
    Hello everybody,

    I have a question in Unity development. I use Photon Services for the multiplayer part.
    I also use a script to write on a whiteboard with pens.

    My problem is now to transmit this drawing via Photon so that other players can see the drawing.

    That means I want to know how to transfer the change of a material in real time via photon.

    You can see the change in the material texture on the attached file.

    Anybody can help me?
     

    Attached Files:

  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,018
    You have 2 options: You can try to compress and send the finished texture or you could send the spline vertices, which make up the drawing. It's usually leaner to send the vertices and hand movement, it's also simpler to send this incrementally.
    Check this page:
    https://doc.photonengine.com/en-us/pun/current/gameplay/synchronization-and-state
    To use "Object Synchronization", you could create a game object per player and let it observe the hand movement.
     
  3. Johnny-Fuzz

    Johnny-Fuzz

    Joined:
    Sep 1, 2014
    Posts:
    26
    Similar to what Tobiass said: I would encourage you to not send the material because this becomes problematic if you decide you want to have multiple inputs from multiple users. Instead send the data needed to reconstruct the material on the other side. I implemented a similar feature with 'x''users in a VR paint based application and had really good results with low latency because I was only sending the core information needed (position, Angle, spray velocity).
    The only time you might consider sending the material is if you have a situation in which a user joins mid-session. In that case on your load in you would want your player to have the most recent base of that material.