RenderTexture
class in UnityEngine · UnityEngine.CoreModule · inherits from Texture
A texture cameras (Camera.targetTexture) and Graphics.Blit draw into, and materials and UI sample. Its contents live on the GPU only: reading them back (ReadPixels, AsyncGPUReadback) isn't supported yet, nor are GL and DrawMeshNow into active.
Constructors 1
RenderTexture(int width, int height, int depth)RenderTexture(int width, int height, int depth, RenderTextureFormat format)RenderTexture(int width, int height, int depth, RenderTextureFormat format, RenderTextureReadWrite readWrite)RenderTexture(int width, int height, int depth, Experimental.Rendering.GraphicsFormat format)RenderTexture(int width, int height, int depth, Experimental.Rendering.GraphicsFormat format, int mipCount)RenderTexture(int width, int height, Experimental.Rendering.GraphicsFormat colorFormat, Experimental.Rendering.GraphicsFormat depthStencilFormat)RenderTexture(int width, int height, Experimental.Rendering.GraphicsFormat colorFormat, Experimental.Rendering.GraphicsFormat depthStencilFormat, int mipCount)RenderTexture(RenderTexture textureToCopy)Properties 15
static RenderTexture? active { get; set; }The render target drawing goes to (null: the screen).
int antiAliasing { get; set; }bool autoGenerateMips { get; set; }int depth { get; set; }bool enableRandomWrite { get; set; }RenderTextureFormat format { get; set; }Experimental.Rendering.GraphicsFormat graphicsFormat { get; set; }int height { get; set; }bool isDataSRGB { get; }bool isPowerOfTwo { get; set; }Whether both sides are powers of two (setting it does nothing, as in Unity).
bool sRGB { get; }bool useDynamicScale { get; set; }bool useMipMap { get; set; }int volumeDepth { get; set; }int width { get; set; }Methods 7
bool Create()void DiscardContents()void DiscardContents(bool discardColor, bool discardDepth)static RenderTexture GetTemporary(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.Default, RenderTextureReadWrite readWrite = RenderTextureReadWrite.Default, int antiAliasing = 1)static RenderTexture GetTemporary(int width, int height, int depthBuffer, RenderTextureFormat format, RenderTextureReadWrite readWrite)static RenderTexture GetTemporary(int width, int height, int depthBuffer, RenderTextureFormat format)static RenderTexture GetTemporary(int width, int height, int depthBuffer)static RenderTexture GetTemporary(int width, int height)static RenderTexture GetTemporary(int width, int height, int depthBuffer, Experimental.Rendering.GraphicsFormat format, int antiAliasing = 1)static RenderTexture GetTemporary(int width, int height, int depthBuffer, Experimental.Rendering.GraphicsFormat format)bool IsCreated()void MarkRestoreExpected()void Release()static void ReleaseTemporary(RenderTexture temp)Not in Tassix yet 17
ApplyDynamicScale ConvertToEquirect GenerateMips GetNativeDepthBufferPtr ResolveAntiAliasedSurface SetGlobalShaderProperty SupportsStencil bindTextureMS colorBuffer depthBuffer depthStencilFormat descriptor enableShadingRate memorylessMode stencilFormat useDynamicScaleExplicit vrUsage
Checked against Unity
Conformance scenarios that exercise it, recorded in Unity and compared event by event.