• 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

  • 相关阅读:
    关于json操作,这里再为大家推荐几款比较实用的json在线工具
    JS操作JSON总结
    HTML WebSocket
    HTML应用程序缓存
    前段也能学习网址
    简述jpg。Gif。png-8.png-24的区别,分别使用场景
    HTML相关问题
    html5移动端知识点总结
    html5本地存储(localStorage)使用介绍
    node环境变量----新全局包管理配置
  • 原文地址:https://www.cnblogs.com/gamesacer/p/1080996.html
Copyright © 2020-2023  润新知