MeshLab法线贴图

10
在之前的(1.3.3)Meshlab版本中,当选择Render->shaders->normalmap时,常见的蓝紫色调的法线贴图会显示正确的法线贴图: enter image description here 在当前的(2016.12)版本中,只显示纹理覆盖,没有显示法线贴图: enter image description here enter image description here 如何在当前版本中显示法线色彩地图?
1个回答

3
尽管在Render -> Shaders菜单下有一个预定义的着色器“normalmap”可用,但它不会呈现您认为它应该呈现的模型(“熟悉的蓝紫色映射”)。
但是您可以修改这些着色器以实现您想要的效果。
  1. Take a back up of the following files. You can find them in C:\Program Files\VCG\MeshLab\shaders or wherever you have installed meshlab

    • normalmap.vert
    • normalmap.frag
  2. Edit the above files as follows. You can keep the comments.

    • normalmap.vert

      varying vec4 baseColor;
      void main(void)
      {
          gl_Position = ftransform();
          baseColor = vec4(gl_Normal, 1.0);
      }
      
    • normalmap.frag

      varying vec4 baseColor;
      void main(void)
      {
          gl_FragColor = baseColor;
      }
      
  3. From Render menu, select Render -> Shaders -> normalmap.gdp

  4. There you go! But remember this is a very simple shader to show normal map. If you want lighting and other effects you have to further edit the shaders.


Ubuntu 22.04:/usr/share/meshlab/shaders/ - Remy Mellet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接