Пример #1
0
        private void ProcessDepthMask(InputFeed feed)
        {
            if (context.Data == null)
            {
                return;
            }

            // Set up material
            DepthMaskMaterial.EnableKeyword("DEPTH_REALSENSE");
            DepthMaskMaterial.SetFloat("_RsDepthMultiplier", 100);
            DepthMaskMaterial.mainTexture = DepthTexture;

            DepthMaskMaterial.SetFloat("_BgStaticDepth_MaxDepth", context.Data.staticDepthData.maxDepth);

            DepthMaskBlur = RenderTexture.GetTemporary(depthWidth / decimationAmount / 2, depthHeight / decimationAmount / 2, 0, RenderTextureFormat.Default);

            Graphics.Blit(DepthTexture, DepthMask, DepthMaskMaterial);

            BlurMaterial.SetTexture("_ImageTex", RGBTexture);

            // Blur result
            BlurMaterial.EnableKeyword("BLUR_HORIZONTAL");
            Graphics.Blit(DepthMask, DepthMaskBlur, BlurMaterial);
            BlurMaterial.DisableKeyword("BLUR_HORIZONTAL");

            BlurMaterial.EnableKeyword("BLUR_VERTICAL");
            Graphics.Blit(DepthMaskBlur, DepthMask, BlurMaterial);
            BlurMaterial.DisableKeyword("BLUR_VERTICAL");


            RenderTexture.ReleaseTemporary(DepthMaskBlur);
        }
Пример #2
0
        private void ProcessInfrared(InputFeed feed)
        {
            if (context.Data == null)
            {
                return;
            }

            // Set up material
            InfraredMaterial.mainTexture = IRTexture;

            Graphics.Blit(IRTexture, DepthMask, InfraredMaterial);
        }