class in UnityEngine
/
Inherits from:Texture
/
Implemented in:UnityEngine.CoreModule
Suggest a change Success!Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close Submission failedFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close Your name Your email Suggestion* Switch to Manual DescriptionClass for handling Cubemap arrays.
Modern graphics APIs (e.g. D3D10.1 and later, OpenGL 4.0 and later, Metal on macOS, PS4) support "cubemap arrays", which are arrays of same size & format cubemaps. From the shader side, they are treated as a single resource, and sampling them needs an extra coordinate that indicates which array element to sample from.
Typically cubemap arrays are useful for implementing efficient reflection probe, lighting and shadowing systems (all reflection/cookie/shadow cubemaps in a single array).
Cubemap arrays do not have an import pipeline for them, and must be created from code, either at runtime or in editor scripts. Using Graphics.CopyTexture is useful for fast copying of pixel data from regular Cubemap textures into elements of a cubemap array. From editor scripts, a common way of creating serialized cubemap array is to create it, fill with data (either via Graphics.CopyTexture from regular cubemaps, or via SetPixels or SetPixels32) and save it as an asset via AssetDatabase.CreateAsset.
Note that not all platforms and GPUs support cubemap arrays. Use SystemInfo.supportsCubemapArrayTextures to check. Also, this class does not support CubemapArray creation with a Crunch compression TextureFormat.
Properties Property Description cubemapCount Number of cubemaps in the array (Read Only). format Texture format (Read Only). Constructors Constructor Description CubemapArray Create a new cubemap array. Public Methods Method Description Apply Copies changes you've made in a CPU texture to the GPU. CopyPixels Copies pixel data from another texture on the CPU. GetPixelData Gets the raw data from a texture. GetPixels Gets the pixel color data for a mipmap level of a face of a slice as Color structs. GetPixels32 Gets the pixel color data for a mipmap level of a face of a slice as Color32 structs. SetPixelData Sets the raw data of an entire mipmap level of a face directly in CPU memory. SetPixels Sets the pixel colors of an entire mipmap level of a face of a slice. SetPixels32 Sets the pixel colors of an entire mipmap level of a face of a slice. Inherited Members Static Properties Property Description allowThreadedTextureCreation Allow Unity internals to perform Texture creation on any thread (rather than the dedicated render thread). currentTextureMemory The amount of memory that all Textures in the scene use. desiredTextureMemory The total amount of texture memory, in bytes, that Unity would use if no constraints are applied. GenerateAllMips Can be used with Texture constructors that take a mip count to indicate that all mips should be generated. The value of this field is -1. nonStreamingTextureCount The number of non-streaming Textures in the scene. This includes instances of Texture2D and CubeMap Textures. This does not include any other Texture types, or 2D and CubeMap Textures that Unity creates internally. nonStreamingTextureMemory The amount of memory Unity allocates for non-streaming Textures in the scene. This only includes instances of Texture2D and CubeMap Textures. This does not include any other Texture types, or 2D and CubeMap Textures that Unity creates internally. streamingMipmapUploadCount How many times has a Texture been uploaded due to Texture mipmap streaming. streamingRendererCount Number of renderers registered with the Texture streaming system. streamingTextureCount Number of streaming Textures. streamingTextureDiscardUnusedMips This property forces the streaming Texture system to discard all unused mipmaps instead of caching them until the Texture memory budget is exceeded. This is useful when you profile or write tests to keep a predictable set of Textures in memory. streamingTextureForceLoadAll Force streaming Textures to load all mipmap levels. streamingTextureLoadingCount Number of streaming Textures with mipmaps currently loading. streamingTexturePendingLoadCount Number of streaming Textures with outstanding mipmaps to be loaded. targetTextureMemory Total texture memory usage in bytes after applying the memory budget and loading all textures. totalTextureMemory The total texture memory, in bytes, that Unity would use if all textures are loaded at full resolution. Properties Property Description hideFlags Should the object be hidden, saved with the Scene or modifiable by the user? name The name of the object. anisoLevel Defines the anisotropic filtering level of the Texture. dimension Dimensionality (type) of the Texture (Read Only). filterMode Filtering mode of the Texture. graphicsFormat Returns the GraphicsFormat format or color format of a Texture object. graphicsTexture GraphicsTexture that represents the texture resource uploaded to the graphics device (read-only). height Height of the Texture in pixels (Read Only). imageContentsHash The hash value of the Texture. isDataSRGB Returns true if the texture pixel data is in sRGB color space (Read Only). isReadable Whether Unity stores an additional copy of this texture's pixel data in CPU-addressable memory. mipMapBias The mipmap bias of the Texture. mipmapCount How many mipmap levels are in this Texture (Read Only). updateCount This counter is incremented when the Texture is updated. width Width of the Texture in pixels (Read Only). wrapMode Texture coordinate wrapping mode. wrapModeU Texture U coordinate wrapping mode. wrapModeV Texture V coordinate wrapping mode. wrapModeW Texture W coordinate wrapping mode for Texture3D. Operators Operator Description bool Does the object exist? operator != Compares if two objects refer to a different object. operator == Compares two object references to see if they refer to the same object.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4