用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:rendertexture:rendertexture

RenderTexture 渲染纹理

class in UnityEngine/Inherits from: Texture

Description 描述

Render textures are textures that can be rendered to.

RenderTexture是可以被渲染的纹理。

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.

渲染纹理的典型用法之一是设置它们为摄像机的“目标纹理”属性(Camera.targetTexture),该属性将使得相机渲染到纹理而不是渲染到屏幕。

Another use case is manually implementing various rendering effects, for example Image Effects. There you often get temporary short-lived render textures (GetTemporary and ReleaseTemporary functions), and manually render objects into them (see Graphics.DrawMeshNow and Graphics.Blit).

另一种使用方法是手动执行各种各样的渲染效果,例如图像效果。你经常获取临时渲染纹理(GetTemporary和ReleaseTemporary 函数),并且手动渲染对象到它们(请参考Graphics.DrawMeshNow和Graphics.Blit)。

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.

请记住渲染纹理内容在某些事件中可能变成“丢失”,像加载新级别,系统运行屏幕保护程序模式,进出全屏等等。当那些发生时,你现在的渲染纹理将会再次变成“还未创建”,你可以使用IsCreated 函数检查。

Static Variables 静态变量

activeCurrently active render texture.
激活当前的渲染贴图。

Variables 变量

antiAliasingThe antialiasing level for the RenderTexture.
渲染纹理的抗锯齿级别。
colorBufferColor buffer of the render texture (Read Only).
渲染纹理的颜色缓存区(只读)。
depthThe precision of the render texture's depth buffer in bits (0, 16, 24 are supported).
渲染纹理的深度缓存的精度单位字节(支持0, 16, 24)。
depthBufferDepth/stencil buffer of the render texture (Read Only).
渲染纹理的深度/模具缓存区(只读)。
enableRandomWriteEnable random access write into this render texture on Shader Model 5.0 level shaders.
在着色器5.0级别中启用随机存取写入渲染纹理。
formatThe color format of the render texture.
渲染纹理的颜色格式。
generateMipsShould mipmap levels be generated automatically?
是否自动生成mipmap 级别?
heightThe height of the render texture in pixels.
渲染纹理的高度单位像素。
isCubemapIf enabled, this Render Texture will be used as a Cubemap.
如果启用,该渲染纹理将会被使用作一个立方体贴图。
isVolumeIf enabled, this Render Texture will be used as a Texture3D.
如果启用,该渲染纹理将会被用作3D纹理。
sRGBDoes this render texture use sRGB read/write conversions (Read Only).
该渲染纹理是否使用标准色读取/写入转换(只读)。
useMipMapUse mipmaps on a render texture?
在渲染纹理中使用mipmaps ?
volumeDepthVolume extent of a 3D render texture.
3D渲染贴图的体积范围。
widthThe width of the render texture in pixels.
该渲染纹理的宽度单位像素。

Constructors 构造

RenderTextureCreates a new RenderTexture object.
创建一个新的渲染纹理对象。

Public Functions 公共函数

CreateActually creates the RenderTexture.
实际上指创建的渲染纹理。
DiscardContentsDiscards the contents of the RenderTexture.
渲染纹理丢失的内容。
IsCreatedIs the render texture actually created?
该渲染纹理是否已经创建?
MarkRestoreExpectedIndicate that there's a RenderTexture restore operation expected.
表明渲染纹理恢复预期操作。
ReleaseReleases the RenderTexture.
释放渲染纹理。
SetGlobalShaderPropertyAssigns this RenderTexture as a global shader property named propertyName.
指定这个RenderTexture作为一个名为propertyName的全局shader属性。

Static Functions 静态函数

GetTemporaryAllocate a temporary render texture.
分配一个临时的渲染纹理。
ReleaseTemporaryRelease a temporary texture allocated with GetTemporary.
释放GetTemporary分配的临时渲染纹理。
SupportsStencilDoes a RenderTexture have stencil buffer?
渲染纹理是否支持模板缓存?
script/unityengine/classes/rendertexture/rendertexture.txt · 最后更改: 2016/08/02 05:24 (外部编辑)