Example #1
0
 public RenderTexture(RenderTexture textureToCopy)
 {
     if (textureToCopy == null)
     {
         throw new ArgumentNullException("textureToCopy");
     }
     RenderTexture.ValidateRenderTextureDesc(textureToCopy.descriptor);
     RenderTexture.Internal_Create(this);
     this.SetRenderTextureDescriptor(textureToCopy.descriptor);
 }
Example #2
0
        public RenderTexture(int width, int height, int depth, [UnityEngine.Internal.DefaultValue("RenderTextureFormat.Default")] RenderTextureFormat format, [UnityEngine.Internal.DefaultValue("RenderTextureReadWrite.Default")] RenderTextureReadWrite readWrite)
        {
            RenderTexture.Internal_Create(this);
            this.width  = width;
            this.height = height;
            this.depth  = depth;
            this.format = format;
            bool flag = QualitySettings.activeColorSpace == ColorSpace.Linear;

            this.SetSRGBReadWrite((readWrite != RenderTextureReadWrite.Default) ? (readWrite == RenderTextureReadWrite.sRGB) : flag);
        }
Example #3
0
        public RenderTexture(int width, int height, int depth, GraphicsFormat format)
        {
            bool flag = !base.ValidateFormat(format, FormatUsage.Render);

            if (!flag)
            {
                RenderTexture.Internal_Create(this);
                this.width          = width;
                this.height         = height;
                this.depth          = depth;
                this.graphicsFormat = format;
                this.SetSRGBReadWrite(GraphicsFormatUtility.IsSRGBFormat(format));
            }
        }
Example #4
0
 public RenderTexture(RenderTextureDescriptor desc)
 {
     RenderTexture.ValidateRenderTextureDesc(desc);
     RenderTexture.Internal_Create(this);
     this.SetRenderTextureDescriptor(desc);
 }