Carsten Neumann wrote:
> > (i) PNG RGBA texture
> > http://mauroport.netsons.org/magazzino/temp/alpha_texture.png
> 
> this one shows the limitation of sorting only objects not triangles. The
> bottom face of the cube is rendered after the front and left faces and
> with setTransZWrite(false) (the default) the bottom overdraws the front
> and left faces. For cases like this you probably want to enable depth
> writes and/or experiment with alpha testing (see
> BlendChunk::setAlphaFunc and BlendChunk::setAlphaValue). You could split
> the cube into more than one geometry, but for any scene of interesting
> size this is not really feasible for performance reasons.
> The real solution to rendering transparent objects correctly is to apply
> some for or another of depth peeling.
>
> > (ii) Diffuse color with alpha=1.0
> > http://mauroport.netsons.org/magazzino/temp/color.png
> 
> hm, here I'm not so sure what the problem is. It looks as if the cube is
> missing the face that is oriented towards the bottom left. Is this done
> with lighting enabled? Are the normals on the cube correct? I'm not sure
> why the face oriented towards the bottom right is black - I'd suspect it
> is a back face that is not lit?

I had forgot to add a DepthChunk, in 1.8 wasn't necessary. My fault.

Now I have this code:

ract = OSG::RenderAction::create();
ract->setZWriteTrans(true);
sceneManager->setAction(ract);
// [...]
chunkMaterial->addChunk(depthChunk);
// [...]
blendChunk->setSrcFactor(GL_SRC_ALPHA);
blendChunk->setAlphaFunc(GL_GREATER); // <-- Thank you for this! Works fine
blendChunk->setAlphaValue(0.1f);
blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
chunkMaterial->addChunk(blendChunk);

Both (i) and (ii) work like a charm. New screenshots:
http://mauroport.netsons.org/magazzino/temp/alpha_texture2.png
http://mauroport.netsons.org/magazzino/temp/color2.png

Thank you,

-- 
Mauro

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to