Re: [osg-users] OSG SIGGRAPH was a TOTALLY Massively Success

2016-11-03 Thread Eon Strife
Hi John, Thank you very much, I have received it :D

John Richardson wrote:
> Hello,
> 
> I'm the SIGGRAPH BOF moderator.
> 
> Let me see if I can dig them [Robert's slides] up and send them to you and
> whomever else wants them.
> 
> .
>  --
> Post generated by Mail2Forum


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





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


[osg-users] VPB and integrated features

2016-11-03 Thread Trajce Nikolov NICK
Hi community.

I have some small knowledge of VPB and that is from some short experience
years ago. Since then, I haven't followed the development ...

My simple question is, is VPB capable of integrating features (linear,
areal) into the terrain mesh?

Thanks as always!

-- 
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] Rendering Model in color

2016-11-03 Thread David Heitbrink
Two places where I have personally seen such issues, one from using code ported 
using an older version of OSG, the other was shader/driver differences between 
computers. 

If I remember some methods for setting color were removed moving from version 
3.0 to 3.2, and I had some code where the incompatible line was commented out, 
and not changed.

The with the shaders, basically I had a shader that worked with a AMD system, 
and but would fail to compile on a Nvidia system due to the Nvidia driver being 
pickier about syntax. With the shader program failing, it would default back to 
fixed pipeline, in which the uniform to set the color for the entire model of 
course would not work, and I was left with a black shape. In this case I did 
not recompile, and it was the same exact version of OSG on both systems.

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





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


Re: [osg-users] OSG SIGGRAPH was a TOTALLY Massively Success

2016-11-03 Thread John Richardson
Hello,

I'm the SIGGRAPH BOF moderator.

Let me see if I can dig them [Robert's slides] up and send them to you and
whomever else wants them.

Note: I will send you and Steve Satterfield, Prabhat's slides. He indicated
that the slides could be released. His slides are interesting because:
1) It is an actual case study of using OSG to create an android and iOS app.

 www.biodigital.com  is his company's website. 
Interested individuals can also go to youtube and type in Biodigital:-)
The app is on the Apple and android stores:-)
So, of particular interest to anyone just starting. The bottom  line seems
to be that Prabhat was able to stand up a development environment reasonably
easy. Troubleshoot any integration issues relatively efficiently and is able
to integrate the latest repository drops with minimum headaches for cross
platform app deployment.

So, it seems as though the guru's of OSG are producing top notch stuff with
a case study to prove it...:-)

If anyone wants this case study just email me off list. 

John

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On
Behalf Of Eon Strife
Sent: Thursday, October 27, 2016 6:16 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] OSG SIGGRAPH was a TOTALLY Massively Success

I am starting looking at OpenSceneGraph...I also want to see this slide in
order to get a good idea about the recent OpenSceneGraph. Where I can find
it ?

Thanks.


robertosfield wrote:
> On 2 August 2016 at 04:38, Tony Vasile wrote:
> 
> > Are Robert's slides available somewhere for those of us who couldn't
make it?
> > 
> 
> I will create a page on openscenegraph . org for them.
> ___
>  --
> Post generated by Mail2Forum


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





___
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] design issues

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

I am very thankful for every hint, really. These hints are really valuable
for optimization. And I found the issue, it was pre/post multiply order of
the matrices. I was to avoid the calculus from the nodepath and use the
ModelView matrix already available in the CullVisitor. Here is the snippet
for someone who might face the same issue:

osg::Matrixd inverseViewMatrix = getCurrentCamera()->getInverseViewMatrix();
osg::Matrixd modelViewMatrix = (*getModelViewMatrix());
osg::Matrixd worldMatrix = osg::computeLocalToWorld(getNodePath());
osg::Matrixd worldMatrix2 = modelViewMatrix * inverseViewMatrix;

worldMatrix is equal to worldMatrix2 .. It was really the order of the
matrices. I was under impression it is the same as in GLSL

Thanks a bunch again!

Cheers,
Nick

On Thu, Nov 3, 2016 at 2:59 PM, Robert Osfield 
wrote:

> I don't have time to dive deeply in user projects, I can do quick
> scans of email and provide quick replies where possible.  In terms of
> optimization I'd say avoiding the inverse matrix might be useful.
> Using the Matrix.postMultTrans/preMultTrans would also be another
> optimization step you could use.  The use of the UserValue looks like
> it won't be thread safe or even safe n the presence of multiple cull
> traversals.
>
> On 3 November 2016 at 11:40, Trajce Nikolov NICK
>  wrote:
> > Thanks Robert,
> >
> > I am aware of it, it is already used in my second snippet. Here it is:
> (is
> > it done properly?)
> >
> > void MyCullVisitor::apply(osg::LightSource& node)
> > {
> >
> > osg::Matrixd inverseViewMatrix =
> > osg::Matrixd::inverse(getCurrentCamera()->getViewMatrix());
> > osg::Matrixd worldMatrix = inverseViewMatrix *
> (*getModelViewMatrix());
> >
> > osg::Vec3d pos(node.getLight()->getPosition().x(),
> > node.getLight()->getPosition().y(), node.getLight()->getPosition().z());
> > worldMatrix = osg::Matrixd::translate(pos) * worldMatrix;
> >
> > node.setUserValue("WorldMatrix", worldMatrix);
> > if (node.getLight()->getLightNum() == 0)
> > {
> > osgUtil::CullVisitor::apply(node);
> > }
> > }
> >
> >
> > On Thu, Nov 3, 2016 at 9:14 AM, Robert Osfield  >
> > wrote:
> >>
> >> Hi Nick,
> >>
> >> The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix
> >> that it accumulates through the the scene graph traversal, you should
> >> just need to get the top of this stack using
> >> cullVisitor->getModelViewMatrix().
> >>
> >> Robert.
> >>
> >> On 2 November 2016 at 22:25, Trajce Nikolov NICK
> >>  wrote:
> >> > Hi Community,
> >> >
> >> > I am trying to optimize the rendering. Getting huge update numbers.
> >> >
> >> > The story is this:
> >> > My scene has huge number of lights, some are static (streetlights)
> some
> >> > dynamic (a car). The lighting engine needs the World matrix of a
> >> > LightSource
> >> > and the ViewMatrix (which is the same as the World inverse just with
> >> > some
> >> > extra rotation). In my code after the update before the rendering
> >> > traversal
> >> > I am updating these matrices each frame and I am about to place this
> >> > code in
> >> > my custom CullVisitor (which traverse the scene anyway but only the
> >> > active
> >> > children).
> >> >
> >> > Here is my approach at the moment: list of light entities and here is
> >> > how I
> >> > am computing these:
> >> > http://pastebin.com/0A64sc7Y
> >> > Simply getting the NodePath and computing the world matrix from this
> >> > node
> >> > path. This seams to be costly
> >> >
> >> > I am after wiser optimization, to place this in my CullVistor: Here is
> >> > the
> >> > snippet:
> >> > http://pastebin.com/6dQnih8N
> >> >
> >> > These snippets are simple and I would like to ask if this is more
> proper
> >> > way, which it seams to me since I will gain more performance by
> updating
> >> > only the culled and active nodes. Also the math in the cull visitor.
> >> >
> >> > Thanks a lot for any hints, ideas. As always :-)
> >> >
> >> > Cheers,
> >> > 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
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> 

[osg-users] Scene is transparent when loaded with osg 3.2.0 in iOS

2016-11-03 Thread Matheus Coelho Berger
Hi,

I'm working on an iOS project and while updating the osg version to 3.2.0 came 
across this bug(?). I can successfully load files (using IFCPlusPlus), generate 
geometry and load the scene, but for some reason, when the viewer is realized 
everything is transparent. I can interact with the 3d model and get data from 
it, but Im unable to see it. The same code worked with the other version of the 
osg i had. 

Unfortunately, the project is closed and I can't share any code, so I know you 
can't give me a strait solution, but Im looking for whatever tips you may have 
about what is causing this.

Thanks, for your time.

Cheers,
Matheus

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





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


Re: [osg-users] design issues

2016-11-03 Thread Robert Osfield
I don't have time to dive deeply in user projects, I can do quick
scans of email and provide quick replies where possible.  In terms of
optimization I'd say avoiding the inverse matrix might be useful.
Using the Matrix.postMultTrans/preMultTrans would also be another
optimization step you could use.  The use of the UserValue looks like
it won't be thread safe or even safe n the presence of multiple cull
traversals.

On 3 November 2016 at 11:40, Trajce Nikolov NICK
 wrote:
> Thanks Robert,
>
> I am aware of it, it is already used in my second snippet. Here it is: (is
> it done properly?)
>
> void MyCullVisitor::apply(osg::LightSource& node)
> {
>
> osg::Matrixd inverseViewMatrix =
> osg::Matrixd::inverse(getCurrentCamera()->getViewMatrix());
> osg::Matrixd worldMatrix = inverseViewMatrix * (*getModelViewMatrix());
>
> osg::Vec3d pos(node.getLight()->getPosition().x(),
> node.getLight()->getPosition().y(), node.getLight()->getPosition().z());
> worldMatrix = osg::Matrixd::translate(pos) * worldMatrix;
>
> node.setUserValue("WorldMatrix", worldMatrix);
> if (node.getLight()->getLightNum() == 0)
> {
> osgUtil::CullVisitor::apply(node);
> }
> }
>
>
> On Thu, Nov 3, 2016 at 9:14 AM, Robert Osfield 
> wrote:
>>
>> Hi Nick,
>>
>> The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix
>> that it accumulates through the the scene graph traversal, you should
>> just need to get the top of this stack using
>> cullVisitor->getModelViewMatrix().
>>
>> Robert.
>>
>> On 2 November 2016 at 22:25, Trajce Nikolov NICK
>>  wrote:
>> > Hi Community,
>> >
>> > I am trying to optimize the rendering. Getting huge update numbers.
>> >
>> > The story is this:
>> > My scene has huge number of lights, some are static (streetlights) some
>> > dynamic (a car). The lighting engine needs the World matrix of a
>> > LightSource
>> > and the ViewMatrix (which is the same as the World inverse just with
>> > some
>> > extra rotation). In my code after the update before the rendering
>> > traversal
>> > I am updating these matrices each frame and I am about to place this
>> > code in
>> > my custom CullVisitor (which traverse the scene anyway but only the
>> > active
>> > children).
>> >
>> > Here is my approach at the moment: list of light entities and here is
>> > how I
>> > am computing these:
>> > http://pastebin.com/0A64sc7Y
>> > Simply getting the NodePath and computing the world matrix from this
>> > node
>> > path. This seams to be costly
>> >
>> > I am after wiser optimization, to place this in my CullVistor: Here is
>> > the
>> > snippet:
>> > http://pastebin.com/6dQnih8N
>> >
>> > These snippets are simple and I would like to ask if this is more proper
>> > way, which it seams to me since I will gain more performance by updating
>> > only the culled and active nodes. Also the math in the cull visitor.
>> >
>> > Thanks a lot for any hints, ideas. As always :-)
>> >
>> > Cheers,
>> > 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
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scene displaced from (0, 0, 0)

2016-11-03 Thread Robert Osfield
Hi Bruno,

The home position is set during initialization of the view to the
scene graphs BoundingSphere's center and radius.  If you want to
change this home position then simply use a call along the lines:

viewer.getCamaraManipulator()->setHomePosition(...)

See the include/osgGA/CameraManipulator API for details.

Robert

On 3 November 2016 at 12:46, Bruno Oliveira
 wrote:
> Hello,
>
> I have a 3d scene that I manipulate with a TrackballManipulator, and setup a
> scene in which all nodes are centred in (5, 1).
>
> Now when I try to do use the home() function, I can't see my nodes. But if I
> center my scene around (0, 0, 0), my nodes appear.
> Should I use something else than home() to center my camera?
>
> Thank you
>
> ___
> 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] Loading problem, OpenVR integration

2016-11-03 Thread Sebastian Messerschmidt



Am 11/3/2016 um 12:08 PM schrieb Robert Osfield:

On 3 November 2016 at 10:19, Sebastian Messerschmidt
 wrote:

I struggled with some instance data not being sent to the GPU (2 gigabytes
worth of data textures) resulting in stutter. I ended up using:
viewer->getDatabasePager()->setDoPreCompile(true);


This only affects the handling of paged database, it has no effect on
static databases.

You're right. Forgot to mention, that the instances are paged via PagedLOD.




Maybe Robert can explain what is happening when using the pre-compiled
option is used. It helped with the textures for sure.


I've already gone into enough detail for the topic in hand. The only
great detail I can provide on pre-compilation is the read the code and
spell it out line by line.  OR... you could just open up an editor and
read the code yourself.


It wasn't meant as an offense or a request out of laziness. I simply 
wanted to avoid to spread non-sense. I'm quite comfortable with reading 
code, but that doesn't mean that there is a bigger picture one might miss.


Cheers
Sebastian





Robert.
___
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] Loading problem, OpenVR integration

2016-11-03 Thread Pelle Nordqvist
Hi Lorenzo, maybe you want to check out this thread:

http://forum.openscenegraph.org/viewtopic.php?t=14222

For me it helped by simply 'parading' all objects in front of the camera
at the start of the simulation, this forces the push to GPU needed,
as long as the data fits on the card.
I don't think there is any other way to really force this push
for a static database.

Cheers,

/Pelle

On 3 November 2016 at 12:08, Robert Osfield 
wrote:

> On 3 November 2016 at 10:19, Sebastian Messerschmidt
>  wrote:
> > I struggled with some instance data not being sent to the GPU (2
> gigabytes
> > worth of data textures) resulting in stutter. I ended up using:
> > viewer->getDatabasePager()->setDoPreCompile(true);
>
> This only affects the handling of paged database, it has no effect on
> static databases.
>
> > Maybe Robert can explain what is happening when using the pre-compiled
> > option is used. It helped with the textures for sure.
>
> I've already gone into enough detail for the topic in hand. The only
> great detail I can provide on pre-compilation is the read the code and
> spell it out line by line.  OR... you could just open up an editor and
> read the code yourself.
>
> Robert.
> ___
> 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] Scene displaced from (0, 0, 0)

2016-11-03 Thread Bruno Oliveira
Hello,

I have a 3d scene that I manipulate with a TrackballManipulator, and setup
a scene in which all nodes are centred in (5, 1).

Now when I try to do use the home() function, I can't see my nodes. But if
I center my scene around (0, 0, 0), my nodes appear.
Should I use something else than home() to center my camera?

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


Re: [osg-users] implement filedialog without using qt

2016-11-03 Thread Trajce Nikolov NICK
Hi Sebasstian,

have you considered MyGUI? It has that implementation and it is ported to
osg by Rui (in his receipts)

On Thu, Nov 3, 2016 at 10:32 AM, Sebastian Schmidt 
wrote:

> Hi,
>
> I want to implement a functionality similar to the QFileDialog in osg
> (currently 3.0.1).
> A window shows up, where the user can navigate through the filesystem
> and load/save files.
> I haven*t used qt in my application yet and i don't want to use it at all.
>
> Is there already a class f.e in the osgWidget folder and maybe in newer
> versions of osg, which does what i want?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69217#69217
>
>
>
>
>
> ___
> 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] design issues

2016-11-03 Thread Trajce Nikolov NICK
Thanks Robert,

I am aware of it, it is already used in my second snippet. Here it is: (is
it done properly?)


   1. void MyCullVisitor::apply(osg::LightSource& node)
   2. {
   3.
   4. osg::Matrixd inverseViewMatrix = osg::Matrixd::inverse(
   getCurrentCamera()->getViewMatrix());
   5. osg::Matrixd worldMatrix = inverseViewMatrix * (*
   getModelViewMatrix());
   6.
   7. osg::Vec3d pos(node.getLight()->getPosition().x(), node.getLight()
   ->getPosition().y(), node.getLight()->getPosition().z());
   8. worldMatrix = osg::Matrixd::translate(pos) * worldMatrix;
   9.
   10. node.setUserValue("WorldMatrix", worldMatrix);
   11. if (node.getLight()->getLightNum() == 0)
   12. {
   13. osgUtil::CullVisitor::apply(node);
   14. }
   15. }


On Thu, Nov 3, 2016 at 9:14 AM, Robert Osfield 
wrote:

> Hi Nick,
>
> The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix
> that it accumulates through the the scene graph traversal, you should
> just need to get the top of this stack using
> cullVisitor->getModelViewMatrix().
>
> Robert.
>
> On 2 November 2016 at 22:25, Trajce Nikolov NICK
>  wrote:
> > Hi Community,
> >
> > I am trying to optimize the rendering. Getting huge update numbers.
> >
> > The story is this:
> > My scene has huge number of lights, some are static (streetlights) some
> > dynamic (a car). The lighting engine needs the World matrix of a
> LightSource
> > and the ViewMatrix (which is the same as the World inverse just with some
> > extra rotation). In my code after the update before the rendering
> traversal
> > I am updating these matrices each frame and I am about to place this
> code in
> > my custom CullVisitor (which traverse the scene anyway but only the
> active
> > children).
> >
> > Here is my approach at the moment: list of light entities and here is
> how I
> > am computing these:
> > http://pastebin.com/0A64sc7Y
> > Simply getting the NodePath and computing the world matrix from this node
> > path. This seams to be costly
> >
> > I am after wiser optimization, to place this in my CullVistor: Here is
> the
> > snippet:
> > http://pastebin.com/6dQnih8N
> >
> > These snippets are simple and I would like to ask if this is more proper
> > way, which it seams to me since I will gain more performance by updating
> > only the culled and active nodes. Also the math in the cull visitor.
> >
> > Thanks a lot for any hints, ideas. As always :-)
> >
> > Cheers,
> > 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] Loading problem, OpenVR integration

2016-11-03 Thread Robert Osfield
On 3 November 2016 at 10:19, Sebastian Messerschmidt
 wrote:
> I struggled with some instance data not being sent to the GPU (2 gigabytes
> worth of data textures) resulting in stutter. I ended up using:
> viewer->getDatabasePager()->setDoPreCompile(true);

This only affects the handling of paged database, it has no effect on
static databases.

> Maybe Robert can explain what is happening when using the pre-compiled
> option is used. It helped with the textures for sure.

I've already gone into enough detail for the topic in hand. The only
great detail I can provide on pre-compilation is the read the code and
spell it out line by line.  OR... you could just open up an editor and
read the code yourself.

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


Re: [osg-users] Loading problem, OpenVR integration

2016-11-03 Thread Sebastian Messerschmidt

Hi,



Hi Robert! Thank you for your kind reply.


robertosfield wrote:

Is the scene static or is your application adding new scene graph
objects through the lifetime of the application?



The scene is completely static and motionless :)


robertosfield wrote:

It's only new objects that you need to compile to make sure that the
graphics objects are created and ready to download to the GPU



Ok, perfect. I'm pretty sure that the compilation process is already performed 
on the entire scene by the system I'm working on.
Do you think that my problem could be caused by a missing compilation of 
objects? If you say that it might be the case, I will investigate more on this.
I struggled with some instance data not being sent to the GPU (2 
gigabytes worth of data textures) resulting in stutter. I ended up using:

viewer->getDatabasePager()->setDoPreCompile(true);

which solved the problem for me, as I preload the scene anyways. So the 
stutter is converted to a long pause before the first frame is displayed.


Maybe Robert can explain what is happening when using the pre-compiled 
option is used. It helped with the textures for sure.


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


[osg-users] help for warping

2016-11-03 Thread Gianni Ambrosio
Hi All,
I'm struggling with a warping implementation to show a 3D scene to a curved 
screen.

I gave a look at osgdistortion example and implemented a RTT camera just like 
in that example.
So now I have a render to texture camera that generates a texture of the 3D 
scene. Then a HUD camera with a geode as child where its geometry is attached 
to the texture.

I have a csv file that describes the screen shape as mesh of points. The file 
contains the following data: x,y,z,u,v.
Each line represents the x,y,z patial coordinates of a screen point.

For a different project that uses Unity and C#, a colleague implemented the 
warping basically in this way:


Code:

Vector2[] uvs = new Vector2[mesh.vertices.Count()];
for (int i = 0; i < mesh.vertices.Count(); i++) {
Vector3 pos = camera.WorldToViewportPoint(mesh3d.vertices[i]);
uvs[i] = new Vector2(pos.x, pos.y);
}
mesh.uv = uvs;



I didn't find a WorldToViewportPoint method in OSG but I find some references 
on the web to implement it.

On the other hand it seems the osgdistortion example is implemented differently.

One more thing I have to say is that projectors and curved screen are fixed 
while the observer is sitting on a moving platform. So I have to correct the 
camera frustum first.

Anyway, could you please suggest and explain me how to implement the warping 
considering that it would be also nice to use a shader to improve performance 
(if possible)?

Cheers,
Gianni

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





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


Re: [osg-users] Loading problem, OpenVR integration

2016-11-03 Thread Robert Osfield
Hi Lorenzo,

>From your description it's sounds like either objects aren't
pre-compiled or that they have been pre-compiled but not yet
downloaded by the GPU.

In OpenGL there is no way to formally force a GL object to be download
to the GPU, it's up to the drive to decide what it does when.  You can
however leverage the fact that texture and vertex buffer objects will
be made resident on the GPU by rendering them and as long as there is
enough memory to keep them around they'll be left resident by the
driver for when you actually need them.

The osgUtil::GLObjectsVisitor just does compilation it doesn't do any
dummy rendering to force the download to the GPU.  The
osgUtil::IncrementalCompileOperation does has an option for rendering
an dummy geometry to force the download of textures, but this is not
on by default, and only used during incremental compilation - i.e.
when using a paged database.

One possible route you could take would be to subclass from
GLObjectVisitor and add in a geometry in a similar way to what the
IncrementalCompileOpeation does and invoke this via a custom
RealizeOperation (see the osgvolume example to see how
RealizeOperation can be used.) You'd need to make sure that your scene
graph is assigned to the viewer before the windows are realized
though,

When rendering a force download dymmy geometry you'd want to do it in
a way the geometry rendering doesn't affect the framebuffer, either by
doing prior to a clear of the graphics window or by ensuring all
geometry is out of the view frustum or discarding the fragments.

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


[osg-users] implement filedialog without using qt

2016-11-03 Thread Sebastian Schmidt
Hi,

I want to implement a functionality similar to the QFileDialog in osg 
(currently 3.0.1).
A window shows up, where the user can navigate through the filesystem
and load/save files.
I haven*t used qt in my application yet and i don't want to use it at all.

Is there already a class f.e in the osgWidget folder and maybe in newer 
versions of osg, which does what i want?

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





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


Re: [osg-users] Loading problem, OpenVR integration

2016-11-03 Thread Lorenzo Valente
Hi Robert! Thank you for your kind reply.


robertosfield wrote:
> Is the scene static or is your application adding new scene graph
> objects through the lifetime of the application?


The scene is completely static and motionless :)


robertosfield wrote:
> It's only new objects that you need to compile to make sure that the
> graphics objects are created and ready to download to the GPU


Ok, perfect. I'm pretty sure that the compilation process is already performed 
on the entire scene by the system I'm working on.
Do you think that my problem could be caused by a missing compilation of 
objects? If you say that it might be the case, I will investigate more on this.


robertosfield wrote:
> The other issue might be that the graphic objects have are all
> compiled already but not download to the GPU.  Also if the GPU memory
> is full the driver has to start moving graphics objects in/out of GPU
> memory on the fly which can cause big frame drops.


Do you think this might be the case? Is there a way in OSG to tell if an object 
is already in the GPU memory? And to push them there?
I remind you that once I scan the all scene with my vision the problem 
disappears and I can look around without any frame drop.
So I guess that the GPU memory is enough to handle the whole scene, I just need 
to force some sort of "pre-loading" of ALL objects.


robertosfield wrote:
> What specifically you need to do to resolve the problem depends
> entirely where the actual bottleneck is, we can't answer this without
> knowing more about what is happening your scene graph, how much
> headroom you have on the GPU to handle the extra memory usage,
> bandwidth and compute work.


As I said, my conclusion is that I don't have any actual system bottleneck, I 
just have to get rid of this lazy loading process :)
I just need to tell the GPU "hey, here's my scene, I know you can handle it 
all, just pre-process it in one shot and don't wait for me to look around!"
But I could be completely wrong and I'd love to know what you guys think about 
it. I want to 1) learn more about OSG and VR 2) solve this annoying problem.

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





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


Re: [osg-users] Rendering Model in color

2016-11-03 Thread Robert Osfield
Hi Uma,

On 3 November 2016 at 05:49, Uma Devi Selvaraj  wrote:
>I have installed OSG in my system(windows 10, 64 bit). When I tried to 
> render colored model , the model is not rendering in color.  I have installed 
> OSG in another system(windows 8 , 64 bit) and tried to render same model in 
> that system, where I am able to render the model in color. I have read the 
> system requirements in OSG User Guide. Should I need to install latest 
> OpenGL.? or What could be the problem?

I haven't ever heard of users reporting a colour issue so I suspect
it's not a general problem, and not something likely to find an answer
for in user guides.

What exactly do you mean by in colour and not in colour?

Texturing failing?  Material properties?

Does this happen for all models, just some?

What happens with OSG examples?

The fact that I'm having to ask lots of question is a strong
indication that your posts don't provide enough information for us to
help as is.  It would be worth thinking about what information we
might need before pressing send.

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


Re: [osg-users] design issues

2016-11-03 Thread Robert Osfield
Hi Nick,

The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix
that it accumulates through the the scene graph traversal, you should
just need to get the top of this stack using
cullVisitor->getModelViewMatrix().

Robert.

On 2 November 2016 at 22:25, Trajce Nikolov NICK
 wrote:
> Hi Community,
>
> I am trying to optimize the rendering. Getting huge update numbers.
>
> The story is this:
> My scene has huge number of lights, some are static (streetlights) some
> dynamic (a car). The lighting engine needs the World matrix of a LightSource
> and the ViewMatrix (which is the same as the World inverse just with some
> extra rotation). In my code after the update before the rendering traversal
> I am updating these matrices each frame and I am about to place this code in
> my custom CullVisitor (which traverse the scene anyway but only the active
> children).
>
> Here is my approach at the moment: list of light entities and here is how I
> am computing these:
> http://pastebin.com/0A64sc7Y
> Simply getting the NodePath and computing the world matrix from this node
> path. This seams to be costly
>
> I am after wiser optimization, to place this in my CullVistor: Here is the
> snippet:
> http://pastebin.com/6dQnih8N
>
> These snippets are simple and I would like to ask if this is more proper
> way, which it seams to me since I will gain more performance by updating
> only the culled and active nodes. Also the math in the cull visitor.
>
> Thanks a lot for any hints, ideas. As always :-)
>
> Cheers,
> 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] Loading problem, OpenVR integration

2016-11-03 Thread Robert Osfield
Hi Lorenzo,

The performance constraints on immersive stereo display systems are
pretty well the tightest in graphics, even small glitchs can be lead
to unpleasant experience.  Couple this with rendering more than twice
as much data (two eyes and distortion correction passes) means that
you don't have much wiggle room to make sure things run sweetly. Good
VR isn't easy so you'll need to be patient with learning the issues
and how to resolve them, as a dev new to the area you've jumped in the
deep end :-)

Is the scene static or is your application adding new scene graph
objects through the lifetime of the application?

It's only new objects that you need to compile to make sure that the
graphics objects are created and ready to download to the GPU?

The other issue might be that the graphic objects have are all
compiled already but not download to the GPU.  Also if the GPU memory
is full the driver has to start moving graphics objects in/out of GPU
memory on the fly which can cause big frame drops.

What specifically you need to do to resolve the problem depends
entirely where the actual bottleneck is, we can't answer this without
knowing more about what is happening your scene graph, how much
headroom you have on the GPU to handle the extra memory usage,
bandwidth and compute work.

Robert.

On 2 November 2016 at 17:00, Lorenzo Valente  wrote:
> Hi,
>
> I'm working on a Virtual Reality project that involves the rendering of a OSG 
> scene in an Oculus Rift CV1 device using the OpenVR library. All these 
> technologies are pretty new to me so everything is as exciting as frustrating 
> :)
> My code is based on the Chris Denham "osgopenvrviewer" project (you can find 
> it on Github)
>
> So, my starting point is a osgViewer::View that contains my immersive scene. 
> I managed to render it in the headset display by doing this:
>
>
> Code:
> osg::ref_ptr vrViewer = new OpenVRViewer(myView, myDevice, 
> myRealizeOperation);
> osg::ref_ptr sceneData = myView->getSceneData();
> vrViewer->addChild(sceneData);
> myView->setSceneData(vrViewer);
>
>
>
> So far so good, the render quality and the stereo effect are perfect.
> The problems start when I move my head to look around in the scene: it looks 
> like the objects outside my first view frustum are not ready when the 
> application starts, so I get serious frame drops when I see these objects for 
> the first time. These frame drops are particulary annoying in the headset, 
> where a frame drop freezes the view for a fraction of second multiple times, 
> causing a very ugly effect.
>
> This happens only the first time I look around: after a first "scan" of the 
> scene, everything works smoothly and nice.
>
> The system I'm working on started as a simple desktop application with a 
> single view/camera and I couldn't reproduce these problems in the no-VR 
> version. I can look around very fast using a gamepad without losing any frame.
> So, I guess the problem is in the OpenVR integration.
>
> Is there anyone who already had this kind of issues? Do you have an idea on 
> how to manage pre-loading of the entire scene before the realtime simulation 
> starts?
>
> Thank you!
>
> Cheers,
> Lorenzo
>
> P.S. I see that many people solved this problem using 
> osgViewer::Renderer->setCompileOnNextDraw(true) but I think it is not enough 
> in my case. I have two RTT slave cameras for VR rendering (left eye and right 
> eye) and I saw that the "setSceneData" method internally calls 
> "setCompileOnNextDraw" on every slave camera in the viewer.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69205#69205
>
>
>
>
>
> ___
> 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