built-in SpecularType of Unity

built-in SpecularType of Unity

1、声明变量。

  built-in SpecularType of Unity

  built-in SpecularType of Unity

  注意并没有在Shader中声明_SpecColor,因为Lighting.cginc中已经帮我们声明。

2、声明使用BlinnPhong光照模型。

  built-in SpecularType of Unity

3、最后将_SpecPower和Gloss给赋值。

  built-in SpecularType of Unity

  SpecPower是指光泽度,小的值带来平滑的光斑,大的值带来小而亮的光斑。Gloss是亮度(光强),值越大,光斑越亮。

4、镜面反射效果如下。

  built-in SpecularType of Unity

你可能感兴趣的:(unity)