Reinitialize
Reinitializes a Texture2D, making it possible for you to replace width, height, textureformat, and graphicsformat data for that texture.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
Reinitialize(int, int)
Reinitializes a Texture2D, making it possible for you to replace , , , and data for that texture.
widthheighttextureformatgraphicsformatpublic bool Reinitialize(int width, int height)
Parameters
Returns
Type | Description |
|---|---|
| bool | |
Remarks
This action also clears the pixel data associated with the texture from the CPU and GPU.
This function is very similar to the Texture constructor, except it works on a Texture object that already exists rather than creating a new one.
It is not possible to reinitialize Crunched textures, so if you pass a Crunched texture to this method, it returns . See texture formats for more information about compressed and crunched textures.
falseCall Texture2D.Apply to upload the changed pixels to the graphics card.
Texture.isReadable must be .
trueTexture2D.Reinitialize_TexelSize_HDRTexture2D.Reinitialize_TexelSize_HDRReinitialize(int, int, TextureFormat, bool)
Reinitializes a Texture2D, making it possible for you to replace , , , and data for that texture.
widthheighttextureformatgraphicsformatpublic bool Reinitialize(int width, int height, TextureFormat format, bool hasMipMap)
Parameters
The new width of the texture.
The new height of the texture.
The new format of the texture.
Whether the texture reserves memory for a full mipmap chain.
Returns
Type | Description |
|---|---|
| bool | |
Remarks
This action also clears the pixel data associated with the texture from the CPU and GPU.
This function is very similar to the Texture constructor, except it works on a Texture object that already exists rather than creating a new one.
It is not possible to reinitialize Crunched textures, so if you pass a Crunched texture to this method, it returns . See texture formats for more information about compressed and crunched textures.
falseCall Texture2D.Apply to upload the changed pixels to the graphics card.
Texture.isReadable must be .
trueTexture2D.Reinitialize_TexelSize_HDRTexture2D.Reinitialize_TexelSize_HDRReinitialize(int, int, GraphicsFormat, bool)
Reinitializes a Texture2D, making it possible for you to replace , , , and data for that texture.
widthheighttextureformatgraphicsformatpublic bool Reinitialize(int width, int height, GraphicsFormat format, bool hasMipMap)
Parameters
The new width of the texture.
The new height of the texture.
The new format of the texture.
Whether the texture reserves memory for a full mipmap chain.
Returns
Type | Description |
|---|---|
| bool | |
Remarks
This action also clears the pixel data associated with the texture from the CPU and GPU.
This function is very similar to the Texture constructor, except it works on a Texture object that already exists rather than creating a new one.
It is not possible to reinitialize Crunched textures, so if you pass a Crunched texture to this method, it returns . See texture formats for more information about compressed and crunched textures.
falseCall Texture2D.Apply to upload the changed pixels to the graphics card.
Texture.isReadable must be .
trueTexture2D.Reinitialize_TexelSize_HDRTexture2D.Reinitialize_TexelSize_HDR