Re: [osg-users] Selective ClipNode

2017-04-18 Thread Ale Maro
Thank you Sebastian,

I also found another way that is useful in my case.
I simply call the following code for each node I want to exclude from clipping:

node->getOrCreateStateSet()->setMode(GL_CLIP_PLANE0, osg::StateAttribute::OFF | 
osg::StateAttribute::PROTECTED);

Ale

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70786#70786





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Selective ClipNode

2017-04-18 Thread Sebastian Messerschmidt



Am 4/18/2017 um 2:17 PM schrieb Ale Maro:

Hi Sebastian,

I would like to avoid that becouse each node may have complex (dynamic) 
transformations so I should traverse the scene, calculate the global 
transformation for each node and update each transformation for the children of 
the sibling-group
Sorry I don't understand what you mean. If you simply put (at the top 
level) parts like this:


SCENE
|-CLIP
|-Childs
|-NON_CLIP  
|-Childs

the childs in this example can have arbitary transformations...
If you cannot place your nodes like this, you can take a look at the 
ClipNode-implementation and maybe inherit and change the parts that 
control the clipping state to set it effectively per child somehow.


The other option is to simply use a shader that implements the clipping 
and to switch it on/off via uniform.


Cheers
Sebastian




Ale

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70780#70780





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Selective ClipNode

2017-04-18 Thread Sebastian Messerschmidt

Hi Ale,


in my scene graph I have a root node of type osg::ClipNode.
In this way I can add easily clipping planes to my scene. This works fine.

Now I would like to exclude some nodes from clipping. I wonder if ClipNode 
supports something like a visitor mask to selectively apply clipping to 
children.
You can always put the nodes to be excluded from clipping into a 
sibling-group of the ClipNode.


Cheers
Sebastian


Thank you in advance.

Best regards
Ale

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70778#70778





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Selective ClipNode

2017-04-18 Thread Ale Maro
Hi,

in my scene graph I have a root node of type osg::ClipNode. 
In this way I can add easily clipping planes to my scene. This works fine.

Now I would like to exclude some nodes from clipping. I wonder if ClipNode 
supports something like a visitor mask to selectively apply clipping to 
children.

Thank you in advance.

Best regards
Ale

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70778#70778





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org