Hi,

I have a problem with a geometry, transparent textures and blending.

I am using only one geometry which holds many quads (for particles). On these quads, I have mapped a texture which displays an arrow and the rest of the texture is transparent. But now I have the problem, that the depth ordering is wrong (it is correct, when I use a not-transparent texture instead). Some of the quads in the back seem to be in the foreground. All Quads have the same size.

Here is a screenshot of my problem.

http://wwwcs.uni-paderborn.de/cs/ag-domik/kuddel/screeny.png


And this is my code for the chunks I use:

// texture chunk
TextureChunkPtr texChunk = TextureChunk::create();
beginEditCP(texChunk, TextureChunk::ImageFieldMask | TextureChunk::EnvModeFieldMask); {
    texChunk->setImage(texImage);
    texChunk->setEnvMode(GL_MODULATE);
} endEditCP(texChunk, TextureChunk::ImageFieldMask | TextureChunk::EnvModeFieldMask);

// blend chunk
BlendChunkPtr blendChunk = BlendChunk::create();
beginEditCP(blendChunk, BlendChunk::SrcFactorFieldMask | BlendChunk::DestFactorFieldMask); {
    blendChunk->setSrcFactor(GL_SRC_ALPHA);
    blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
} endEditCP(blendChunk, BlendChunk::SrcFactorFieldMask | BlendChunk::DestFactorFieldMask);

// material
_material = ChunkMaterial::create();
beginEditCP (_material, ChunkMaterial::ChunksFieldMask); {
    _material->addChunk(blendChunk);
    _material->addChunk(texChunk);
} endEditCP (_material, ChunkMaterial::ChunksFieldMask);


Has anyone an idea?

Thanks, Oliver
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to