Пример #1
0
 //called when data for any output pin is requested
 public void Evaluate(int SpreadMax)
 {
     if (FUpdate[0])
     {
         FOutput.AssignFrom(SpoutSender.GetSenderNames());
     }
 }
Пример #2
0
    void Start()
    {
        spoutSender = GetComponent <SpoutSender>();
        spoutSender.sourceTexture = textures[0];

        HMDInputManager.LeftGetTriggerButtonDown += TextureSwitch;
    }
Пример #3
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            //if sender count has changed
            if (FSpoutSender.Length != SpreadMax)
            {
                //for simplicity remove all existing senders
                CleanUp();
                FLogger.Log(LogType.Debug, "Cleaned Up SpoutSender");

                //and create a new array
                FSpoutSender = new SpoutSender[SpreadMax];
            }

            for (int i = 0; i < SpreadMax; i++)
            {
                if (FWrite[i])
                {
                    if ((i < FSpoutSender.Length) && (FSpoutSender[i] != null))
                    {
                        FSpoutSender[i].Dispose();
                    }

                    FSpoutSender[i] = new SpoutSender(FSenderName[i], FHandle[i], FWidth[i], FHeight[i], 0, 1);
                    var succ = FSpoutSender[i].Initialize();
                    FLogger.Log(LogType.Debug, "Writing Spout sender " + (succ ? "succeeded!" : "failed!"));
                }
            }
        }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        handCam       = cameraTrs.GetComponent <Camera>();
        dof           = postProcessVolume.profile.GetSetting <DepthOfField>();
        keyLight      = lightTrs.GetComponent <Light>();
        litDefaultPos = lightTrs.localPosition;

        sender = handCam.GetComponent <SpoutSender>();

        backLightIntensity  = backLight.intensity;
        keyLightIntensity   = keyLight.intensity;
        backLight.intensity = 0f;
        keyLight.intensity  = 0f;

        randomEffects = new System.Action[] {
            () => {
                StartCoroutine(FadeLightRoutine(false));
                realMesh.SetMotionParticle(false);
                this.CallMethodDelayed(2f, realMesh.VerticalEffect);
            },
            () => {
                StartCoroutine(FadeLightRoutine(false));
                realMesh.SetMotionParticle(false);
                this.CallMethodDelayed(2f, realMesh.HorizonalEffect);
            },
            () => {
                StartCoroutine(FadeLightRoutine(false));
                realMesh.SetMotionParticle(false);
                this.CallMethodDelayed(2f, () => StartCoroutine(VanishAll()));
            },
        };
    }
Пример #5
0
 public void RefreshSender()
 {
     if (sender != null)
     {
         sender.sourceTexture = null;
         Destroy(sender);
     }
     _sender = null;
 }
Пример #6
0
        public Sender()
        {
            _sendPool =
                new DedicatedThreadPool(new DedicatedThreadPoolSettings(1, ThreadType.Background,
                                                                        "Send-Pool"));
            _sendPool.QueueUserWorkItem(() =>
            {
                // Initialize Static Core
                _deviceContext = DeviceContext.Create();
                _glContext     = _deviceContext.CreateContext(IntPtr.Zero);
                _deviceContext.MakeCurrent(_glContext);

                //_senderLocker = new object();

                // Initialize Core
                _sender = new SpoutSender();
                _sender.CreateSender(SenderName, _width, _height, 0);
            });
        }
Пример #7
0
    private void Start()
    {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        // Spout
        // senderNameを「appName / senderName」に整形
        var appName = (Application.platform == RuntimePlatform.WindowsEditor) ? "Unity" : Application.productName;
        gameObject.name = appName + ":" + senderName;
        CheckSpoutSender();
        spoutSender = gameObject.AddComponent <SpoutSender>();
        spoutSender.alphaSupport = alphaSupport;
#endif

#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
        // Syphon
        // senderNameは、自動で「appName / senderName」になる
        gameObject.name = senderName;
        CheckSyphonSender();
        syphonSender = gameObject.AddComponent <SyphonServer>();
        syphonSender.alphaSupport = alphaSupport;
#endif
    }
Пример #8
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            //if sender count has changed
            if (FSpoutSender.Length != SpreadMax)
            {
                //for simplicity remove all existing senders
                CleanUp();
                FLogger.Log(LogType.Debug, "Cleaned Up SpoutSender");

                //and create a new array
                FSpoutSender = new SpoutSender[SpreadMax];
            }

            for (int i = 0; i < SpreadMax; i++)
            {
                if (FWrite[i])
                {
                    //if there was an existing one dispose it
                    if ((i < FSpoutSender.Length) && (FSpoutSender[i] != null))
                    {
                        FSpoutSender[i].Dispose();
                    }

                    //create the spoutsender

                    // Default format should be = 28 - DirectX 11 (DXGI_FORMAT_R8G8B8A8_UNORM)
                    FSpoutSender[i] = new SpoutSender(FSenderName[i], FHandle[i], FWidth[i], FHeight[i], 28, 0);

                    // TODO - create format pin and pass texture format in as integer
                    // UInt32 format = Convert.ToUInt32(FFormat[i].ToString());
                    // FSpoutSender[i] = new SpoutSender(FSenderName[i], FHandle[i], FWidth[i], FHeight[i], format, 0);

                    var succ = FSpoutSender[i].Initialize();
                    FLogger.Log(LogType.Debug, "Writing Spout sender " + (succ ? "succeeded!" : "failed!"));
                }
            }
        }
Пример #9
0
 public void OnImportsSatisfied()
 {
     FOutput.AssignFrom(SpoutSender.GetSenderNames());
 }