Browse Source

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

Taras Podoroga 12 years ago
parent
commit
b0974e6647
1 changed files with 7 additions and 0 deletions
  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 )
    {