Beispiel #1
0
        public void SyncCurrentDisplayCLUT(List <NetworkConnection> targetconns = null)
        {
            if (postprocessing.profile.TryGet(out Tonemapping tonemapping))
            {
                var cdclut = CurrentDisplayCLUT;
                if (cdclut != null)
                {
                    tonemapping.lutTexture.value = cdclut;

                    var envpeerconn = targetconns ?? netmanager.GetPeerTypeConnection(PeerType.Environment);
                    if (envpeerconn.Count > 0)
                    {
                        var clutmsg = new CLUTMessage
                        {
                            clut = cdclut.GetPixelData <byte>(0).ToArray().Compress(),
                            size = cdclut.width
                        };
                        foreach (var conn in envpeerconn)
                        {
                            conn.Send(MsgType.CLUT, clutmsg);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public void SetCLUT(CLUTMessage msg)
 {
     if (postprocessing.profile.TryGet(out Tonemapping tonemapping))
     {
         var tex = new Texture3D(msg.size, msg.size, msg.size, TextureFormat.RGB24, false);
         tex.SetPixelData(msg.clut.Decompress(), 0);
         tex.Apply();
         tonemapping.lutTexture.value = tex;
     }
 }