Unity3D Shaderlab 学习记录

unity3d 定制的表面着色器(Surface Shader)的标准输出结构是这种:

struct SurfaceOutput 

half3 Albedo; //反射率 

half3 Normal; //法线 

half3 Emission; //自发光,用于增强物体自身的亮度,使之看起来好像能够自己发光 

half Specular; //镜面 

half Gloss; //光泽 

half Alpha; //透明 

};

 

Surface Shader compile directives 表面着色器编译指令


Surface shader is placed inside CGPROGRAM..ENDCG block, just like any other shader. The differences are:


表面着色器放在CGPROGRAM .. ENDCG块里面。就像其它的着色器一样。差别是:


It must be placed inside SubShader block, not inside Pass. Surface shader will compile into multiple passes itself.

它必须嵌在子着色器(SubShader)块里面。

而不是Pass块里面。

表面着色器( Surface shader)将在多重通道(multiple passes)内编译自己。

相关文章

前言 本文记录unity3D开发环境的搭建 unity安装 unity有中文...
前言 有时候我们希望公告牌跟随镜头旋转永远平行面向屏幕,同...
前言 经过一段时间的学习与实际开发,unity3D也勉强算是强行...
前言 在unity中我们常用的获取鼠标点击的方法有: 1、在3D场...
前言 在之前的例子中,我们都没有用到unity的精髓,例如地形...
这篇文章将为大家详细讲解有关Unity3D中如何通过Animator动画...