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

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览

应支付9.90元
点击重新获取
扫码支付

支付成功即可阅读