纳金网

标题: 内置着色器指南之标准着色器家族:法线贴图漫反射着色器 [打印本页]

作者: .    时间: 2013-2-20 17:10
标题: 内置着色器指南之标准着色器家族:法线贴图漫反射着色器
Normal Mapped Properties 法线贴图属性Like a Diffuse shader, this computes a simple (Lambertian) lighting model. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on the this angle, and does not change as the camera moves or rotates around.同Diffuse Shader 类似,基于Lambertian 的简单光照模型。光照随着和物体表面夹角的减小而减小。光照只受入射夹角影响,不会随着摄像机的移动和旋转而改变。Normal mapping simulates small surface details using a texture, instead of spending more polygons to actually carve out details. It does not actually change the shape of the object, but uses a special texture called a Normal Map to achieve this effect. In the normal map, each pixel's color value represents the angle of the surface normal. Then by using this value instead of the one from geometry, lighting is computed. The normal map effectively overrides the mesh's geometry when calculating lighting of the object.使用Normal mapping贴图来表现物体表面细节,而不是通过增加多边形细分表现细节。它实际上没有改变物体的形状,而是采用了一种叫做Normal Map的特殊贴图实现这一效果。在法线贴图中,每个像素颜色代表该像素在物体表面的法线角度。然后通过这个法线来计算几何学及光照。当计算物体高光时Normal Map有效地优化了物体模型网格。
Creating Normal maps 创建法线贴图You can import a regular grayscale image and convert it to a Normal Map from within Unity. To learn how to do this, please read the Normal map FAQ page.Unity可以把导入的一张普通的灰度图转换为法线贴图。学习更多如何制作法线贴图。
Technical Details 技术细节The Normal Map is a tangent space type of normal map. Tangent space is the space that "follows the surface" of the model geometry. In this space, Z always points away from the surface. Tangent space Normal Maps are a bit more expensive than the other "object space" type Normal Maps, but have some advantages:此处的Normal Map 是一种正切空间的Normal Map类型。正切空间是一个跟随物体模型表面的空间。在这个空间中,Z轴始终从表面指向外面。Tangent space 相对于另一种 Object space空间类型复杂一些,但是它有一些优势。    It's possible to use them on deforming models - the bumps will remain on the deforming surface and will just work.
    比较适合应用于奇形怪状的物体,恰好表现物体表面凹凸不平效果。
    It's possible to reuse parts of the normal map on different areas of a model; or use them on different models.
    比较适合应用于物体模型的不同区域,或者应用在不同的模型间。 Diffuse Properties 漫反射属性Diffuse computes a simple (Lambertian) lighting model. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on the this angle, and does not change as the camera moves or rotates around.Diffuse 计算一个简单的(Lambertian)光照模型,光照强度随着物体表面和光入射角之间夹角的角度减小而减小。光照强度仅依赖于此角度,摄像机的移动和旋转无法改变光照强度。
Performance 性能Generally, this shader is cheap to render. For more details, please view the Shader Peformance page.一般情况下这个Shader耗费渲染资源比较小,更多详细资料请查看Shader Peformance页面。 【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/




欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5