Hi OpenSG-Users,

I got some problems with rendering in OpenSG.
So far I was using the SimpleSceneManager for rendering in OpenSG, so
I have currently not really an idea on how to do this in OpenSG.
I read through some code examples, but I can't distinguish the
necessary steps and the intention of all the steps done to render more
or less "by hand".

What I'm up to is to render a Scene slice by slice into a
Stencilbuffer and save this Buffer-values.
I have to render the scene at least 2 times for every slice, one time
with frontface-culling, second time with backface-culling.
After this two rendering passes I need the value of the stencil buffer.

I got the testStage example running and wanted to modify the file for my needs.

Now I can't really see, where I have to or better where I could modify
the parameters for the rendering.

Here is some OpenGL code, doing what I want to do in OpenSG.

        // first rendering
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | 
GL_STENCIL_BUFFER_BIT);
        glClearStencil(0x0);

        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();

        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
        glDepthMask(GL_FALSE);
        glEnable(GL_STENCIL_TEST);
        glEnable(GL_CULL_FACE);

        glCullFace(GL_FRONT);
        glStencilFunc(GL_ALWAYS,0,0xff);
        glStencilOp(GL_KEEP, GL_INCR, GL_INCR);

        drawGeometry();

        //second rendering
        glCullFace(GL_BACK);
        glStencilOp(GL_KEEP, GL_DECR, GL_DECR);
        glStencilFunc(GL_ALWAYS,0,0xff);

        drawGeometry();

Where can I clear the Buffer-bits and the Buffers themselves?
Where can I set the Stencil-Function-Parameters or the Stencil-Operations?

I hope these aren't to many question, but I'm somehow lost in the
OpenSG-Documentation.

kind regards and thanks for your help,
Constantin

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to