Hi all,

I am trying to do metaballs with shaders:

- SimpleStage - Geometry (point cloud)
- Geometry (fullscreen quad)

I setup my stage as in the fbo example with the flag
Then I add a geometry with my points (SPH simulation)
I then set the result from the stage as texture of a quad which spans the
whole screen
My problem now is that the result is allwas on top of everything.
I tried to pass FragCoord.z through the texture but I need to use alpha
blending for my points,
wich screws up the Fragcoord.

Is there another way to pass the depth information from the stage rendering?
I tried:

        dfboImg = Image::create();
        dfboImg->set(Image::OSG_L_PF, 512, 512);
        dfboTex = TextureObjChunk::create();
        dfboTex->setImage(dfboImg);
        TextureBufferRefPtr depthBuf = TextureBuffer::create();
        depthBuf->setTexture(dfboTex);
        fbo->setDepthAttachment(depthBuf);

but this is not valid.

I will try to use two stages and a visitor to render once the fragcoord to
texture and once the stuff i need for the metaballs. But this seams very
wrong :)

Maybe I am going a totally wrong way.. any Ideas how to do this better?
I want to avoid to extend OpenSG itself (writing my own stage), as I have
cluster environments.

best regards,
Victor
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to