Esempio n. 1
0
        //public void AssignToAggregateClipPlaneShader()
        //{
        //    //AggregateClipPlane canvas = aggregateClipPlane.GetComponent<AggregateClipPlane>();
        //    //Vector2[][] uvArray = GenerateUVArray();
        //    //canvas.SetUVArray(uvArray);
        //    ////Texture2DArray texArray = GenerateTextureArray();
        //    //Texture2D[] texArray = GenerateTextureArray();
        //    //canvas.SetTextures(texArray);
        //    //textureArray = texArray;

        //    AssignToAggregateClipPlaneShader(CamIndicesToIgnoreList);
        //}

        //public void AssignToAggregateClipPlaneShader(List<int> camIndicesToIgnore)
        public void AssignToAggregateClipPlaneShader()
        {
            AggregateClipPlane canvas = aggregateClipPlane.GetComponent <AggregateClipPlane>();

            Vector2[][] uvArray  = GenerateUVArray();
            Texture2D[] texArray = GenerateTextureArray();

            //foreach(int index in camIndicesToIgnore)
            //{
            //    uvArray[index] = GenerateBlankUV();
            //    texArray[index] = GenerateBlackTexture();
            //}

            canvas.SetUVArray(uvArray);
            canvas.SetTextures(texArray);
            textureArray = texArray;
        }
Esempio n. 2
0
        public void Update()
        {
            if (aggregatePlaneChild == null)
            {
                setAggregatePlaneChild();
            }

            // Update cam indices to ignore
            //CamIndicesToIgnoreList = ParseCamIndicesToIgnore(CamIndicesToIgnore);

            // Update textures
            AggregateClipPlane canvas = aggregateClipPlane.GetComponent <AggregateClipPlane>();

            for (int i = 0; i < viewingCamManager.ViewingCameras.Length; i++)
            {
                //if (!CamIndicesToIgnoreList.Contains(i))
                //{
                WebCamTexture feed = viewingCamManager.ViewingCameras[i].GetComponent <WebCamIdentifier>().WebCamFeed;
                if (textureArray != null &&
                    textureArray.Length > i)
                {
                    Graphics.CopyTexture(feed, textureArray[i]);
                }
                if (canvas.TextureArray != null &&
                    canvas.TextureArray.Length > i)
                {
                    Graphics.CopyTexture(feed, canvas.TextureArray[i]);
                }
                //}
            }

            // Update UVs
            Vector2[][] uvs = GenerateUVArray();
            canvas.SetUVArray(uvs);

            if (interpolationMode == InterpolationStyles.ShaderWeighing)
            {
                Update_ShaderWeighing();
            }
        }