normal map compression & tangent to world space conversion

来源:互联网 发布:李涛淘宝 编辑:程序博客网 时间:2024/06/06 23:37

DXT5


http://tech-artists.org/wiki/DirectDraw_Surface


http://tech-artists.org/wiki/Normal_map_compression


Unity stores its normal maps as DXT5nm, where only the G and A channels are used (because they have more bits available).


https://forum.unity3d.com/threads/unpacknormal-fixed4-packednormal-role.101163/


https://forum.unity3d.com/threads/normal-maps-and-importing-them-correctly.82652/#post-629189


http://polycount.com/discussion/81154/understanding-averaged-normals-and-ray-projection-who-put-waviness-in-my-normal-map


https://en.wikibooks.org/wiki/GLSL_Programming/Unity/Lighting_of_Bumpy_Surfaces#Normal_Mapping_in_Unity


https://forum.unity3d.com/threads/unpack-tangent-space-normal-texture.386476/


normal map is in tangent space

convert normal map from tangent space to world space:

Such a matrix is called a TBN matrix where the letters depict a tangentbitangent and normal vector. These are the vectors we need to construct this matrix.


https://learnopengl.com/#!Advanced-Lighting/Normal-Mapping


tangent is the tangent to the normal

and the bitangent is the cross product


if n is object-space normal, the result of TBN * tangent-space normal is object space

if n is world-space normal, the result of TBN * tangent-space normal is world space


https://www.youtube.com/watch?v=Fi2N_ClXHco&list=PL09X4HXJpa8kfw8cZjyYZel8WlOT5B1_k&index=29









0 0
原创粉丝点击