网站后台批量上传图片,wordpress采集生成用户插件,wordpress 小工具插件下载,商城网站网络公司1.正常贴图#xff1a;RGBA 4通道 每个通道取值范围 0-255 贴图里面取值是 0-1 2.法线贴图#xff1a;法线怎么存入正常贴图的过程
每个通道里面存储的是一个向量(x,y,z,w) 通常我们会对应xyzw为rgba 存储值的范围也是0-1向量的取值范围是 -1到1法线怎么存入正常贴图的过程RGBA 4通道 每个通道取值范围 0-255 贴图里面取值是 0-1 2.法线贴图法线怎么存入正常贴图的过程
每个通道里面存储的是一个向量(x,y,z,w) 通常我们会对应xyzw为rgba 存储值的范围也是0-1向量的取值范围是 -1到1法线怎么存入正常贴图的过程法线中的向量取值范围怎么变换为0-1 (-1,1) *0.5 0.5 (0,1)正常贴图变成法线的过程(0,1) -0.5 *2 (-1,1)
3.法线贴图为蓝色是因为法线经常是朝向Z轴的法线倾向 Z值 Z值映射到贴图里面对应的是RGBA中的B值所以呈现蓝色 4.法线贴图从哪里来
1.美术制作
2.U3D里设置 图片类型为 Normal Map
5.法线贴图的作用
1.增加明暗对比度让凸出的地方看起来更凸
法线计算 Shader Custom/NormalMap
{Properties{_Color (Color, Color) (1,1,1,1)_MainTex (Albedo (RGB), 2D) white {}_NorTex (NormalMap (RGB), 2D) white {}}SubShader{Tags { RenderTypeOpaque }LOD 200CGPROGRAM// Physically based Standard lighting model, and enable shadows on all light types#pragma surface surf Lambert// Use shader model 3.0 target, to get nicer looking lighting#pragma target 3.0sampler2D _MainTex;sampler2D _NorTex;struct Input{float2 uv_MainTex;float2 uv_NorTex;};fixed4 _Color;void surf (Input IN, inout SurfaceOutput o){// Albedo comes from a texture tinted by colorfixed4 c tex2D (_MainTex, IN.uv_MainTex) * _Color;o.Normal UnpackNormal(tex2D (_NorTex, IN.uv_MainTex));o.Albedo c.rgb;o.Alpha c.a;}ENDCG}FallBack Diffuse
}