用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:enumerations:rendertexturereadwrite:rendertexturereadwrite

RenderTextureReadWrite 渲染纹理读写

Description 描述

Color space conversion mode of a RenderTexture.

When using Gamma color space, no conversions are done of any kind, and this setting is not used.

When Linear color space is used, then by default non-HDR render textures are considered to contain sRGB data (i.e. “regular colors”), and fragment shaders are considered to output linear color values. So by default the fragment shader color value is converted into sRGB when rendering into a texture; and when sampling the texture in the shader the sRGB colors are converted into linear values. This is the sRGB read-write mode; and the Default mode matches that when linear color space is used. When this mode is set on a render texture, RenderTexture.sRGB will return true.

However, if your render texture will contain non-color data (normals, velocities, other custom values) then you don't want Linear↔sRGB conversions to happen. This is the Linear read-write mode. When this mode is set on a render texture, RenderTexture.sRGB will return false.

Note that some render texture formats are always considered to contain “linear” data and no sRGB conversions are ever performed on them, no matter what is the read-write setting. This is true for all “HDR” (floating point) formats, and other formats like Depth or Shadowmap.

See Also: Linear Color Space, RenderTexture.sRGB, PlayerSettings.colorSpace, GL.sRGBWrite.

一个RenderTexture色彩空间转换模式。

当使用伽玛颜色空间时,没有转换任何类型的转换,而此设置不使用。

当线性颜色空间的使用情况,然后通过默认非HDR渲染纹理被认为包含sRGB数据(即“常规颜色”),和片段着色器是输出线性颜色值。所以默认的片段着色器的颜色值转换为sRGB当渲染到纹理;当采样纹理着色器sRGB色彩转化为线性值。这是sRGB读写模式;和默认模式匹配时,使用线性颜色空间。当这个模式被设置在一个渲染纹理,RenderTexture.sRGB将返回true。

然而,如果你的渲染纹理将包含非颜色数据(法线,速度,其他自定义值)然后你不想线性< → sRGB转换发生。这是线性读写模式。当这个模式被设置在一个渲染纹理,RenderTexture.sRGB将返回false。

值得注意的是,一些渲染纹理格式一直被认为含有“线性”的数据并没有sRGB转换执行的,不管是读写设置。这是真正的所有“HDR”(浮点)格式,和其他格式如深度或阴影面积。

参见:Linear Color Space, RenderTexture.sRGB, PlayerSettings.colorSpace, GL.sRGBWrite.

Variables 变量

DefaultDefault color space conversion based on project settings.
基于项目设置的默认颜色空间转换。
LinearRender texture contains linear (non-color) data; don't perform color conversions on it.
渲染纹理包含线性(非彩色)数据;不要在它上执行颜色转换。
sRGBRender texture contains sRGB (color) data, perform Linear↔sRGB conversions on it.
渲染纹理包含sRGB(颜色)的数据,进行线性< → sRGB转换它。
script/unityengine/enumerations/rendertexturereadwrite/rendertexturereadwrite.txt · 最后更改: 2016/09/18 03:21 由 emjo