Unity3D翻译——Shader Level of Detail

来源:互联网 发布:程序员用曲面显示器 编辑:程序博客网 时间:2024/06/07 05:57

Shader Level of Detail                  着色器的细节层次技术

原文地址:http://unity3d.com/support/documentation/Components/SL-ShaderLOD.html

如有翻译不当之处,还请帮忙指出!

 

Shader Level of Detail (LOD) works by only using shaders or subshaders that have their LOD value less than a given number.

着色器的细节层次效果只有在着色器或子着色器含有小于一定阈值的LOD值时才起作用。

By default, allowed LOD level is infinite, that is, all shaders that are supported by the user's hardware can be used. However, in some cases you might want to drop shader details, even if the hardware can support them. For example, some cheap graphics cards might support all the features, but are too slow to use them. So you may want to not use parallax normal mapping on them.

默认情况下,允许的 LOD级别可以是无限的。也就是说,可以使用硬件所支持的所有的着色器。然而,在某些情况下即使硬件可以支持它们,你可能也要放弃着色器的详细信息。例如,一些廉价的图形卡可能支持所有功能,但使用这些功能的速度太慢了。所以,你可能就不想在这些卡上使用视差法线映射了。

Shader LOD can be either set per individual shader (usingShader.maximumLOD), or globally for all shaders (using Shader.globalMaximumLOD).

着色器的细节层次既可以针对单个着色器进行设定(使用Shader.maximumLOD),也可以针对所有着色器进行全局设定(使用Shader.globalMaximumLOD)。

In your custom shaders, useLOD command to set up LOD value for any subshader.

在你的自定义着色器中,使用LOD命令来为每个子着色器来设定LOD值。

Built-in shaders in Unity have their LODs set up this way:

Unity中内建的着色器的LOD设置参数如下:

*      VertexLit kind of shaders = 100

*      Decal, Reflective VertexLit = 150

*      Diffuse = 200

*      Diffuse Detail, Reflective Bumped Unlit, Reflective Bumped VertexLit = 250

*      Bumped, Specular = 300

*      Bumped Specular = 400

*      Parallax = 500

*      Parallax Specular = 600