浏览代码

RenderMeshExample won't render transparent materials properly, this commit will fix it.

Taras Podoroga 12 年之前
父节点
当前提交
b0974e6647
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Engine/source/T3D/examples/renderMeshExample.cpp

+ 7 - 0
Engine/source/T3D/examples/renderMeshExample.cpp

@@ -284,6 +284,13 @@ void RenderMeshExample::prepRenderImage( SceneRenderState *state )
    // Set our RenderInst as a standard mesh render
    ri->type = RenderPassManager::RIT_Mesh;
 
+   //If our material has transparency set on this will redirect it to proper render bin
+   if ( matInst->getMaterial()->isTranslucent() )
+   {
+      ri->type = RenderPassManager::RIT_Translucent;
+      ri->translucentSort = true;
+   }
+
    // Calculate our sorting point
    if ( state )
    {