Back to Front ordering at transparent render pass

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
PitOnVMK
Posts: 6
Joined: Sat Jul 29, 2006 2:04 pm

Back to Front ordering at transparent render pass

Post by PitOnVMK »

Hellow all!

I work with irrlicht for several years... I like it very much!

But now I have a problem with back to front ordering of trianles at transparent render pass. :oops: :(

Unfortunatly, irrlicht dosent support semitransparent rendering correctly :(

As I found, irrlicht not sorts triangles at back to front (by distance from the camera) order.

Have someone know how to solve this problem?
thanks:)
[/img]
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The scene manager sorts transparent scene nodes in back to front order. Have a look at the declaration of TransparentNodeEntry in CSceneManager.h. The comparison function puts nodes further from the camera first in the sorted render queue.

Travis
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Is this what you are having problems with:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=68929 ?
PitOnVMK
Posts: 6
Joined: Sat Jul 29, 2006 2:04 pm

Post by PitOnVMK »

vitek wrote:The scene manager sorts transparent scene nodes in back to front order. Have a look at the declaration of TransparentNodeEntry in CSceneManager.h. The comparison function puts nodes further from the camera first in the sorted render queue.

Travis
Thanks, but problem not in the sorting of the transparent nodeS but in sorting of triangles what belongs to ONE transparent node.

I am using ONE COctTreeSceneNode for scene representation, so sorting algorithm dosent works here as we have only one scenenode.

Octree rendering irrlicht code:

Code: Select all

LightMapOctTree->calculatePolys(frust);

OctTree<video::S3DVertex2TCoords>::SIndexData* d =  LightMapOctTree->getIndexData();

for (u32 i=0; i<Materials.size(); ++i)
{
  video::IMaterialRenderer* rnd = 
   driver->getMaterialRenderer(Materials[i].MaterialType);
  bool transparent = (rnd && rnd->isTransparent());

  // only render transparent buffer if this is the transparent render pass
  // and solid only in solid pass
  if (transparent == isTransparentPass) 
  {
     driver->setMaterial(Materials[i]);
     driver->drawIndexedTriangleList(
      &LightMapMeshes[i].Vertices[0],                                 LightMapMeshes[i].Vertices.size(),
d[i].Indices, d[i].CurrentSize / 3);
  }
}
As you can see irrlicht dosent supports triangle sorting.
:cry:
PitOnVMK
Posts: 6
Joined: Sat Jul 29, 2006 2:04 pm

Post by PitOnVMK »

Warchief wrote:Is this what you are having problems with:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=68929 ?
thanx, useful topic. I have allready create my own TransparentNode Structure.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, do you have a screenshot? Maybe it would also be good to have a small mesh to experiment with.
PitOnVMK
Posts: 6
Joined: Sat Jul 29, 2006 2:04 pm

Post by PitOnVMK »

hybrid wrote:Ok, do you have a screenshot? Maybe it would also be good to have a small mesh to experiment with.
Yes, I have... :oops: but I dont know how (where) to download it (
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Use this service for posting screenshots:
http://img132.imageshack.us/
Post Reply