Re: [osg-users] Correct way to modify scene graph [SEC=UNCLASSIFIED]

2017-11-13 Thread Thamm, Russell
UNCLASSIFIED
Hi Paul,

Thanks for your response.

The viewer is single-threaded. Furthermore, I now make all modifications to the 
scene tree in the render thread (prerender) but I still get the occasional 
crash in the render thread:

C:\Program Files\Microsoft Visual Studio  9.0\VC\include\vector line 116

Expression("this->_Has_Container()", 0)

Unfortunately the error doesn't occur reliably enough to track down. It does 
seem to occur when I modify the scene tree.

Cheers
Russell


IMPORTANT: This email remains the property of the Department of Defence and is 
subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have 
received this email in error, you are requested to contact the sender and 
delete the email.
From: Paul Pocock [mailto:paul.ta...@internode.on.net]
Sent: Thursday, 9 November, 2017 2:50 p.m.
To: OpenSceneGraph Users; Thamm, Russell
Subject: Re: [osg-users] Correct way to modify scene graph [SEC=UNCLASSIFIED]


Hi Russell,

I suppose setting the threading model to SingleThreaded is not an option, maybe 
set Root Node to DYNAMIC variance? I can't remember the actual call.

good luck,

On 09/11/17 14:49, Thamm, Russell wrote:

UNCLASSIFIED
Hi

I am in the process of porting an MFC application from plib to osg.

Currently, if I want to actually modify the scene graph (adding, deleting nodes 
etc) while the render thread is running I do the following:

parentNode->setNodeMask(0);
modify scene graph below parent node
parentNode->setNodeMask(~0);

This seems to work but is there a better way?

Cheers
Russell












IMPORTANT: This email remains the property of the Department of Defence and is 
subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have 
received this email in error, you are requested to contact the sender and 
delete the email.




___

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] Access to gl context

2017-11-13 Thread Trajce Nikolov NICK
Hi guys,

here some snippet:

osgViewer::CompositeViewer::Windows wins;
viewer->getWindows(wins);

osgViewer::GraphicsHandleWin32 *hdl =
dynamic_cast(wins.at(0));
hdl->getWGLContext();

On Mon, Nov 13, 2017 at 1:45 PM, Christian Buchner <
christian.buch...@gmail.com> wrote:

>
> Is this the function you're looking for?
>
> osgViewer::GraphicsHandleWin32::getWGLContext
> ()
>
>
> I am having some trouble (despite the powers of Google) to find any OSG
> example code using getWGLContext()
>
> Christian
>
>
> 2017-11-10 14:33 GMT+01:00 Poojan Prabhu :
>
>> Hi,
>>
>> We are using shared context, but have custom drawables that use Vertex
>> Array Objects. This causes a problem in the case of multiple windows (where
>> each is a separate gl context).
>>
>> We can manage/create vaos depending on the gl context id that we are
>> currently rendering with.
>>
>> But, we can't use context id as reported by render info, because that
>> represents the shared context id and not the HGLRC
>>
>> Prefer to avoid wglGetCurrentContext in each draw call obviously. And we
>> _do_ want to use shared contexts.
>>
>> How can we work around this so that we have access to the HGLRC or an id
>> representing it?
>>
>> Thank you!
>>
>> Cheers,
>> Poojan
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=72358#72358
>>
>>
>>
>>
>>
>> ___
>> 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] New osgAnimation developments now merged with OSG master

2017-11-13 Thread Julien Valentin
Hi Raymond
I can't  think of a way to "combine" easily MDI and osgAnimation. 
The video you've seen was an old try using only GL3 TFfeedback  (as in Aqnuep 
forest demo.. It exibit same bottlenecks due to async reqs). 
If you want I'll make an other video to illustrate the the perf gap with MDI 
and GL4TFfeedback

My recent "MDI-animation-instancing-with-GPU-lod-Culling 
experiment" consists in baking loded Rigs versions and anims into classic 
Geometrys that I convert to lod MDIs geoms. 
Once converted to regular geoms you can do all GPU logic you want (culling, 
loding, ia)

If you think of a way to conserve Rigs as they are I would be glad to know

Cheers


reedev wrote:
> Hi Julien,
> 
> I expected this indeed, your combination of RigHWTrans and MDI. I have been 
> watching your movies. Is there a way that I/we  out a similar scenario? 
> Either here or a pm. I would be happy to try out more scenarios.
> 
> Cheers,
> Raymond
> 
> 
> Verstuurd vanaf mijn iPad
> 
> 
> > Op 12 nov. 2017 om 16:18 heeft Julien Valentin <> het volgende geschreven:
> > 
> > Hi,
> > The motivation behind this work was an annoying bug in RigHWTrans avoiding 
> > me to correctly control an animation baking pipeline for the purpose of MDI 
> > crowd rendering.
> > 
> > The main part of changes done have been done for code readability 
> > nevertheless a few features have been added:
> > 
> > Changelog:
> > -Rewriting of animation datapreparation and RigTransforms (have observed 
> > few perf enhancement for both loading and software animation)
> > Now RigTransform datapreparation occurs in 2 step :
> > *prepareData (dataprep when skeleton not known)
> > *operator() (dataprep when skeleton is known )
> > -Delegates animation data preparation to RigTransform instead of 
> > RigGeometry (and so remove the utility of Influence Set)
> > -add a MorphTargetHardware implementation (test required)
> > -add a bunch of utility functions to deal with VertexInfluenceMap  (test 
> > required)
> > -various cleanup and bug fixes 
> > 
> > Hope It's clear enough..:/
> > From a user point of view, nothing has change but new features should be 
> > heavily tested...
> > 
> > Cheers
> > 
> > 
> > reedev wrote:
> > 
> > > Hi Robert, Julien,
> > > 
> > > Fyi, I rebuilt master with VS2015 32 bit and all it (still) building 
> > > fine. Nathan is also rendering fine.
> > > 
> > > Julien, can you elaborate what has changed from a user's point of view 
> > > wrt your osganimation changes? What did you improve in particular and 
> > > what other/new possibilities did you introduce?
> > > 
> > > Cheers,
> > > Raymond
> > > 
> > > 
> > > 
> > > 
> > > > On 11/11/2017 4:45 PM, Robert Osfield wrote:
> > > > 
> > > > Hi All,
> > > > 
> > > > Today I merged the osganimation branch that Julien Valentin has been
> > > > working on.  If you have questions about the specifics of these
> > > > changes then I'll let Julien provide answers.
> > > > 
> > > > With any major set of changes being merged there is always the chance
> > > > of build errors on platform combinations that we haven't tested yet,
> > > > so if you see an issue let us know and we'll try and resolve it as
> > > > soon as we can.
> > > > 
> > > > There is also chances of build breaks in end user applications as
> > > > there are a few API changes to osgAnimation.  My hope that most users
> > > > won't find issues and it should be just a case of rebuilding your
> > > > application against master.
> > > > 
> > > > My plan is to tag the 3.5.8 developer release early next week, so
> > > > getting some testing of master across a range of platforms will help
> > > > with this.
> > > > 
> > > > Thanks for you help with testing, and thanks to Julien for his efforts
> > > > on improving osgAnimation.
> > > > Robert.
> > > > ___
> > > > osg-users mailing list
> > > > 
> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > 
> > > > ---
> > > > This email has been checked for viruses by AVG.
> > > > http://www.avg.com
> > > > 
> > > > 
> > > > 
> > > 
> > > ___
> > > osg-users mailing list
> > > 
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > 
> > > --
> > > Post generated by Mail2Forum
> > > 
> > 
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=72368#72368
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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






Re: [osg-users] Access to gl context

2017-11-13 Thread Christian Buchner
Is this the function you're looking for?

osgViewer::GraphicsHandleWin32::getWGLContext
()


I am having some trouble (despite the powers of Google) to find any OSG
example code using getWGLContext()

Christian


2017-11-10 14:33 GMT+01:00 Poojan Prabhu :

> Hi,
>
> We are using shared context, but have custom drawables that use Vertex
> Array Objects. This causes a problem in the case of multiple windows (where
> each is a separate gl context).
>
> We can manage/create vaos depending on the gl context id that we are
> currently rendering with.
>
> But, we can't use context id as reported by render info, because that
> represents the shared context id and not the HGLRC
>
> Prefer to avoid wglGetCurrentContext in each draw call obviously. And we
> _do_ want to use shared contexts.
>
> How can we work around this so that we have access to the HGLRC or an id
> representing it?
>
> Thank you!
>
> Cheers,
> Poojan
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72358#72358
>
>
>
>
>
> ___
> 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] Draw thread per opengl context instead of per GraphicsContext

2017-11-13 Thread Ben Meijering
Hi Robert,

Ah ok, so the GraphicsContext::Traits::sharedContext doesn't share the actual 
context, but allows object sharing between contexts. 
Thanks for clearing that up for me, I think this changes what I am looking for.

The reason that I am looking into this, is because of the following 
measurements.
In all tests, the screenspace view sizes and rendered objects are the same.

1. 6 views in one window (singlethreaded)   24.3 fps
2. 6 views in one window (multithreaded)46 fps

In these two tests, we have 1 context and 1 draw thread. 
Enabling multithreading almost doubles the performance.
So, performing culling on another thread proves to be very effective.

3. 6 views in separate windows (multithreaded) 
11.7 fps
4. 6 views in separate windows with context sharing (singlethreaded)22 fps

The last test cannot be done with multiple render threads, which makes sense.
But I think (please correct me if I'm wrong), multiple separate cull threads 
should have no effect on it's correct operation.
Looking at the performance difference between test 1 and 2, I am eager to see 
what culling on a different thread(s) would do here.

So my question changes to: for test 4, is it possible to still use separate 
cull threads while we only use 1 draw thread.
And if not, could you give us pointers on what should be taken into 
consideration if we want to implement this.

Thanks!

Cheers,

Ben

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





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


Re: [osg-users] Get RGB Values from Textrue

2017-11-13 Thread Sebastian Messerschmidt


Hi Maxim,


Hi,

I have a osg::Texture2D that I'm using as a render to texture target.
I can see that it is working on the screen, but I need to have access to the 
RGB values of the texture itself so I can also copy them to another API.

How can I access the RGB values?


set a postDrawCallback to the pass/camera that writes to the texture.


In the callback:

virtual void operator () (osg::RenderInfo& render_info) const
{
osg::State* state=render_info.getState();
state->apply(render_info.getCurrentCamera()->getStateSet());
state->applyTextureAttribute(0, mTexture);
mTexture->apply(*state);
	mImage->readImageFromCurrentTexture(render_info.getContextID(),true, 
GL_FLOAT ); //change the GL_FLOAT to your needs

}

the mTexture is passed to the callback using the original texture 
attached to the MRT.


Cheers
Sebastian






After rendering a frame, if I access _image in the texture2D class, it is null, 
but I do see that the Texture of texture2D has an array size of 1.
How and where are the RGB values stored?

Thank you!

Maxim


Thank you,
--Maxim

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





___
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] Get RGB Values from Texture

2017-11-13 Thread Tang And Miao

dieslower81 wrote:
> Hi,
> 
> I have a osg::Texture2D that I'm using as a render to texture target. 
> I can see that it is working on the screen, but I need to have access to the 
> RGB values of the texture itself so I can also copy them to another API. 
> 
> How can I access the RGB values?
> 
> After rendering a frame, if I access _image in the texture2D class, it is 
> null, but I do see that the Texture of texture2D has an array size of 1. 
> How and where are the RGB values stored?
> 
> Or do I need to get the RGB values not from the texture but from another 
> object that is used in the camera to texture pipeline?
> 
> Thank you!
> 
> Maxim


Hi~!
I met this problem before(can't read RGB from texture when using render to 
texture.),i don't know why Until now. But i can offer you another way . It's 
render to image.
Code like that:
camera->setRenderOrder(osg::Camera::PRE_RENDER);
 osg::Image* image = new osg::Image;
image->allocateImage(new_s, new_t, 1, GL_RGBA, GL_UNSIGNED_BYTE);
camera->attach(osg::Camera::COLOR_BUFFER, image,0, 0);
camera->setFinalDrawCallback(new MyCameraPostDrawCallback());
 Then you can write RGB into picture.If you still can't understand my 
meaning.You can read this file that i upload or osg Examples(osgprerender).
 Forgiving me for my english. I am chinese. This is my first reply.Hoping 
to help you.
 Good Luck.

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




Attachments: 
http://forum.openscenegraph.org//files/osg_exe_130.rar


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


[osg-users] osgDB::ImagePaged don't have "Paged" function?

2017-11-13 Thread Tang And Miao
Hi,

when i read osgDB::ImagePaged source code,although i found it  is similar with 
DatabasePager,but i can't find it delete picture that it is not used long time.
Thank you!

Cheers,
Tang

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





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


Re: [osg-users] Get RGB Values from Texture

2017-11-13 Thread Tang And Miao
Hi,

I met this problem before(can't read RGB from texture when using render to 
texture.),i don't know why Until now. But i can offer you another way . It's 
render to image.
Code like that:
camera->setRenderOrder(osg::Camera::PRE_RENDER);
 osg::Image* image = new osg::Image;
image->allocateImage(new_s, new_t, 1, GL_RGBA, GL_UNSIGNED_BYTE);
camera->attach(osg::Camera::COLOR_BUFFER, image,0, 0);
camera->setFinalDrawCallback(new MyCameraPostDrawCallback());
 Then you can write RGB into picture.If you still can't understand my 
meaning.You can read this file that i upload or osg Examples(osgprerender).
 Forgiving me for my english. I am chinese and i can't use this Forum 
expertly . This is my first reply.Hoping to help you.
 Good Luck.

Cheers,
Tang

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





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