Hello Michael,

On 11/15/2010 08:35 AM, Michael Raab wrote:
> I'm interested in doing scene selection using id buffer information as we 
> have very large scenes. I had a look at the appropriate OpenSG1.8 tutorial. 
> Adding a switch material to each materialgroup isn't solution for us.

why?

> Do you have an idea about alternative implementation strategies, e.g. 
> assigning some attachments and derive render action?

you can change the callback called by the RenderAction for Geometry on a 
per RenderAction instance basis. So you could create two RenderAction 
objects and for one you use registerEnter()/registerLeave() to change 
the Geometry callback to something that does the id-buffer rendering 
instead of using the normal material.
More specifically: Geometry registers 
MaterialDrawable::renderActionEnterHandler as its default handler, 
create a function

OSG::Action::ResultE
idBufferRenderEnter(OSG::CNodePtr &node, OSG::Action *action)
{
    // basically the same as MaterialDrawable::renderActionHandler,
    // but don't use the MaterialDrawable's material,
    // instead get the id buffer material from some attachment, or so
}

and register it with a RenderAction instance, similar for the leave handler.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to