UnityEngine.RenderTexture.RenderTexture C# (CSharp) Method

RenderTexture() public method

Creates a new RenderTexture object.

public RenderTexture ( int width, int height, int depth, RenderTextureFormat format, RenderTextureReadWrite readWrite ) : System
width int Texture width in pixels.
height int Texture height in pixels.
depth int Number of bits in depth buffer (0, 16 or 24). Note that only 24 bit depth has stencil buffer.
format RenderTextureFormat Texture color format.
readWrite RenderTextureReadWrite How or if color space conversions should be done on texture read/write.
return System
        public RenderTexture(int width, int height, int depth, RenderTextureFormat format, RenderTextureReadWrite readWrite)
        {
            Internal_CreateRenderTexture(this);
            this.width = width;
            this.height = height;
            this.depth = depth;
            this.format = format;
            bool sRGB = readWrite == RenderTextureReadWrite.sRGB;
            if (readWrite == RenderTextureReadWrite.Default)
            {
                sRGB = QualitySettings.activeColorSpace == ColorSpace.Linear;
            }
            Internal_SetSRGBReadWrite(this, sRGB);
        }

Same methods

RenderTexture::RenderTexture ( int width, int height, int depth ) : System
RenderTexture::RenderTexture ( int width, int height, int depth, RenderTextureFormat format ) : System