Shader Lod (Level of Detail)
1. 在Shader 有SubShader : 这里面可以设置LOD ,但凡小于L0D后面的值的SubShader都可以被执行。这个LOD参数可以设置 对应的脚本:
using UnityEngine;
using System.Collections;
public class LodTest : MonoBehaviour {
void Start () {
SetShaderLod(300);
}
public void SetShaderLod(int num)
{
Shader.globalMaximumLOD = num;
}
void Update () {
}
}
针对一些设备支持很多功能,但是却执行效率不是很高。可以用LOD设置配合。
官方给的一些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