public override void OnRenderImage(Texture source, RenderTexture destination)
        {
            GetDimensions(out var width, out var height);
            var tempRT = RenderTexture.GetTemporary(width, height);

            base.OnRenderImage(source, tempRT);

            rpMat.SetTexture("_ProsTex", tempRT);
            rpMat.SetVector(SP.eyeGaze, EyeGaze.Get(eyeGazeSource, headset));
            rpMat.SetVector(SP.headsetDiameter, headset.GetRetinalDiameter());
            rpMat.SetFloat("_natural_vision_width", this.width);
            rpMat.SetFloat("_natural_vision_saturation", saturation);
            rpMat.SetFloat("_natural_vision_brightness", _brightness);
            UpdateAcuity();
            Graphics.Blit(Prosthesis.Source, destination, rpMat);

            RenderTexture.ReleaseTemporary(tempRT);
        }
Пример #2
0
        /*
         * Private methods
         */

        private void UpdatePerFrameData()
        {
            // pulse
            phos.SetInt(SP.pulse, Pulse ? 1 : 0);

            if (useFading)
            {
                // fading (can safely be uploaded every frame because it is just a RenderTexture pointer)
                phos.SetTexture(SP.fadeTexture, fadeRT.Back);
            }

            // eye gaze
            var eyeGaze = EyeGaze.Get(eyeGazeSource, headset);

            phos.SetVector(SP.eyeGaze, eyeGaze);
            tail.SetVector(SP.eyeGaze, eyeGaze);

            // eye gaze delta
            phos.SetVector(SP.eyeGazeDelta, EyeGaze.GetDelta(eyeGazeSource, headset));
        }