EMT_TRANSPARENT_ALPHA_CHANNEL problem

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
burivuh
Posts: 30
Joined: Tue Nov 22, 2005 1:22 pm

EMT_TRANSPARENT_ALPHA_CHANNEL problem

Post by burivuh »

OpenGL, Win32, irrlicht 0.14 + irrSpintz 0.12

In a scene I have lots of objects of EMT_TRANSPARENT_ALPHA_CHANNEL material type : animated meshes and particle systems (all particle system classes are updated from irrSpintz project)
MaterialParam is always set to 0.1.

All animated mesh scene nodes are drawn without any problems.

When drawing particles blending fails or some particles dissappear and then appear again (life time is great and speed is low so I can notice this).
I can see all solid meshes through them, but I can't see some particles through other particles. Heh, I also can see particles and solid meshes (through particles) through transparent animated meshes.

Any ideas?

P.s. Sometimes some particles are blended well or it may be illusion.
P.p.s. There is only one object that is also drawn with blending - stencil shadow.
ElementoY
Posts: 15
Joined: Sun Feb 05, 2006 3:40 am
Location: Brazil
Contact:

Re: EMT_TRANSPARENT_ALPHA_CHANNEL problem

Post by ElementoY »

burivuh wrote: When drawing particles blending fails or some particles dissappear and then appear again (life time is great and speed is low so I can notice this).
I can see all solid meshes through them, but I can't see some particles through other particles. Heh, I also can see particles and solid meshes (through particles) through transparent animated meshes.

Any ideas?
It might be because the particles in the scene node that are in front are being rendered first, and as they are textured quads they go through the z-buffer, being tested and written to it as if they were nontransparent polygons, occluding the others that are coming after. If this is what's happening, you should see some of the particles cut by the squares of the others in front. Which material type are you using in the particles?
EDIT: Can you post a pic of what's happening? The docs say transparent materials, which I suppose you're using, don't get through the z-buffer or get culled.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

i have this problem with my cloud node. if I z-sort them before making the mesh buffer the problem goes away, but z-sorting the particle array is pretty cpu intensive. sorting a list of pointers to them works a lot faster, but I still have to find out which particles are closest each loop. if anyone works out a better solution I'm all ears!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
burivuh
Posts: 30
Joined: Tue Nov 22, 2005 1:22 pm

Post by burivuh »

2 ElementoY: only two types are used in the scene: EMT_SOLID and EMT_TRANSPARENT_ALPHA_CHANNEL with MaterialParam setted to 0.1

Thanks to all.
I'm idiot because I don't do z-sorting for particles.
burivuh
Posts: 30
Joined: Tue Nov 22, 2005 1:22 pm

Re: EMT_TRANSPARENT_ALPHA_CHANNEL problem

Post by burivuh »

Great! Thank you! Main problem was in z-buffer, that cuts some transparent points.
Post Reply