法线贴图

Since the tangent-space normal map is calculated as an offset of the surface
normal, it remains largely uniform in color (depicted in the image as gray)(由于切线空间计算的是表面法线的偏移量,所以它保留的是一些比较均匀的颜色(在图中用灰色表示)),
where
the object-space normal map uses the entire range of colors (from white to black in
this example).(对象空间法线贴图用的是全部范围的颜色(从白到黑)),PS:出现这种原因是因为这些法线是在坐标系中绝对的,而不是相对存在的,相对的比较缓和,而绝对的必然有大量的尖锐的波。
Figure 12.3 shows a real comparison of the appearances of a normal
map encoded in object space and a normal map encoded in tangent space.

 

So what are the differences, you may ask, between these two ways of encoding
normal maps, except the fact that they look different? Well, actually the differences
are quite significant. Object-space normal maps have the world transformation
baked in to the normal map, which means that the pixel shader, in some cases, can
skip a few matrix transformations.(对象空间贴图中,包含了世界坐标转换信息,意味着可以跳过一些转换)

 An example of when it can be a good idea to use object-space normal maps is when you generate the normal maps yourself on-the-fly
for static geometry(当你为静态几何体即时生成法线贴图的情况).
Then, you might as well bake in the final transformation of
the normal in the texture since you know this won’t change(然后,因为你知道法线不会改变你也可能计算最终变换后的纹理发现).
The major disadvantage
of object-space normal maps is that they are tied to the geometry, which means you
can’t reuse the normal map over tiled surfaces.(主要的缺点是,对象空间法线贴图要拘于几何对象,不能对其进行复用,其实这里指的是,假如相同物体,旋转之后就不能用此贴图了,因为法线也改变了,而我们的贴图法线还是那样没有变,使得计算光照失败) Imagine, for example, that you have
a brick wall with a tiled diffuse texture. You wouldn’t be able to tile this object-space
normal map over the wall without getting lighting artifacts. Luckily, tangent-space
normal maps don’t have this restriction, because with tangent-space normal maps,
the final normal is calculated on-the-fly (instead of at the normal map creation time
as is the case with object-space normal maps)(所幸,切线空间法线贴图没有这个限制,因为最终的法线还是要即时重新计算的(取代对象空间法线贴图在创建时计算法线)).
So with characters that will both
move around in the world and deform (due to skinning or morphing), it becomes
clear that tangent-space normal maps are the way to go.(对于我们的对象,要在世界中来回行走以及扭曲等(主要是骨骼动画以及渐变),一些变的清晰,切线空间贴图是我们要走的路)
So for the rest of this
chapter I will focus only on tangent-space normal maps and from here on just
refer to them as normal maps.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值