zoukankan      html  css  js  c++  java
  • TGE学习笔记03 透明纹理

    今天被透明纹理烦恼了一下,使用了透明纹理的物体渲染顺序总是固定的,不管怎么修改都没用,明明是插件导出的设置问题,可是里里外外翻了N多遍,都没发现插件的相关设置。
    最后,又回到上一篇我们提到的那篇教程才找到答案。其实就一句话,使用透明纹理的物体需要加前缀SORT::,强制导出插件对顶点重新排序,以按照正确的顺序渲染。

    Simple Shape with Double Sided Materials and Translucency

    1. Open the file SimpleShape4.max and load the associated texture SimpleTexture4.png in the material editor. These files are located in the documentation file pack. The texture map is shown in Figure 7.

      

										Figure 7

      Figure 7

    2. You will see that the material applied to the shape is a translucent .png. In the material editor, check the "2-sided" option.

      Note

      Making this material double sided is important because you will be seeing the inside of the object through the translucent sections of the texture map. On most objects, double sided textures are a bad idea because they will double the number of surfaces rendered, yet never be visible to the user.

    3. In the DTS Exporter settings in the utility panel, make sure 'Enable 2-sided materials' is checked in the Parameters rollout. This tells the exporter to expect double sided textures. If this is not checked, the exporter will ignore the double sided texture and export it as normal.

    Export the shape. Checking Translucency in the ShowTool. You will see something resembling Figure 8.

    

								Figure 8

    Figure 8

    You will note, that the shape is all screwed up. Things are not drawing in the correct order. Some of the polygons are drawing in front of other polygons. This is due to the way translucent shapes are drawn in the engine. More details on why this happens is covered in Appendix ????. In order for translucent shapes to draw correctly they must be forced to sort in the correct order. The next section will discuss how this is done.

    Simple Shape with Translucency and Sorting

    Warning

    It is important that transparency sorting only be used on simple shapes. SORT:: subdivides the polygons of the shape in order to correctly display their transparency, but the complexity of the shape created increases geometrically with the number of polygons sorted. The technical details of transparency sorting are covered in detail in Appendix ????.

    Procedure 8.10. Setting up the SORT:: function

    • Select the SimpleShape and prepend the name of the object with "SORT::". It should now be named "SORT::SimpleBox2" This will tell the exporter that this object may have trouble sorting and it will take extra steps to ensure it sorts correctly.

    Re-export the shape and open it in the ShowTool. It now sorts correctly, as shown in figure 9. The exporter has split some of the faces so that it the rendering engine can tell which faces are in front more easily. This increases the polygon count of the shape (you can check this in the detail level window in the showtool).

    

								Figure 9

    Figure 9

  • 相关阅读:
    Jenkins+Docker+Git+Harbor流水线打包
    docker镜像批量打包
    二进制安装docker-18.06.3-ce
    kubeadm添加新master或node
    Host is not allowed to connect to this MySQL server
    RecyclerFullyManagerDemo【ScrollView里嵌套Recycleview的自适应高度功能】
    RecyclerSwipeAdapterDemo【使用AndroidSwipeLayout用于列表项侧滑功能】
    RecyclerViewItemTouchHelperDemo【使用ItemTouchHelper进行拖拽排序功能】
    Android APP应用启动页白屏(StartingWindow)优化
    KeyboardUtil【软键盘弹出后输入框上移一定的高度】
  • 原文地址:https://www.cnblogs.com/gamesacer/p/1080996.html
Copyright © 2011-2022 走看看