Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Nickolai Medvedev
You welcome. I would help more often if I had more free time.

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





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


Re: [osg-users] Using callbacks for all graph modifications?

2017-08-18 Thread Antoine Rennuit
Robert,

Thanks a lot for your quick answer!

I understand the design difference you mentioni and it is relevant.

Now from my readings of the beginners' guide, I understood that callbacks were 
needed to enforce thread safety. Your answer suggests that it is not the case. 
Can you confirm? i.e. do you confirm I can modify the OSG objects in a direct 
way (without callbacks) before calling Viewer::frame() and expect a correct 
rendering behavior?

Kind regards,

Antoine.

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





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


Re: [osg-users] Using callbacks for all graph modifications?

2017-08-18 Thread Robert Osfield
HI Antoine,

Callbacks are just one way of managing updates to the scene graph, whether
they are the most appropriate tool for each job depends entirely and usage
case, within one application you may well use multiple approaches, using
the appropriate tool for each task.

As a general guide I would suggest that one would use a node callback when
you want to encapsulate updates to particular subgraphs so that once you
add the callback it looks after its subgraph largely by itself.  For
instance a subgraph that you want to spin constantly you create/load the
subgraph put a transform above it and attach a callback.  Once setup you
then can just pass the whole subgraph into the main scene graph and not
have worry about the implementation details any more.

If your updates related closely with high level operations then you'd
typically push these high level updates into the frame loop - similar to
what you seem to be doing right now.

Robert.

On 18 August 2017 at 18:21, Antoine Rennuit 
wrote:

> Hi all,
>
> I have a custom DataModel describing objects, relations between them. The
> objects of my custom DataModel are rendered using OSG.
>
> Depending on user events in my app, the objects of my DataModel are
> modified and OSG is being notified of all these modifications. These
> modifications leads to e.g. osg::PositionAttitudeTransforms being
> updated, node masks being modified, osg::Geodes being added or removed of
> the graph (via addChild() / removeChild()). This leads to a live 3D
> rendering with animations...
>
> I do all the updates of my OSG graph in a raw way, without using
> callbacks. This gives code such as
>
>
> Code:
>
> m_worldFrame->setPosition(EigenToOsgVector3(m_node->m_worldFrame->m_pos));
> m_worldFrame->setAttitude(EigenToOsgQuat(m_node->m_worldFrame->m_quat));
>
> if (m_worldFrame)
> m_worldFrame->setNodeMask(0x);
> if (m_mesh)
> m_mesh->setNodeMask(0x);
>
>
>
>
> Now I am currently reading the Beginners' Guide and have read callbacks
> should be used for animation (chapter 8).
>
> Does that mean I should use callbacks for all modifications of the osg
> graph?
>
> This could be implemented in such a way that when my DataModel is updated
> a flag is updated which is read by the callbacks and depending on the state
> of the flag the callback performs the osg graph update of not. This is
> possible but this looks very heavy to implement...
>
> Am I getting something wrong? Or should I really use update callbacks for
> all modifications of the OSG graph (objects moving, setting masks...)?
>
> Thanks a lot,
>
> Antoine.[/code]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71456#71456
>
>
>
>
>
> ___
> 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] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Robert Osfield
On 18 August 2017 at 18:12, Nickolai Medvedev  wrote:

> You can unclench your fingers, now everything works. The error has been
> fixed.
>
>
Good to hear,  Thanks for the repeated testing, really helps improve the
quality of the code.

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


[osg-users] Using callbacks for all graph modifications?

2017-08-18 Thread Antoine Rennuit
Hi all,

I have a custom DataModel describing objects, relations between them. The 
objects of my custom DataModel are rendered using OSG.

Depending on user events in my app, the objects of my DataModel are modified 
and OSG is being notified of all these modifications. These modifications leads 
to e.g. osg::PositionAttitudeTransforms being updated, node masks being 
modified, osg::Geodes being added or removed of the graph (via addChild() / 
removeChild()). This leads to a live 3D rendering with animations...

I do all the updates of my OSG graph in a raw way, without using callbacks. 
This gives code such as


Code:

m_worldFrame->setPosition(EigenToOsgVector3(m_node->m_worldFrame->m_pos));
m_worldFrame->setAttitude(EigenToOsgQuat(m_node->m_worldFrame->m_quat));

if (m_worldFrame)
m_worldFrame->setNodeMask(0x);
if (m_mesh)
m_mesh->setNodeMask(0x);




Now I am currently reading the Beginners' Guide and have read callbacks should 
be used for animation (chapter 8).

Does that mean I should use callbacks for all modifications of the osg graph?

This could be implemented in such a way that when my DataModel is updated a 
flag is updated which is read by the callbacks and depending on the state of 
the flag the callback performs the osg graph update of not. This is possible 
but this looks very heavy to implement...

Am I getting something wrong? Or should I really use update callbacks for all 
modifications of the OSG graph (objects moving, setting masks...)?

Thanks a lot,

Antoine.[/code]

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Nickolai Medvedev
You can unclench your fingers, now everything works. The error has been fixed.

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Nickolai Medvedev
Allright, let's see... Give me a hour, i rebuild all, then i will test.

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Nickolai Medvedev
Hi, Robert.

Maybe, all problems in driver. Although, with OSG 3.4.0 everything works fine.

My computer data:

NVidia GeForce 640M
OpenGL Driver version: 365.19

It is necessary, that someone else has checked up a branch 3.4.1 on Visual 
Studio. If on another computer everything will work well, then the problem is 
with my drivers or configuration.

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Robert Osfield
Hi Nikolia,

On 18 August 2017 at 11:07, Nickolai Medvedev  wrote:

> Do you mean this stack?
>

Yes, although wa hoping for a bit but debug info.

>
> >   ntdll.dll!779315ee()
> [Указанные ниже фреймы могут быть неверны и (или) отсутствовать,
> символы для ntdll.dll не загружены]
> ntdll.dll!779315ee()
> ntdll.dll!7792015e()
> nvoglv32.dll!5e627fed()
> nvoglv32.dll!5dc2ea9d()
> osg.dll!54882912()
> osg.dll!5482aa94()
> osg.dll!5482fac2()
> osgViewer.dll!54bf6f3a()
> kernel32.dll!755d14dd()
> osg.dll!547f3901()
> osgUtil.dll!54a3d27e()
> osgUtil.dll!54a399a5()
> osgUtil.dll!54a3d8a3()
> osgUtil.dll!54a3ab9f()
> osgUtil.dll!54a3dc76()
> osgUtil.dll!54a4112c()
> osg.dll!5483ec8b()
> OpenThreads.dll!5529218b()
> msvcr100.dll!7226c556()
> msvcr100.dll!7226c600()
> kernel32.dll!755d33ca()
> ntdll.dll!77949ed2()
> ntdll.dll!77949ea5()
>

Looking at the above high library references it looks like the crash in the
OpenGL driver, which in turn suggests that there is either a driver bug or
the OSG is passing erroneous/incomplete data for some reason.  Given it's
associated with stats it could be a vertex array or primitive set is not
initialized correctly or something.

> Did forcing the recreation of GL work?
>

I'm talking about the problem include/osg/GL that is created by Cmake from
the src/osg/GL.in when run do the initial cmake initialization.  Once
CMakeCache.txt is created and with it the incliude/osg/GL header the later
won't get recreated unless you force cmake to do a full initialization
again.

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


Re: [osg-users] Invisible light points

2017-08-18 Thread Andreas Ekstrand
Strange, thought the reply-to address was set from osg-users...this was 
what I accidentally sent to Robert only:


Hi Robert,

Thanks for your reply, I realize you're busy with 3.4.1 right now. But 
if you can find the time to look into this I have also attached a simple 
example reproducing the issue in code. Commenting in adding of the geode 
will hide the light points.


/Andreas


On 2017-08-18 11:12, Robert Osfield wrote:

Hi Andreas,

On 18 August 2017 at 08:30, Andreas Ekstrand 
> wrote:


Did someone manage to reproduce this problem? Any suggestions are
welcome, I really don't understand what's happening here...


I haven't had a chance to test the issue yet.  In the latest OSG there 
are rewrites of various parts of the OSG to move fully over to use 
vertex arrays and supporting VAO's, my guess is this work touched upon 
osgSim::LightPoint* functionality and introduced a regression, as to 
what this might be I can't say without reproduce the issue and 
investigating the related code.


In general the behaviour you describe sounds like vertex array state 
that is not being set up correctly so the values used by the driver 
are just the last ones to be set rather than the one intended.


Robert.


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


#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

int main(int argc, char **argv)
{
  osgViewer::Viewer viewer;
  osg::ref_ptr topGroup = new osg::Group();

  osg::ref_ptr lpNode = new osgSim::LightPointNode();
  lpNode->addLightPoint(osgSim::LightPoint(osg::Vec3(-10.0f, 0.0f, 0.0f), 
osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f)));
  lpNode->addLightPoint(osgSim::LightPoint(osg::Vec3(10.0f, 0.0f, 0.0f), 
osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f)));
  topGroup->addChild(lpNode);

  osg::ref_ptr geode = new osg::Geode();
  osg::ref_ptr geometry = new osg::Geometry();
  osg::ref_ptr vertices = new osg::Vec3Array();
  vertices->push_back(osg::Vec3(-1.0f, -1.0f, 0.0f));
  vertices->push_back(osg::Vec3(1.0f, -1.0f, 0.0f));
  vertices->push_back(osg::Vec3(1.0f, 1.0f, 0.0f));
  vertices->push_back(osg::Vec3(-1.0f, 1.0f, 0.0f));
  geometry->setVertexArray(vertices);
  geometry->addPrimitiveSet(new osg::DrawArrays(GL_QUADS, 0, 4));
  geode->addDrawable(geometry);
  //topGroup->addChild(geode);

  viewer.setSceneData(topGroup);
  viewer.realize();
  return viewer.run();
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] access to viewer instances in plugins

2017-08-18 Thread Ralf Habacker
Am 16.08.2017 um 13:31 schrieb Robert Osfield:
Hi Robert,
> I don't know the full details of your usage case but the usual
> approach I would take for adding event handling to subgraphs that are
> loaded indepdently from the viewer is to use an event callback
> assigned to a node. 

> Would this work for you?
On a first look is seems to work. Thanks for your support.

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


Re: [osg-users] How to change "field of view"(FOV), distance.

2017-08-18 Thread Johny Canes
Hi,


Code:
double fovy, aspectRatio, zNear, zFar;
_camera->getProjectionMatrix().getPerspective(fovy, 
aspectRatio, zNear, zFar);

double aspect = (double)scrw / (double)scrh;
_camera->getProjectionMatrix().makePerspective(45, 
aspect, zNear, zFar);



Thank you!

Cheers,
Johny

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Sebastian Messerschmidt

Hi Nickolai,

Robert wants something like this:

https://i.stack.imgur.com/SjnI9.png

It is called "Call stack" in VisualStudio.

Cheers
Sebastian


Do you mean this stack?



ntdll.dll!779315ee()

[Указанные ниже фреймы могут быть неверны и (или) отсутствовать, 
символы для ntdll.dll не загружены]
ntdll.dll!779315ee()
ntdll.dll!7792015e()
nvoglv32.dll!5e627fed() 
nvoglv32.dll!5dc2ea9d() 
osg.dll!54882912()  
osg.dll!5482aa94()  
osg.dll!5482fac2()  
osgViewer.dll!54bf6f3a()
kernel32.dll!755d14dd() 
osg.dll!547f3901()  
osgUtil.dll!54a3d27e()  
osgUtil.dll!54a399a5()  
osgUtil.dll!54a3d8a3()  
osgUtil.dll!54a3ab9f()  
osgUtil.dll!54a3dc76()  
osgUtil.dll!54a4112c()  
osg.dll!5483ec8b()  
OpenThreads.dll!5529218b()  
msvcr100.dll!7226c556() 
msvcr100.dll!7226c600() 
kernel32.dll!755d33ca() 
ntdll.dll!77949ed2()
ntdll.dll!77949ea5()




Did forcing the recreation of GL work?



I did not understand this question.

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





___
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] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Nickolai Medvedev
Do you mean this stack?


>   ntdll.dll!779315ee()
[Указанные ниже фреймы могут быть неверны и (или) отсутствовать, 
символы для ntdll.dll не загружены]
ntdll.dll!779315ee()
ntdll.dll!7792015e()
nvoglv32.dll!5e627fed() 
nvoglv32.dll!5dc2ea9d() 
osg.dll!54882912()  
osg.dll!5482aa94()  
osg.dll!5482fac2()  
osgViewer.dll!54bf6f3a()
kernel32.dll!755d14dd() 
osg.dll!547f3901()  
osgUtil.dll!54a3d27e()  
osgUtil.dll!54a399a5()  
osgUtil.dll!54a3d8a3()  
osgUtil.dll!54a3ab9f()  
osgUtil.dll!54a3dc76()  
osgUtil.dll!54a4112c()  
osg.dll!5483ec8b()  
OpenThreads.dll!5529218b()  
msvcr100.dll!7226c556() 
msvcr100.dll!7226c600() 
kernel32.dll!755d33ca() 
ntdll.dll!77949ed2()
ntdll.dll!77949ea5()



> Did forcing the recreation of GL work?


I did not understand this question.

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





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


Re: [osg-users] Invisible light points

2017-08-18 Thread Robert Osfield
Hi Andreas,

On 18 August 2017 at 08:30, Andreas Ekstrand  wrote:

> Did someone manage to reproduce this problem? Any suggestions are welcome,
> I really don't understand what's happening here...
>

I haven't had a chance to test the issue yet.  In the latest OSG there are
rewrites of various parts of the OSG to move fully over to use vertex
arrays and supporting VAO's, my guess is this work touched upon
osgSim::LightPoint* functionality and introduced a regression, as to what
this might be I can't say without reproduce the issue and investigating the
related code.

In general the behaviour you describe sounds like vertex array state that
is not being set up correctly so the values used by the driver are just the
last ones to be set rather than the one intended.

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


[osg-users] Cloning text

2017-08-18 Thread Andreas Ekstrand

Hi,

With OSG 3.2.1 I have been able to do fast shallow cloning of 
osgText::Text in my own subclass, copying the _textureGlyphQuadMap 
instead of calling computeGlyphRepresentation, since the latter is a 
slow operation for my thousands of texts.


In OSG 3.5.6 this isn't possible, I guess due to a private 
GlyphQuads::operator=. So I'm looping through _textureGlyphQuadMap in my 
copy constructor and copy its glyphs and primitives separately instead. 
But I can't see my copied text at all! If I save it out to an .osg or 
.osgt file it's visible in osgviewer.


I guess setting GlyphQuads::operator= private was deliberate, so can 
someone explain how I can accomplish fast text cloning in OSG 3.5.6 or 
optimize it somehow?


Regards,
Andreas

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


Re: [osg-users] ViewerBase::frame() method slow after changing the color of a geometry

2017-08-18 Thread Gianni Ambrosio
Hi,
just an update that can be useful for others.

As suggested I split the original huge geometry in chunks (1-3 vertices 
each works fine) and it works fine now.

Thanks again,
Gianni

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





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


Re: [osg-users] Invisible light points

2017-08-18 Thread Andreas Ekstrand
Did someone manage to reproduce this problem? Any suggestions are 
welcome, I really don't understand what's happening here...

/Andreas

On 2017-08-04 13:12, Andreas Ekstrand wrote:

Hi,

I recently moved from OSG 3.2.1 to 3.5.6 and now I have problems with 
light points going invisible if rendered together with other geometry.


I managed to reproduce in a small test case - have a look at the 
attached lp and lp_poly models (both in 3.5.6 osgt and deprecated osg 
which I find easier to debug). With 3.5.6, I can only see the light 
points in the lp model and not in the lp_poly model - any idea why?


I tried disabling culling, changing render binds, removing all 
StateSets in the osg files. No matter what, it seems the geode causes 
the light points to be invisible. How can I fix this?


Regards,
Andreas



___
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] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-18 Thread Robert Osfield
Hi Nickolai,

On 17 August 2017 at 22:35, Nickolai Medvedev  wrote:

>
> > It's a stack trace rather than console output is what we need to start
> looking at the cause of the crash.
>
>
> There is nothing in the console.
>

All three log files you created are console output, it's all output to
std::cout an std::cerr.  I can only guess you used VIsulStudio to capture
the output, it's all console output though,

Again what I really need is a stack trace, at this point we only know that
crashes on your system somewhere in the StatsHandler.cpp.

FYI, it doesn't crash for me under Linux, so I'm not able to recreate the
crash myself, which means I need feedback from yourself and others in the
community that can reproduce the crash.



>
> > Do you mean the CMakeLists.txt changes relating to GL.in?
>
>
> Yes.
>

Did forcing the recreation of GL work?



> > Did this happen with 3.4.0 or OSG master?
>
> No. With 3.4.1 branch.
>

I'll review StatsHandler.cpp changes between 3.4.1 and 3.4.0, this might
provide some clues.

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