pub struct RenderTexture {Show 23 fields
pub m_ColorFormat: i32,
pub m_Height: i32,
pub m_MipMap: bool,
pub m_Name: String,
pub m_TextureSettings: GLTextureSettings,
pub m_Width: i32,
pub m_AntiAliasing: Option<i32>,
pub m_BindMS: Option<bool>,
pub m_DepthFormat: Option<i32>,
pub m_DepthStencilFormat: Option<i32>,
pub m_Dimension: Option<i32>,
pub m_DownscaleFallback: Option<bool>,
pub m_EnableCompatibleFormat: Option<bool>,
pub m_ForcedFallbackFormat: Option<i32>,
pub m_GenerateMips: Option<bool>,
pub m_IsAlphaChannelOptional: Option<bool>,
pub m_IsCubemap: Option<bool>,
pub m_IsPowerOfTwo: Option<bool>,
pub m_MipCount: Option<i32>,
pub m_SRGB: Option<bool>,
pub m_ShadowSamplingMode: Option<i32>,
pub m_UseDynamicScale: Option<bool>,
pub m_VolumeDepth: Option<i32>,
}Expand description
RenderTexture is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: Render textures are textures that can be rendered to. They can be used to implement image based rendering effects, dynamic shadows,
projectors, reflections or surveillance cameras.One typical usage of render textures is setting them as the “target texture” property
of a Camera (Camera.targetTexture), this will make a camera render into a texture
instead of rendering to the screen.Keep in mind that render texture contents can become “lost” on certain events, like loading a new level, system going to a screensaver mode, in and out of fullscreen and so on.
When that happens, your existing render textures will become “not yet created” again,
you can check for that with IsCreated function.As with other “native engine object” types, it is important to pay attention to the lifetime of
any render textures and release them when you are finished using them with the Release function,
as they will not be garbage collected like normal managed types.A render texture only has a data representation on the GPU and you need to use Texture2D.ReadPixels to transfer its contents to CPU memory.The initial contents of a newly created render texture are undefined. On some platforms and APIs the contents will default to black, but you shouldn’t depend on this. You can use LoadStoreActionDebugModeSettings to highlight undefined areas of the display, to help you debug rendering problems in your built application.See Also: Camera.targetTexture.
Fields§
§m_ColorFormat: i32§m_Height: i32Height of the Texture in pixels (Read Only).
m_MipMap: bool§m_Name: StringThe name of the object.
m_TextureSettings: GLTextureSettings§m_Width: i32Width of the Texture in pixels (Read Only).
m_AntiAliasing: Option<i32>The antialiasing level for the RenderTexture. i32: (4.2.0 - 2022.3.2f1)
m_BindMS: Option<bool>bool: (2017.3.0b1 - 2022.3.2f1)
m_DepthFormat: Option<i32>i32: (3.4.0 - 2021.2.0a17)
m_DepthStencilFormat: Option<i32>The format of the depth/stencil buffer. i32: (2021.2.0b1 - 2022.3.2f1)
m_Dimension: Option<i32>Dimensionality (type) of the Texture (Read Only). i32: (5.6.0b1 - 2022.3.2f1)
m_DownscaleFallback: Option<bool>bool: (2017.3.0b1 - 2022.3.2f1)
m_EnableCompatibleFormat: Option<bool>bool: (2019.1.0b1 - 2022.3.2f1)
m_ForcedFallbackFormat: Option<i32>i32: (2017.3.0b1 - 2022.3.2f1)
m_GenerateMips: Option<bool>bool: (4.3.0 - 2022.3.2f1)
m_IsAlphaChannelOptional: Option<bool>bool: (2020.2.0b1 - 2022.3.2f1)
m_IsCubemap: Option<bool>bool: (3.4.0 - 3.5.7)
m_IsPowerOfTwo: Option<bool>bool: (3.4.0 - 3.4.0)
m_MipCount: Option<i32>i32: (2019.2.0b1 - 2022.3.2f1)
m_SRGB: Option<bool>Does this render texture use sRGB read/write conversions? (Read Only). bool: (3.5.0 - 2022.3.2f1)
m_ShadowSamplingMode: Option<i32>i32: (2021.2.0f1 - 2022.3.2f1)
m_UseDynamicScale: Option<bool>Is the render texture marked to be scaled by the Dynamic Resolution system. bool: (2017.3.0b1 - 2022.3.2f1)
m_VolumeDepth: Option<i32>Volume extent of a 3D render texture or number of slices of array texture. i32: (5.6.0b1 - 2022.3.2f1)