OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Plugin Logo bug


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12279

PostPosted: Mon Jul 13, 2009 4:34 pm    Post subject:
Plugin Logo bug
Reply with quote

Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo. The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days. In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre Amalric<> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin
logo.

When using more than one view logosCullCallback function is called without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12279

PostPosted: Tue Jul 14, 2009 12:24 pm    Post subject:
Plugin Logo bug
Reply with quote

Hi Alexandre,

I've decided to merged your change rather than look for a more complex
and more general solution, a more general solution can come later.
I've tweaked your changes a little to include returning of true when
the logo is traversed on a window it's not assigned to so the logo
will get culled.

Could you try svn/trunk and let me know how you get on.

Cheers,
Robert

On Mon, Jul 13, 2009 at 5:34 PM, Robert Osfield<> wrote:
Quote:
Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo.  The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days.  In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre Amalric<> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin
logo.

When using more than one view logosCullCallback function is called without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Alexandre Amalric
Guest





PostPosted: Wed Jul 15, 2009 10:07 am    Post subject:
Plugin Logo bug
Reply with quote

Hi Robert,
 
Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

 
Yes it is.
 
Could you try svn/trunk and let me know how you get on.
 
I Tried this morning latest SVN and it's working great with this simple solution.

 
Kind regards,



2009/7/14 Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi Alexandre,

I've decided to merged your change rather than look for a more complex
and more general solution, a more general solution can come later.
I've tweaked your changes a little to include returning of true when
the logo is traversed on a window it's not assigned to so the logo
will get culled.

Could you try svn/trunk and let me know how you get on.

Cheers,
Robert


On Mon, Jul 13, 2009 at 5:34 PM, Robert Osfield< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo.  The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days.  In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre Amalric< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin
logo.

When using more than one view logosCullCallback function is called without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

------------------
Post generated by Mail2Forum
Back to top
Alexandre Amalric
Guest





PostPosted: Tue Jul 21, 2009 9:35 am    Post subject:
Plugin Logo bug
Reply with quote

 
Hi Robert,
 
I found an other bug with the logo plugin when using shadows (PSSM + OSG latest svn). When shadows are used there is 2 calls from :
 

virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable, osg::State*) const
1 time with the default visitor and 1 time with the visitor from the shadow implementation wich has a specific traversal mask and a specific viewport (in my case 4096*4096) so the logo viewport is updated twice because of the code :  

if( vp->width() != logos->getViewport()->width() ||
vp->height() != logos->getViewport()->height() )
{
logos->getViewport()->setViewport( vp->x(), vp->y(), vp->width(), vp->height() );
logos->dirtyDisplayList();
}
}
Maybe we could check the _traversalMask from the visitor before updating the logo viewport, what do you think about ?
I know you're not a great fan from this plugin, but I find it very usefull.
 
Kind regards,


2009/7/15 Alexandre Amalric < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Hi Robert,
 
Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

 

Yes it is.
 
Could you try svn/trunk and let me know how you get on.
 

I Tried this morning latest SVN and it's working great with this simple solution.

 
Kind regards,



2009/7/14 Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Quote:
Hi Alexandre,

I've decided to merged your change rather than look for a more complex
and more general solution, a more general solution can come later.
I've tweaked your changes a little to include returning of true when
the logo is traversed on a window it's not assigned to so the logo
will get culled.

Could you try svn/trunk and let me know how you get on.

Cheers,
Robert


On Mon, Jul 13, 2009 at 5:34 PM, Robert Osfield< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo.  The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days.  In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre Amalric< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin
logo.

When using more than one view logosCullCallback function is called without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org








--

Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr






--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

------------------
Post generated by Mail2Forum
Back to top
Alexandre Amalric
Guest





PostPosted: Tue Jul 21, 2009 9:49 am    Post subject:
Plugin Logo bug
Reply with quote

 
There's something I forgot to mention :
 
The fix we agreed isn't working when there is more than one view with different viewport size but sharing the same graphic context.
 
The context ID is equal but the viewport size is different for the 2 views, so the logo is updated twice.
 

I explain my case, I'm using a composite viewer with "X" views sharing all the same graphic context (saving memory) but with different sizes. And I will use the logo plugin with this kind of configuration.
 
 
Unfortunately I don't have an ideal solution for now.
 
Kind regards,


2009/7/21 Alexandre Amalric < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
 
Hi Robert,
 
I found an other bug with the logo plugin when using shadows (PSSM + OSG latest svn). When shadows are used there is 2 calls from :
 

virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable, osg::State*) const
1 time with the default visitor and 1 time with the visitor from the shadow implementation wich has a specific traversal mask and a specific viewport (in my case 4096*4096) so the logo viewport is updated twice because of the code :  

if( vp->width() != logos->getViewport()->width() ||
vp->height() != logos->getViewport()->height() )
{
logos->getViewport()->setViewport( vp->x(), vp->y(), vp->width(), vp->height() );
logos->dirtyDisplayList();
}
}
Maybe we could check the _traversalMask from the visitor before updating the logo viewport, what do you think about ?
I know you're not a great fan from this plugin, but I find it very usefull.
 
Kind regards,


2009/7/15 Alexandre Amalric < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Quote:
Hi Robert,
 
Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

 

Yes it is.
 
Could you try svn/trunk and let me know how you get on.
 

I Tried this morning latest SVN and it's working great with this simple solution.

 
Kind regards,



2009/7/14 Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>

Quote:
Hi Alexandre,

I've decided to merged your change rather than look for a more complex
and more general solution, a more general solution can come later.
I've tweaked your changes a little to include returning of true when
the logo is traversed on a window it's not assigned to so the logo
will get culled.

Could you try svn/trunk and let me know how you get on.

Cheers,
Robert


On Mon, Jul 13, 2009 at 5:34 PM, Robert Osfield< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo.  The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days.  In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre Amalric< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin
logo.

When using more than one view logosCullCallback function is called without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org








--

Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr








--

Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr






--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12279

PostPosted: Fri Jul 24, 2009 10:52 am    Post subject:
Plugin Logo bug
Reply with quote

Hi Alexandre,

This screams out that the plugin is being used in ways that it simply
can't can, the same for your follow up email. The plugin tries to
achieve a feature in a way that is quite simply the wrong way tackle
it in a general purpose way - it'll only ever work in very constrained
scene graph usage. The write way to have logos is to add them to
your GraphicsWindow as a HUD camera, much in the way that the stats or
help is currently done in osgViewer.

Robert.

On Tue, Jul 21, 2009 at 10:35 AM, Alexandre
Amalric<> wrote:
Quote:

Hi Robert,

I found an other bug with the logo plugin when using shadows (PSSM + OSG
latest svn). When shadows are used there is 2 calls from :


virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable,
osg::State*) const
1 time with the default visitor and 1 time with the visitor from the shadow
implementation wich has a specific traversal mask and a specific viewport
(in my case 4096*4096) so the logo viewport is updated twice because of the
code :


if

( vp->width() != logos->getViewport()->width() ||

vp->height() != logos->getViewport()->height() )

{

logos->getViewport()->setViewport( vp->x(), vp->y(), vp->width(),
vp->height() );

logos->dirtyDisplayList();

}

}

Maybe we could check the _traversalMask from the visitor before updating the
logo viewport, what do you think about ?
I know you're not a great fan from this plugin, but I find it very usefull.

Kind regards,

2009/7/15 Alexandre Amalric <>
Quote:

Hi Robert,

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

Yes it is.

Could you try svn/trunk and let me know how you get on.

I Tried this morning latest SVN and it's working great with this
simple solution.

Kind regards,

2009/7/14 Robert Osfield <>
Quote:

Hi Alexandre,

I've decided to merged your change rather than look for a more complex
and more general solution, a more general solution can come later.
I've tweaked your changes a little to include returning of true when
the logo is traversed on a window it's not assigned to so the logo
will get culled.

Could you try svn/trunk and let me know how you get on.

Cheers,
Robert

On Mon, Jul 13, 2009 at 5:34 PM, Robert Osfield<>
wrote:
Quote:
Hi Alexandre,

I believe your changes suggest a deeper problem with the
design/implementation of the logo.  The plugin is a very early hack
that hasn't really been fully updated to take advantage of various
modern OSG features, I don't have time right now for a full rewrite
though.

Is the problem you are seeing triggered by the logo being used when
multiple graphics windows are used?

It does look like code assumes a single view per graphics window,
something that isn't always true with the OSG these days.  In the
Producer days when this plugin was written one couldn't easily have
multiple views per window, but these days it's trivial and common
place thing to do. If the logo was attached in a window with multiple
views that all shared the same scene graph we'd end up with the
viewport being updated multiple times, with the last view's viewport
taking precedence.

One possible solution would be to have the callback ignore the cull
visitor's viewport and use the whole graphics windows dimensions, so
the logo would be placed relative to the window rather than the last
rendered viewport.

All in all though, putting a logo in the scene graph is not the best
way of tackling the task of adding logo's - it'd be much better to use
a slave camera attached to the viewer/viewer.

Thougts?

Robert.

On Mon, Jul 6, 2009 at 3:57 PM, Alexandre
Amalric<> wrote:
Quote:
Hi osg-users,

I'm using osg svn version 2.9.5 and I've apparently found a bug in
osgPlugin
logo.

When using more than one view logosCullCallback function is called
without
checking context ID from the cull visitor is equal to logo _contextID
variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin.

I'm not used to post fix so I attached the modified cpp files in
current
mail, hope it helps...

Code I added is indicated with comment :

// AA DD/MM/YY Fix
Kind regards
--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr









--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr



--
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Problems with dae plugin John Richardson Plugins [osgPlugins] 0 Thu Apr 11, 2019 5:00 pm View latest post
No new posts [PARTIALLY SOLVED] Problems with dae ... Nikkitta Plugins [osgPlugins] 4 Mon Apr 08, 2019 3:51 pm View latest post
No new posts Add search location for textures in F... bbjorn Submission 1 Mon Feb 04, 2019 2:22 pm View latest post
No new posts OSG GLTF loader plugin Chris Hanson General 0 Thu Dec 06, 2018 9:55 pm View latest post
No new posts playing videos with audio channels wi... Trajce Nikolov NICK General 7 Wed Nov 21, 2018 9:17 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP