[osg-users] How to use frame buffer object in existing (not osg) window and pipeline.

2017-02-17 Thread Han Hu
Hi,

I know OSG viewer can render into other window as shown in the glutviewer and 
sdl viewer example. But I do not know how to use fbo for this kind of work. The 
following code describes my purpose.



Code:


osg::ref_ptr viewer;
/* The vierwer is properly set up for other window*/

FrameBufferObject fbo;
/* The fbo is properly initilize with color and depth texture attachment and 
bind to a FBO object. And the fbo class have access to the texture object and 
will be used for image based rendering technic*/

/* The rendering loop */
void draw()
{
// only repaint the whole scene when needed, because my scene is rather 
static and heavy, 
// draw fewer things 
if(dragging){
fbo.bind();
/* draw a fewer things into fbo*/
viewer.frame();
fbo.unbind();
}

/* Draw heavier things */
if(need_repaint)
{
fbo.bind();
viewer.frame();
fbo.unbind();
}

/* Do some post processing with fbo, e.g. eye dome lighting, which is  
a image based rendering techniqe */
{
/* filtering */
filter(fbo);
}

/* blit the fbo onto backbuffer */
fbo.blit();

swapbuffer();
}





So my question is how to do this kind of fbo processing in OSG, because after 
investigate osg framebufferobject, I find the logic is not like this and a 
little confuse to understand. 

Thank you!

Cheers,
Han

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





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


Re: [osg-users] Viewer slaves and RTTs

2017-02-17 Thread Robert Osfield
Hi Johny,

The  View(er) master Camera has default StateSet assigned to that
initialises OpenGL into an appropriate state for doing typical 3D
rendering via StateSet::setGlobalDefaults().  By replacing the default
Camera my guess is that you aren't assigning your own osg::StateSet
with the appropriate state set to it, so you are just getting OpenGL
defaults which doesn't set up the depth buffer.

Robert


On 17 February 2017 at 19:46, Johny Canes  wrote:
> Hi,
>
> Sorry for one chunky looking post, but it's actually quite coherent. Can I 
> have your short attention it's very appreciated.
>
> I am trying to use viewer slaves with a chain of render-to-textures. I 
> understand this is best done using several cameras.
>
> I've looked at plenty of resources online as well as all the examples.
>
> I am aiming for a postprocessing setup using a main camera and an 
> orthographic camera that renders a quad to the screen.
>
> I have a main camera that renders the scene, attached as
>
> Code:
> viewer.addSlave( main, osg::Matrix(), osg::Matrix() );
>
>
>
>
> It is supposed to render the 'scene data' as set by setSceneData. This kind 
> of works... but not without peculiar problems.
>
> And my orthographic camera, with a quad as its child, attached as
> Code:
> viewer.addSlave(ortho, osg::Matrix(), osg::Matrix(), false);
>
>
>
>
> One problem is that osgViewer has a default camera, and when I override it 
> with mine using
> Code:
> viewer.setCamera( main )
>
> , the z-ordering goes nuts.
>
> The orthographic is rendering its quad properly though, which has its texture 
> set to the color attachment of the main camera, because my main camera has
> Code:
> camera->attach( osg::Camera::COLOR_BUFFER, texture, 0, 0, false, 0, 0 );
>
>
>
> However, problems remain. I have been outcommenting lines of my code to get 
> nearer to the problem, and random things and unexpected discrepancies are 
> happening as I go.
>
>
> Code:
> viewer.addSlave( camera, osg::Matrix(), osg::Matrix() );
> viewer.setCamera( camera ); // unnecessary / messes up z-ordering ...
>
>
>
> These two lines of code for example. If I switch these lines, the camera will 
> not render (my texture will be black instead of the scene).
>
> Another odd things, is that whilst I've set the color attachment of main, it 
> is still writing to the screen. Sadly, when I tell it to use an FBO, it goes 
> black completely (apparently neither rendering to my color attachment nor the 
> screen).
>
> So I have things working and not working, but currently I am battling some 
> odd behavior that I cannot best.
>
> Cheers,
> Johny
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70235#70235
>
>
>
>
>
> ___
> 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] [ A Stack Overflow for OSG? ]

2017-02-17 Thread Robert Osfield
On 17 February 2017 at 19:23, Johny Canes  wrote:
> It's a bit of a ruty archaic combo - a phpbb forum backed by a mailing list. 
> Nobody has any respect for this place, meaning everybody just posts questions 
> instead of searching for a generic problem domain.

Your response is classic example of someone who responds with emotive
and manipulative language  when you can't convince others to do what
you want. Please keep such post off the forum/mailing list is they
really aren't helpful to us as a community or to you getting the
support you need i.e. don't be a obnoxious to others that you want
help from.

The mailing list/forum exists for supporting the community.  Sure we
get quite a few posts from developers who really could have easily got
an answer by reading the heads, the doxygen docs, the OSG examples,
the docs on the website, the OSG books or search the web.  Developers
with more initiative will find these examples and rarely post apart
from advanced question.

Sure I woould prefer that all developers had the initiative to get by
without asking so many obvious questions, but the world is made of
many different type of people, some people like do background research
and try to learn things for themselves while others call for help for
the most trivial details.  No matter how much documentation or the
avenues for accessing information there will always be users who ask
questions first.  Such developers will always be more visible in a
community like this, but it doesn't mean they make up the bulk of the
community.

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


Re: [osg-users] Viewer slaves and RTTs

2017-02-17 Thread Johny Canes
Hi,

I am repurposing the default camera using camera = viewer.getCamera(); and this 
seems to tackle the z-problem. Everything is in a workable state, but nothing 
is quite as I want it, e.g. right now I am rendering to both the screen and the 
color attachment.

Using a render target implementation like Frame Buffer Object just gives me 
black.

Cheers,
Johny

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





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


[osg-users] Viewer slaves and RTTs

2017-02-17 Thread Johny Canes
Hi,

Sorry for one chunky looking post, but it's actually quite coherent. Can I have 
your short attention it's very appreciated.

I am trying to use viewer slaves with a chain of render-to-textures. I 
understand this is best done using several cameras.

I've looked at plenty of resources online as well as all the examples.

I am aiming for a postprocessing setup using a main camera and an orthographic 
camera that renders a quad to the screen.

I have a main camera that renders the scene, attached as

Code:
viewer.addSlave( main, osg::Matrix(), osg::Matrix() );




It is supposed to render the 'scene data' as set by setSceneData. This kind of 
works... but not without peculiar problems.

And my orthographic camera, with a quad as its child, attached as 
Code:
viewer.addSlave(ortho, osg::Matrix(), osg::Matrix(), false);




One problem is that osgViewer has a default camera, and when I override it with 
mine using 
Code:
viewer.setCamera( main )

, the z-ordering goes nuts.

The orthographic is rendering its quad properly though, which has its texture 
set to the color attachment of the main camera, because my main camera has 
Code:
camera->attach( osg::Camera::COLOR_BUFFER, texture, 0, 0, false, 0, 0 );



However, problems remain. I have been outcommenting lines of my code to get 
nearer to the problem, and random things and unexpected discrepancies are 
happening as I go.
 

Code:
viewer.addSlave( camera, osg::Matrix(), osg::Matrix() );
viewer.setCamera( camera ); // unnecessary / messes up z-ordering ...



These two lines of code for example. If I switch these lines, the camera will 
not render (my texture will be black instead of the scene).

Another odd things, is that whilst I've set the color attachment of main, it is 
still writing to the screen. Sadly, when I tell it to use an FBO, it goes black 
completely (apparently neither rendering to my color attachment nor the screen).

So I have things working and not working, but currently I am battling some odd 
behavior that I cannot best.

Cheers,
Johny

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





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


Re: [osg-users] [osgPlugins] using osgconv with fbx?

2017-02-17 Thread Kevin Steele
Hi,
Thanks for the suggestions, but it is still not working.
I added the paths for FBX_INCLUDE_DIR, FBX_LIBRARY, and FBX_LIBRARY_DEBUG in 
CmakeCache.txt. Then, I recompiled OSG.

However, when I tried to convert from fbx to osg, I got this error message:

"osgconv dragon.fbx dragon6.osg
Warning: dynamic library '/usr/local/lib/osgPlugins-3.4.0/osgdb_fbx.so' exists, 
but an error occurred while trying to open it:
dlopen(/usr/local/lib/osgPlugins-3.4.0/osgdb_fbx.so, 9): Library not loaded: 
@executable_path/libfbxsdk.dylib
  Referenced from: /usr/local/lib/osgPlugins-3.4.0/osgdb_fbx.so
  Reason: image not found
Warning: Could not find plugin to read objects from file "dragon.fbx".
Error no data loaded"

Any idea how to fix that error? 

Also, I can't see the attachment someone on this board tried to attach- there 
is a note that says: The Extension 'cmake' was deactivated by an board admin, 
therefore this Attachment is not displayed.
Thank you!

Cheers,
Kevin

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





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


Re: [osg-users] [ A Stack Overflow for OSG? ]

2017-02-17 Thread Johny Canes
Hi,

It's a bit of a ruty archaic combo - a phpbb forum backed by a mailing list. 
Nobody has any respect for this place, meaning everybody just posts questions 
instead of searching for a generic problem domain.

Thank you!

Cheers,
Johny

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





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


Re: [osg-users] intersection tests

2017-02-17 Thread Trajce Nikolov NICK
It has to do with MatrixTransforms and probably the IntersectionVisitor. I
had my scene rotated a bit and it was buggy. With identity matrix on top
works well ... Trying to debug if I can find something

On Thu, Feb 16, 2017 at 8:31 PM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi Community,
>
> I am experiencing some bad results from various intersection tests. I have
> a database with buildings and for some reason the intersection tests are
> failing to get me the roofs of the buildings ...
>
> Here some snippets of my tries:
>
> http://pastebin.com/s7aZk8wA
> http://pastebin.com/1s99SGZc
> http://pastebin.com/UtkqPRce
>
> What I am missing here?
>
> Thanks for every hint as always!
> Cheers!
>
> --
> trajce nikolov nick
>



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


Re: [osg-users] [ A Stack Overflow for OSG? ]

2017-02-17 Thread Sebastian Messerschmidt



Am 2/17/2017 um 1:35 PM schrieb Johny Canes:

Hi,

The forum is great for complaining about your problems, but it is a bit of an 
unmoderated mess. You'd be better off launching a Stack Overflow site made just 
for OSG.
Can you elaborate, what kind of moderation you miss? Currently I'm the 
only active moderator and can perform only basic tasks in my free-time.
There is simply no more time for me than for the spam-filtering, basic 
user administration etc. And I second Robert's opinion. Splitting time 
between two support channels won't work for me either.


Basically most of the oldies here prefer the mailing list anyways, which 
is attached to the forum. So help in terms of long-term forum moderation 
is always welcome.


Cheers
Sebastian



Thank you!

Cheers,
Johny

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





___
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] [ A Stack Overflow for OSG? ]

2017-02-17 Thread Robert Osfield
Hi Johny,

On 17 February 2017 at 12:35, Johny Canes  wrote:
> The forum is great for complaining about your problems, but it is a bit of an 
> unmoderated mess. You'd be better off launching a Stack Overflow site made 
> just for OSG.

And then we'd need to split out time between support on Stack Overflow
and support here on the forum/mailing list.  What might be good for
you personally can be show stopper for those having to try and juggle
multiple avenues for support.

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


[osg-users] [ A Stack Overflow for OSG? ]

2017-02-17 Thread Johny Canes
Hi,

The forum is great for complaining about your problems, but it is a bit of an 
unmoderated mess. You'd be better off launching a Stack Overflow site made just 
for OSG.

Thank you!

Cheers,
Johny

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





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


Re: [osg-users] [vpb] Doubt regarding integrating shapefile with VPB

2017-02-17 Thread Sebastian Messerschmidt
Sorry I'm not at my computer right now, so cannot give your more guidance at this point.  I would try to check  where the osgSim::Shapeattribute data is generated/read. Can you give me the shapeset used?

Also: what is it that you're after? As I've pointed out: osgEarth already has the means to generate buildings from shapeset data.

Cheers
Sebastian
-- 
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 17.02.17, 12:19, Vinoth Rajendran  schrieb:

  
Hi Sebastian,

Will a possible solution be to traverse using NodeVistor, get the shapefile data and render myself ??


Thank you!

Cheers,
Vinoth R

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





___
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] [vpb] Doubt regarding integrating shapefile with VPB

2017-02-17 Thread Vinoth Rajendran
Hi Sebastian,

Will a possible solution be to traverse using NodeVistor, get the shapefile 
data and render myself ??


Thank you!

Cheers,
Vinoth R

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





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


Re: [osg-users] OSG on Universal Windows Platform

2017-02-17 Thread Alistair Baxter
ANGLE can definitely be made to work with OSG, we have shipped a Qt-based 
desktop Windows application that uses it. 

Good luck with the UWP effort!

-Original Message-
From: Lorenzo Valente

Yes, I am aware of the problem with OpenGL, thank you for pointing it out. I'm 
indeed using Angle and I still don't know if the GL part is going to work... 
I've to solve these compilation errors first

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


Re: [osg-users] [vpb] Doubt regarding integrating shapefile with VPB

2017-02-17 Thread Sebastian Messerschmidt
Hi, 

No it simply means you have to put some effort into this on your own. I've pointed you to a possible starting point. 

Cheers
Sebastian
-- 
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 17.02.17, 04:52, Vinoth Rajendran  schrieb:

  
Hi Sebastian,

Does it mean shapefile can't be rendered in my scenario ??

Thank you!

Cheers,
Vinoth

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





___
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] Vertex Buffer Object used inside display list

2017-02-17 Thread Robert Osfield
Hi Jannik,

I had to change the code to always assign a VertexBufferObject as I
couldn't find a way of implementing VAO without forcing changes to
client code, in order to make sure the OSG works on GLcore profile
implementations that require VAO all arrays have to have a
VertexBufferObject.

The observation that display lists are being used the VBO side shows a
bug, display lists and VBO shouldn't be invoked though, we'll need to
review osg::Geometry to make sure VBO's aren't used when display lists
are being generated..

Robert.

On 16 February 2017 at 21:14, Jannik Heller  wrote:
> Hi,
>
> I've noticed some odd API usage in the OSG that seems to have started with 
> the VAO support changes in OSG 3.5. Vertex buffer objects are being used 
> inside a display list. This happens on a standard Geometry with default 
> settings. Example:
>
> glNewList(6, GL_COMPILE)
> glGenBuffers(1, [5])
> glBindBuffer(GL_ARRAY_BUFFER, 5)
> glBufferData(...)
> glBufferSubData(...) x4
> glVertexPointer(3, GL_FLOAT, 0, NULL)
> glNormalPointer(GL_FLOAT, 0, 0x90)
> glColorPointer(4, GL_FLOAT, 0x180)
> glTexCoordPointer(2, GL_FLOAT, 0, 0x120)
> glDrawElements(...)
> glBindBuffer(GL_ARRAY_BUFFER, 0)
> glEndList()
>
> The source of this change in behavior is here: 
> https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/Geometry.cpp#L187
>  OSG will now always assign VBOs, even if they weren't requested.
>
> First off all I find this usage very odd. The GL standard doesn't actually 
> specify what is supposed to happen to VBOs in a display list - is the VBO 
> simply ignored or could that cause a new VBO to be created with every call to 
> the display list? Even if this works, the calls are completely redundant and 
> could be removed.
>
> More importantly, though, and the reason I'm bringing it up, is that this 
> usage seems to be causing a crash with some versions of Mesa drivers, and the 
> crash goes away when I disable display lists.
>
> Ubuntu 14.04 - Nvidia: works
> Ubuntu 14.04 - Intel HD: broken
> Ubuntu 16.04 - Intel HD: broken
>
> I've attached a minimal-ish apitrace you can use to see if your driver is 
> affected - run it with 'apitrace replay ' , if you get 'caught signal 
> 11' that means the driver has crashed.
>
> Cheers,
> Jannik
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70219#70219
>
>
>
>
> ___
> 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] OSG on Universal Windows Platform

2017-02-17 Thread Lorenzo Valente

Chris Hanson wrote:
> I was pretty sure UWP also prohibited the OpenGL API, which would mostly be a 
> deal-breaker unless you use ANGLE or something.


Yes, I am aware of the problem with OpenGL, thank you for pointing it out. I'm 
indeed using Angle and I still don't know if the GL part is going to work... 
I've to solve these compilation errors first

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





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