Unity shader中的法线详解

         一次写shader的时候,根据法线调整视觉效果,却发现坐标不同的情况下,会有颜色突变的情况。不解。故寻找计算法线部分的知识。

首先看一下大神文章了解下大概:http://blog.csdn.net/candycat1992/article/details/41605257


  1.

 
  
  1. _Object2World
is the transformation from object coordinates to world coordinates.
 
  
  1. _World2Object * unity_Scale.w
is the transformation from world coordinates to object coordinates.

Unity sometimes (for non-uniform scale factors) scales the vertex coordinates before handing them to the shader. (Supposedly such that _Object2World is an orthogonal matrix.) For uniform scale factors, however, it doesn't do this vertex scaling but integrates the scaling in

你可能感兴趣的:(u3d)