Re: [osg-users] [3rdparty] SpeedTree 6.0 integration

2014-03-21 Thread Daniel Schmid
Hi Michael

I wonder if your SpeedTree and terrain rendering is doing ok? We are about to 
integrate SpeedTree and we use paged/tiled terrain aswell.

Can you provide example code of how you integrated the SpeedTree classes and 
shaders into OSG? and also share some insights on the issues you faced?

I would be grateful!

Cheers,
Daniel

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





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


[osg-users] Controlling simulated time

2014-03-21 Thread Abbing, Arend
Hi,

Is there an easy way of controlling the simulated time without creating a 
Viewer subclass and re-implementing the run method?

I have a pseudo loader plugin that interfaces the HLA world and manipulates the 
scene graph. What I basically want is the setting of the simulated start time 
and the time scale.

Regards,

Arend

[cid:imagece06a5.JPG@2c0c9017.41a1bcaa][cid:imagecc3753.JPG@93e9b1b3.45843202]

ing. Arend Abbing


Software Engineer


Maritime Simulation  Software Group




MARIN




2, Haagsteeg

E a.abb...@marin.nlmailto:a.abb...@marin.nl   P.O. Box 28 T +31 317 49 39 
11
6700 AA Wageningen  F +31 317 49 32 45
T  +31 317 49 32 55 The Netherlands I  www.marin.nlhttp://www.marin.nl





MARIN news: 32nd FPSO JIP Week, March 24-28, 
Monacohttp://www.marin.nl/web/News/News-items/32nd-FPSO-JIP-Week-March-2428-Monaco.htm

This e-mail may be confidential, privileged and/or protected by copyright. If 
you are not the intended recipient, you should return it to the sender 
immediately and delete your copy from your system.


inline: imagece06a5.JPGinline: imagecc3753.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Controlling simulated time

2014-03-21 Thread Robert Osfield
HI Arend,

The viewer::run() method is just a convenience method, which is great for
small examples that want to illustrate other things than the make up for
the frame loop, however, for full blown apps I would typically recommend
just rolling your own frame loop. The next simplicist form of frame loop is
to expand the viewer.run() method to something like:

while(!viewer.done())
{
   viewer.frame(simulationTime);
}

To further expand it you'd have:

while(!viewer.done())
{
   viewer.advance(simulationTime);
   viewer.eventTraversal();
   viewer.updateTraversal();
   viewer.renderingTraversals();
}

You have access to all the source code of the OSG so I'd encourage you to
look at the implementations on the Viewer::run() and Viewer::frame()
methods so you see what is happening under the hood.

Robert.


On 21 March 2014 08:31, Abbing, Arend a.abb...@marin.nl wrote:

   Hi,



 Is there an easy way of controlling the simulated time without creating a
 Viewer subclass and re-implementing the run method?



 I have a pseudo loader plugin that interfaces the HLA world and
 manipulates the scene graph. What I basically want is the setting of the
 simulated start time and the time scale.



 Regards,



 Arend

 ing. Arend Abbing

 Software Engineer
   Maritime Simulation  Software Group



 *MARIN*


   2, Haagsteeg  E a.abb...@marin.nl P.O. Box 28 T +31 317 49 39 11  6700
 AA Wageningen F +31 317 49 32 45  T  +31 317 49 32 55 The Netherlands I
 www.marin.nl



 MARIN news: 32nd FPSO JIP Week, March 24-28, 
 Monacohttp://www.marin.nl/web/News/News-items/32nd-FPSO-JIP-Week-March-2428-Monaco.htm

 This e-mail may be confidential, privileged and/or protected by copyright.
 If you are not the intended recipient, you should return it to the sender
 immediately and delete your copy from your system.




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


inline: imagecc3753.JPGinline: imagece06a5.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] State of Qt5 integration?

2014-03-21 Thread Martin Scheffler
Hi all,

is anybody still working on integrating Qt5?

It seems that CMake now runs smoothly, but I could not get the osgviewerQT 
example running on Windows 7.  I see the Qt widgets, but the OSG windows are 
all black and the console is flooded with OpenGL errors. This is using Qt 5.2 
64 bit on Windows 7.

Has anyone managed to get both of these beasts running together? 

Thank you!

Cheers,
Martin

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





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


Re: [osg-users] Controlling simulated time

2014-03-21 Thread Abbing, Arend
Hi Robert,

Your proposed solution is not what I really want. I would like to have a 
capability where I can alter the behaviour of the simulated time determination 
from within a plugin without write my own Viewer class. This allows me to use 
the OSG software as is without writing my own stuff.

Regards,

Arend




MARIN news: Hydrodynamic software suites make design concept evaluation more 
efficienthttp://www.marin.nl/web/News/News-items/Hydrodynamic-software-suites-make-design-concept-evaluation-more-efficient-1.htm

This e-mail may be confidential, privileged and/or protected by copyright. If 
you are not the intended recipient, you should return it to the sender 
immediately and delete your copy from your system.


From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Friday, March 21, 2014 10:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Controlling simulated time

HI Arend,

The viewer::run() method is just a convenience method, which is great for small 
examples that want to illustrate other things than the make up for the frame 
loop, however, for full blown apps I would typically recommend just rolling 
your own frame loop. The next simplicist form of frame loop is to expand the 
viewer.run() method to something like:

while(!viewer.done())
{
   viewer.frame(simulationTime);
}

To further expand it you'd have:

while(!viewer.done())
{
   viewer.advance(simulationTime);
   viewer.eventTraversal();
   viewer.updateTraversal();
   viewer.renderingTraversals();
}

You have access to all the source code of the OSG so I'd encourage you to look 
at the implementations on the Viewer::run() and Viewer::frame() methods so you 
see what is happening under the hood.

Robert.

On 21 March 2014 08:31, Abbing, Arend 
a.abb...@marin.nlmailto:a.abb...@marin.nl wrote:
Hi,

Is there an easy way of controlling the simulated time without creating a 
Viewer subclass and re-implementing the run method?

I have a pseudo loader plugin that interfaces the HLA world and manipulates the 
scene graph. What I basically want is the setting of the simulated start time 
and the time scale.

Regards,

Arend
[cid:image001.jpg@01CF4509.4A557350][cid:image003.jpg@01CF4509.4A557350]


ing. Arend Abbing


Software Engineer

Maritime Simulation  Software Group






MARIN





2, Haagsteeg

E a.abb...@marin.nlmailto:a.abb...@marin.nl

P.O. Box 28

T +31 317 49 39 11tel:%2B31%20317%2049%2039%2011


6700 AA Wageningen

F +31 317 49 32 45tel:%2B31%20317%2049%2032%2045

T  +31 317 49 32 55tel:%2B31%20317%2049%2032%2055

The Netherlands

I  www.marin.nlhttp://www.marin.nl




MARIN news: 32nd FPSO JIP Week, March 24-28, 
Monacohttp://www.marin.nl/web/News/News-items/32nd-FPSO-JIP-Week-March-2428-Monaco.htm

This e-mail may be confidential, privileged and/or protected by copyright. If 
you are not the intended recipient, you should return it to the sender 
immediately and delete your copy from your system.



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

inline: image001.jpginline: image003.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] State of Qt5 integration?

2014-03-21 Thread Martin Scheffler
I just played around a bit and managed to get a very simple integration.
It is a bit cheating, I simply take an OSG window and add it to a Qt widget.
* No fancy Qt stuff supported like drag and drop, overdrawing etc.
* Only windows (although Linux should be no problem after some modifying)
* Multithreading not a problem here
* Should run with Qt 5.1 or newer


Code:


#include osgDB/ReadFile
#include osgGA/TrackballManipulator
#include osgViewer/Viewer
#include osgViewer/api/win32/GraphicsWindowWin32

#include QApplication
#include QHBoxLayout
#include QSlider
#include QTimer
#include QWidget
#include QWindow
#include assert.h

int main(int argc, char** argv)
{
if (argc2)
{
std::cout  argv[0] : requires filename argument.  std::endl;
return 1;
}   

// Create Qt app
QApplication app( argc, argv );
  
// Create OSG Window
osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer();

// setup viewer
{
viewer-setUpViewInWindow(0,0,800,600);
viewer-setCameraManipulator(new osgGA::TrackballManipulator);
viewer-setSceneData(osgDB::readNodeFile(argv[1]));
viewer-realize(); // else window does not show
}


QWidget* mainwidget = new QWidget;
mainwidget-setLayout(new QVBoxLayout());
mainwidget-resize(800,600);
mainwidget-show();

// Add osg window to main widget
{
osgViewer::ViewerBase::Windows wins;
viewer-getWindows(wins);

// Get native windows HWND window id from OSG window
osgViewer::GraphicsWindowWin32* osgwin = 
dynamic_castosgViewer::GraphicsWindowWin32*(wins.front());
assert(osgwin);
HWND winid = osgwin-getHWND();

// Create a QWindow from osg window id and place it in a widget
QWindow* qtwindow = QWindow::fromWinId((WId)winid);
QWidget* osgwidget = QWidget::createWindowContainer(qtwindow); 
osgwidget-setMinimumSize(QSize(320,200));

// Add osg widget to a main widget
mainwidget-layout()-addWidget(osgwidget);  
}

// Add a slider changing the background color
{
QSlider* slider = new QSlider(Qt::Horizontal, mainwidget);
slider-setRange(0, 255);
mainwidget-layout()-addWidget(slider);

// Connect to lambda
QObject::connect(slider, QSlider::valueChanged, [=](int v) { 
viewer-getCamera()-setClearColor(osg::Vec4((float)v / 256.0f, 0, 1, 1)); });
}


// Make Qt call osg tick
{
QTimer* timer = new QTimer(mainwidget);
timer-start(20);
QObject::connect(timer, QTimer::timeout, [=]() { viewer-frame(); });
}


app.exec();

// clean up
viewer = nullptr;
delete mainwidget;
return 0;
}





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





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


[osg-users] Graphics Context question

2014-03-21 Thread Conan
I have a RTT camera which renders to texture using graphics context 1.  
Can I render this texture on quad in graphics context 2?


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


Re: [osg-users] [3rdparty] SpeedTree 6.0 integration

2014-03-21 Thread Bush, Alex W.
My group is also implementing SpeedTree and having some trouble. Any help would 
be greatly appreciated. I managed to isolate OSG's OpenGL state by enabling 
glPush/glPop statements in the SpeedTree library (I know this isn't optimal), 
but I still can't get the 3D trees to render. Billboard trees are working 
(minus smooth fading between angles).

Alex

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Daniel Schmid
Sent: Friday, March 21, 2014 2:03 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [3rdparty] SpeedTree 6.0 integration

Hi Michael

I wonder if your SpeedTree and terrain rendering is doing ok? We are about to 
integrate SpeedTree and we use paged/tiled terrain aswell.

Can you provide example code of how you integrated the SpeedTree classes and 
shaders into OSG? and also share some insights on the issues you faced?

I would be grateful!

Cheers,
Daniel

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





___
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] Controlling simulated time

2014-03-21 Thread Robert Osfield
HI Arend,


On 21 March 2014 12:37, Abbing, Arend a.abb...@marin.nl wrote:

   Your proposed solution is not what I really want. I would like to have
 a capability where I can alter the behaviour of the simulated time
 determination from within a plugin without write my own Viewer class. This
 allows me to use the OSG software as is without writing my own stuff.


My explanation shows that you don't need to create your own viewer class,
you just need to create your own frame loop.

As for setting the simulation is some generic plugin that existing OSG
applications know nothing about, then sorry the OSG hasn't been designed
that way, plugins can load/save data or provide nod extensions, but things
like timing is the role of the viewer.

Please remember the OSG is a scene graph library, it's not an end user
application.  It's there to help you write your applications, it's not
their to provide applications.

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


Re: [osg-users] Graphics Context question

2014-03-21 Thread Robert Osfield
On 21 March 2014 15:59, Conan d...@celticblues.com wrote:

 I have a RTT camera which renders to texture using graphics context 1.
  Can I render this texture on quad in graphics context 2?


If you explictly create the graphics contexts so they are shared you can
share texture objects, however, to do this you have make sure that the two
graphics contexts are syncronized so that they never read/write to the same
GL objects at the same time, which for practically purposes means running
them in single threaded.

RTT Texture are best managed within the same context as the texture will be
used.

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


Re: [osg-users] Graphics Context question

2014-03-21 Thread Conan
I am using different graphics contexts simply because I want to display 
the texture(s) in a separate window from the window in which my original 
scene is rendered.  Is it possible to have 2 windows which share the 
same context, but have different scenegraphs?  How would I create the 
shared context?


CD

On 2014-03-21 12:17, Robert Osfield wrote:

On 21 March 2014 15:59, Conan d...@celticblues.com wrote:

I have a RTT camera which renders to texture using graphics context 
1.  Can I render this texture on quad in graphics context 2?


If you explictly create the graphics contexts so they are shared you
can share texture objects, however, to do this you have make sure that
the two graphics contexts are syncronized so that they never
read/write to the same GL objects at the same time, which for
practically purposes means running them in single threaded.

RTT Texture are best managed within the same context as the texture
will be used.

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