Custom Render Textures are an extension to Render Textures that allow you to render directly to the Texture using a Shader.
Custom Render Textures are an extension to Render Textures that allow you to update a texture with a Shader, and then use it in a regular Material. This is useful for implementing all kinds of complex simulations, for instance: water caustics, ripple simulations for rain effects, or splatting liquids against a wall. Also provided is a scripting and Shader framework to help with more complicated configurations like partial or multi-pass updates, and varying update frequency.
cubemapFaceMask | The bit field that you can use to enable or disable update on each of the cubemap faces. The bit order from least to most significant bit is as follows: +X, -X, +Y, -Y, +Z, -Z. |
doubleBuffered | When this parameter is set to true, Unity double-buffers the Custom Render Texture so that you can access it during its own update. |
initializationColor | The color that Unity uses to initialize a Custom Render Texture. Unity ignores this parameter if an initializationMaterial is set. |
initializationMaterial | The Material that Unity uses to initialize a Custom Render Texture. Initialization texture and color are ignored if you have set this parameter. |
initializationMode | Determine how Unity initializes a texture. |
initializationSource | Determine if Unity initializes the Custom Render Texture with a Texture and a Color or a Material. |
initializationTexture | The Texture that Unity uses to initialize a Custom Render Texture, multiplied by the initialization color. Unity ignores this parameter if an initializationMaterial is set. |
material | The Material that Unity uses to initialize the content of a Custom Render Texture. |
shaderPass | The Shader Pass Unity uses to update the Custom Render Texture. |
updateMode | Determine how Unity updates the Custom Render Texture. |
updatePeriod | The period in seconds that Unity updates real-time Custom Render Textures. A value of 0.0 means Unity updates real-time Custom Render Textures every frame. |
updateZoneSpace | The space in which Unity expresses update zones. You can set this to Normalized or Pixel space. |
wrapUpdateZones | When this parameter is set to true, Unity wraps Update zones around the border of the Custom Render Texture. Otherwise, Unity clamps Update zones at the border of the Custom Render Texture. |
CustomRenderTexture | 创建一个新的自定义渲染纹理。 |
ClearUpdateZones | 清除所有更新区域。 |
EnsureDoubleBufferConsistency | Updates the internal Render Texture that a Custom Render Texture uses for double buffering, so that it matches the size and format of the Custom Render Texture. |
GetDoubleBufferRenderTexture | Gets the Render Texture that this Custom Render Texture uses for double buffering. |
GetUpdateZones | 返回更新区域列表。 |
Initialize | Initializes the Custom Render Texture at the start of the next frame. Unity calls /Initialise()/ before /CustomRenderTexture.Update/. |
SetUpdateZones | 为自定义渲染纹理设置更新区域列表。 |
Update | Triggers an update of the Custom Render Texture. |
active | 当前处于活动状态的渲染纹理。 |
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 size of the Textures, in bytes, that Unity loads if there were no other constraints. Before Unity loads any Textures, it applies the memory budget which reduces the loaded Texture resolution if the Texture sizes exceed its value. The `desiredTextureMemory` value takes into account the mipmap levels that Unity has requested or that you have set manually.For example, if Unity does not load a Texture at full resolution because it is far away or its requested mipmap level is greater than 0, Unity reduces the `desiredTextureMemory` value to match the total memory needed.The `desiredTextureMemory` value can be greater than the `targetTextureMemory` value. |
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 | The total amount of Texture memory that Unity allocates to the Textures in the scene after it applies the memory budget and finishes loading Textures. `targetTextureMemory`also takes mipmap streaming settings into account. This value only includes instances of Texture2D and CubeMap Textures. It does not include any other Texture types, or 2D and CubeMap Textures that Unity creates internally. |
totalTextureMemory | The total amount of Texture memory that Unity would use if it loads all Textures at mipmap level 0.This is a theoretical value that does not take into account any input from the streaming system or any other input, for example when you set the`Texture2D.requestedMipmapLevel` manually.To see a Texture memory value that takes inputs into account, use `desiredTextureMemory`.`totalTextureMemory` only includes instances of Texture2D and CubeMap Textures. It does not include any other Texture types, or 2D and CubeMap Textures that Unity creates internally. |
hideFlags | 该对象应该隐藏、随场景一起保存还是由用户修改? |
name | 对象的名称。 |
antiAliasing | RenderTexture 的抗锯齿级别。 |
autoGenerateMips | 如果设置了该标志,则自动生成多级渐进纹理级别。 |
bindTextureMS | 如果为 true 且 antiAliasing 大于 1,则默认不解析渲染纹理。如果需要在着色器中将渲染纹理绑定为多重采样纹理,请使用该属性。 |
colorBuffer | 渲染纹理的颜色缓冲区(只读)。 |
depth | The precision of the render texture's depth buffer in bits (0, 16, 24 and 32 are supported). |
depthBuffer | 渲染纹理的深度/模板缓冲区(只读)。 |
depthStencilFormat | The format of the depth/stencil buffer. |
descriptor | 此结构包含创建 RenderTexture 需要的所有信息。可以复制、缓存和重用来轻松创建全部共享相同属性的 RenderTexture。 |
dimension | 渲染纹理的维度(类型)。 |
enableRandomWrite | 在 Shader Model 5.0 级别着色器上启用随机访问写入该渲染纹理。 |
graphicsFormat | The color format of the render texture. You can set the color format to None to achieve depth-only rendering. |
height | 渲染纹理的高度(以像素为单位)。 |
memorylessMode | 渲染纹理无记忆模式属性。 |
sRGB | 该渲染纹理是否使用 sRGB 读/写转换?(只读) |
stencilFormat | The format of the stencil data that you can encapsulate within a RenderTexture.Specifying this property creates a stencil element for the RenderTexture and sets its format. This allows for stencil data to be bound as a Texture to all shader types for the platforms that support it. This property does not specify the format of the stencil buffer, which is constrained by the depth buffer format specified in RenderTexture.depth.Currently, most platforms only support R8_UInt (DirectX11, DirectX12), while PS4 also supports R8_UNorm. |
useDynamicScale | Is the render texture marked to be scaled by the Dynamic Resolution system. |
useMipMap | 如果设置该标志,则渲染纹理具有多级渐进纹理。 |
volumeDepth | 3D 渲染纹理的体积范围或数组纹理的切片数。 |
vrUsage | 如果该 RenderTexture 是在立体渲染中使用的 VR 眼睛纹理,则该属性决定将进行哪些特殊渲染(如果有)。 |
width | 渲染纹理的宽度(以像素为单位)。 |
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. |
height | Height of the Texture in pixels. (Read Only) |
imageContentsHash | 纹理的哈希值。 |
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 | 纹理坐标换行模式。 |
wrapModeU | 纹理 U 坐标换行模式。 |
wrapModeV | 纹理 V 坐标换行模式。 |
wrapModeW | Texture3D 的纹理 W 坐标换行模式。 |
GetInstanceID | Gets the instance ID of the object. |
ToString | 返回对象的名称。 |
ConvertToEquirect | 将渲染纹理转换为等距圆柱投影格式(都为立体或单视场等距圆柱投影)。 左眼占据上半部分,右眼占据底部。单视场版本将占据整个纹理。 纹理尺寸必须为 TextureDimension.Cube 类型。 |
Create | 实际创建 RenderTexture。 |
DiscardContents | 提示 GPU 驱动程序将不使用 RenderTexture 的内容。 |
GenerateMips | 生成渲染纹理的多级渐进纹理级别。 |
GetNativeDepthBufferPtr | 获取指向该深度缓冲区资源的原生(底层图形 API)指针。 |
IsCreated | 是否实际创建了该渲染纹理? |
Release | 释放 RenderTexture。 |
ResolveAntiAliasedSurface | 强制解析抗锯齿渲染纹理。 |
SetGlobalShaderProperty | 将该 RenderTexture 指定为名为 propertyName 的全局着色器属性。 |
GetNativeTexturePtr | Retrieve a native (underlying graphics API) pointer to the Texture resource. |
IncrementUpdateCount | 递增更新计数器。 |
Destroy | 移除 GameObject、组件或资源。 |
DestroyImmediate | 立即销毁对象 /obj/。强烈建议您改用 Destroy。 |
DontDestroyOnLoad | 在加载新的 Scene 时,请勿销毁 Object。 |
FindObjectOfType | 返回第一个类型为 type 的已加载的激活对象。 |
FindObjectsOfType | Gets a list of all loaded objects of Type type. |
Instantiate | 克隆 original 对象并返回克隆对象。 |
GetTemporary | 分配临时渲染纹理。 |
ReleaseTemporary | 释放使用 GetTemporary 分配的临时纹理。 |
SupportsStencil | RenderTexture 是否具有模板缓冲区? |
SetGlobalAnisotropicFilteringLimits | 设置各向异性限制。 |
SetStreamingTextureMaterialDebugProperties | This function sets mipmap streaming debug properties on any materials that use this Texture through the mipmap streaming system. |
bool | 该对象是否存在? |
operator != | 比较两个对象是否引用不同的对象。 |
operator == | 比较两个对象引用,判断它们是否引用同一个对象。 |