public static Texture2D BakeTexture(Texture2D sourceTexture, Material firstPassMat)
        {
            if (sourceTexture != null)
            {
                sourceTexture = Utilities_Texture2D.GetReadableTexture2D(sourceTexture, firstPassMat);
            }

            return(sourceTexture);
        }
Пример #2
0
        public static Texture2D GetMask(Dictionary <string, Texture2D> cache, Texture2D maskTexture, int width, int height)
        {
            string maskID = maskTexture.name + ":" + width + "x" + height;

            if (!cache.TryGetValue(maskID, out Texture2D mask))
            {
                mask = Utilities_Texture2D.GetReadableTexture2D(maskTexture, width, height);

                cache.Add(maskID, mask);
            }

            return(mask);
        }