Re: [osg-users] cull traversal

2016-03-20 Thread Trajce Nikolov NICK
Heh :-) .. That is even simplier ..

Thanks Jannik!

Nick

On Sun, Mar 20, 2016 at 9:43 PM, Jannik Heller 
wrote:

> >  I did it in a simpler way by adding a node at the end of the scenegraph
> and set a cullcallback and it works
>
> Yes, that should work. You could also set a cull callback on the root
> node, and in the callback do this:
>
> traverse(node, nv); // cull scene root
>
> // end of cull traversal
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66569#66569
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


Re: [osg-users] cull traversal

2016-03-20 Thread Jannik Heller
>  I did it in a simpler way by adding a node at the end of the scenegraph and 
> set a cullcallback and it works 

Yes, that should work. You could also set a cull callback on the root node, and 
in the callback do this:

traverse(node, nv); // cull scene root

// end of cull traversal

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





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


Re: [osg-users] cull traversal

2016-03-20 Thread Trajce Nikolov NICK
Hi Robert,

> If you need a callback for the end of cull traversal then there isn't any
specific built in for this, you could subclass from osgViewer::Renderer and
implement your own wrapper for the cull traversal to do what you want.

I though of this. And it is the proper way I think. I did it in a simpler
way by adding a node at the end of the scenegraph and set a cullcallback
and it works

Thanks anyway :-)

Cheers,
Nick

On Sun, Mar 20, 2016 at 8:44 PM, Robert Osfield 
wrote:

> HI Nick,
>
> The osg::Stats object can record different times for various parts of the
> frame, a subset of these are displayed by the StatsHandler when you enable
> it.
>
> If you need a callback for the end of cull traversal then there isn't any
> specific built in for this, you could subclass from osgViewer::Renderer and
> implement your own wrapper for the cull traversal to do what you want.
>
> Robert.
>
> On 20 March 2016 at 17:04, Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com> wrote:
>
>> Just looked at the code .. So it is
>>
>> _viewer->renderingTraversals();
>>
>> calling
>>
>> renderer->cull();
>>
>> on the Cameras 
>>
>> Is there any way to know when this cull is completed?
>>
>> On Sun, Mar 20, 2016 at 12:52 PM, Trajce Nikolov NICK <
>> trajce.nikolov.n...@gmail.com> wrote:
>>
>>> Hi community,
>>>
>>> any clue when the cull traversal is being dispatched in this decomposed
>>> viewer frame calls?
>>>
>>> _viewer->advance();
>>> _viewer->eventTraversal();
>>> _viewer->updateTraversal();
>>> _viewer->renderingTraversals();
>>>
>>> Thanks a bunch as always!
>>>
>>> Nick
>>>
>>> --
>>> trajce nikolov nick
>>>
>>
>>
>>
>> --
>> trajce nikolov nick
>>
>> ___
>> 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
>
>


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


Re: [osg-users] cull traversal

2016-03-20 Thread Robert Osfield
HI Nick,

The osg::Stats object can record different times for various parts of the
frame, a subset of these are displayed by the StatsHandler when you enable
it.

If you need a callback for the end of cull traversal then there isn't any
specific built in for this, you could subclass from osgViewer::Renderer and
implement your own wrapper for the cull traversal to do what you want.

Robert.

On 20 March 2016 at 17:04, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Just looked at the code .. So it is
>
> _viewer->renderingTraversals();
>
> calling
>
> renderer->cull();
>
> on the Cameras 
>
> Is there any way to know when this cull is completed?
>
> On Sun, Mar 20, 2016 at 12:52 PM, Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com> wrote:
>
>> Hi community,
>>
>> any clue when the cull traversal is being dispatched in this decomposed
>> viewer frame calls?
>>
>> _viewer->advance();
>> _viewer->eventTraversal();
>> _viewer->updateTraversal();
>> _viewer->renderingTraversals();
>>
>> Thanks a bunch as always!
>>
>> Nick
>>
>> --
>> trajce nikolov nick
>>
>
>
>
> --
> trajce nikolov nick
>
> ___
> 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] cull traversal

2016-03-20 Thread Trajce Nikolov NICK
Just looked at the code .. So it is

_viewer->renderingTraversals();

calling

renderer->cull();

on the Cameras 

Is there any way to know when this cull is completed?

On Sun, Mar 20, 2016 at 12:52 PM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi community,
>
> any clue when the cull traversal is being dispatched in this decomposed
> viewer frame calls?
>
> _viewer->advance();
> _viewer->eventTraversal();
> _viewer->updateTraversal();
> _viewer->renderingTraversals();
>
> Thanks a bunch as always!
>
> Nick
>
> --
> trajce nikolov nick
>



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


[osg-users] cull traversal

2016-03-20 Thread Trajce Nikolov NICK
Hi community,

any clue when the cull traversal is being dispatched in this decomposed
viewer frame calls?

_viewer->advance();
_viewer->eventTraversal();
_viewer->updateTraversal();
_viewer->renderingTraversals();

Thanks a bunch as always!

Nick

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


[osg-users] Correct way to set auto scale with osg::AutoTransform

2016-03-20 Thread Victoria Rudakova
Dear OSG community,

I am trying to set auto scale property of osg::AutoTransform variable. I
would like to achieve such an effect that whatever the viewing camera
position and its distance from a certain geometry, the geometry's size
would not change.

As an example geometry, I have this pyramid:

[image: Inline image 1]

I found an example "osgautotransform"
http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgautotransform/osgautotransform.cpp

that seem to have an element of what I need. I tried to use the same
commands, for example:

*osg*::AutoTransform* at = *new* osg::AutoTransform;
at->addChild(geode); // geode constains my pyramid geometry and color
at->setAutoScaleToScreen(true);
at->setMinimumScale(1); // some test values
at->setMaximumScale(2);

// to render the scene:
root->addChild(at); // root is osg::Group
viewer->setSceneData(root);

However, it did not produce any changes in how the scene is rendered when I
change the camera view (i.e., the pyramid becomes smaller when camera zooms
out and bigger when zooms in). I tried the command that sets up auto rotate
mode and it works to fix the rotation. So how come I cannot control the
scale?

Could anyone point out what am I doing wrong or what is missing here? Thank
you!

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


[osg-users] shadow mapping for point lights with shadow cube maps?

2016-03-20 Thread Christian Buchner
Hi,

I wonder if anyone here would be able to share some OSG based sample code
demonstrating shadow cube maps for point light sources.

While the osgShadow::ShadowMap class will currently detect point lights and
use a perspective frustum for rendering the shadow map, I believe this does
not currently cast shadows in all directions

Rendering into all 6 faces of a cube map seems quite costly, so I wonder if
there are more efficient ways to do shadow casting in all directions,
say... rendering into two halves of a spherical map for example. Or going
completely crazy... a tetrahedral shadow map requiring 4 projections
instead of 6 for a cube map,

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