[osg-users] ?????? Osing OpenXR in OSG

2019-06-24 Thread Garfield Pig
Hi David,
 There is only OpenVR integrated in osg,and It's not maintained anymore. 
[osgOpenVrViewer]??https://github.com/ChrisDenham/osgopenvrviewer) And It only 
supports osg single thread mode.




--  --
??: "David Glenn";
: 2019??6??25??(??) 6:08
??: "osg-users";

: [osg-users] Osing OpenXR in OSG



Greetings!

I guess that I'm going to gripe on this subject like I did a year ago!
I know that OpenXR is at least in Open Bata and I was wondering what progress 
anyone has made incorporating it in OSG. 

While I was in GDC I did see Khronos make some progress in this area and I even 
got to see someone do a demo of a VR display using HTC Vive. I challenged the 
group that worked on that and never heard from them again.

I think one of the holdbacks was the interactive controls was not set yet, but 
from my perspective, they could have worked at the visual. 

I know that if I had the time and resources that I would hack this out, but one 
of the sad drawbacks of having a job is not having the time. It must be that 
most people still see this technology as a flash in the pan, but I think it??s 
taking on traction.  


... 

Thank you!

David Glenn.


David Glenn
---
D Glenn 3D Computer Graphics Entertainment.
www.dglenn.com

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





___
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] Running multiple (independent) viewers in differentthreads

2019-05-24 Thread Garfield Pig
Hi Cully,
It seems like the problem that split window or frame buffer to different 
part.
There are two way to do this in osg.
1.add slave camera to osgViewer::view,each camera has different 
graphiccontext.
2.add osgViewer::view to osgViewer::compositeViewer,and one osgViewer::view 
correspond one camera,and has the same graphiccontext.


method 1 prefer the situation that each camera has different view or proj 
matrix but has same node tree.like Virtual Reality rendering,or cad design.
method 2 prefer each view(camera) has independent node tree.Like multi-doc edit 
in Word.


And the thread problem,I think you'd better do update in osg update thread,like 
add updateCallback to node.By this way,your thread will not have sync problem 
with osg render thread.


To be honest,I don't pretty understand your problem.
you'd better simplify your code to a problem example.


Qi Yu.
-- Original --
From: "Antoine Cully";
Date: Thu, May 23, 2019 00:49 AM
To: "osg-users";

Subject: [osg-users] Running multiple (independent) viewers in differentthreads



Dear OSG Community, 

I searched quite a lot through the source code and the beginner guide, but I 
was unable to find a way to make this work, so I am posting here hoping that 
you could help me. 

I am developing a tool to run physical simulations (of robots) in parallel. 
This tool is used to run stochastic optimisation (like deep reinforcement 
learning) algorithms, and for this I need to be able to run several, but fully 
independent, simulations in parallel thanks to multithreading. This enables to 
collect data faster and for instance with a 32-core multithreaded CPU the 
speed-up factor is quite significant. 

In each simulation, I have one camera that observes the environment, and which 
can be used to change the behaviour of the robot running in this simulation. 
The camera is currently implemented as a pbuffer following closely the 
osgscreencapture example. The actual code of the camera can be found on github, 
but apprently I am not allowed to post URLs at the moment. 
The multithreading is managed by TBB (an Intel library that I have been using 
for 6 years now). 

If I run my code in a "sequential mode", i.e., all the simulations running one 
after the other, everything is going well.  However, if I run it in parallel, 
then I have some unstable behaviours. For instance, I can have a segmentation 
fault happening after a random number of simulations or suddenly after again a 
random number of simulations, the pbuffer cannot be created anymore (OSG 
displays "Error: Unable to create pbuffer."). It seems to me that 
"::osg::ref_ptr<::osg::GraphicsContext> pbuffer =  
::osg::GraphicsContext::createGraphicsContext(traits.get()); "
does not work in this setup. 

If I remove the cameras (and all OSG components) from my code, it is working 
well in parallel, but of course I would like to have cameras in my simulations. 

Ideally, I would like to run OSG in a single-thread mode and let TBB distribute 
the different instances of the simulator and OSG in different threads, but even 
with 
"setThreadingModel(osgViewer::ViewerBase::ThreadingModel::SingleThreaded);" it 
does not work. 
I tried different threading modes, with the same result.

So here is my question: 
What would be the most appropriate way to run several independent viewers and 
pbuffers, each in a different thread? 
The rendered scenes are really simple (no texture, just several primitive 
shapes) and I am only rendering a couple of frames in each simulation, so I 
don't need a complex threading model for OSG. 


Some information about my system:
- Ubuntu 18.04
- OSG 3.6.4

Thank you in advance for your help. 

Best regards, 

Antoine

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





___
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] ?????? Is it possible to load texture without applying to adrawable

2019-05-09 Thread Garfield Pig
Hi Steve,
I meet the similar question yesterday,how about use osg::texture::apply method 
with a new state under a new GraphicContext.


this is the source of my idea.


In osg3.6.3 osgConv application.
osgConv.cpp line 152


void compress()
{
MyGraphicsContext context;
if (!context.valid())
{
osg::notify(osg::NOTICE)<<"Error: Unable to create graphis context, 
problem with running osgViewer-"< state = new osg::State;
state->initializeExtensionProcs();


for(TextureSet::iterator itr=_textureSet.begin();
itr!=_textureSet.end();
++itr)
{
osg::Texture* texture = const_cast(itr->get());


osg::Texture2D* texture2D = dynamic_cast(texture);
osg::Texture3D* texture3D = dynamic_cast(texture);


osg::ref_ptr image = texture2D ? texture2D->getImage() 
: (texture3D ? texture3D->getImage() : 0);
if (image.valid() &&
(image->getPixelFormat()==GL_RGB || 
image->getPixelFormat()==GL_RGBA) &&
(image->s()>=32 && image->t()>=32))
{
texture->setInternalFormatMode(_internalFormatMode);


// need to disable the unref after apply, otherwise the image 
could go out of scope.
bool unrefImageDataAfterApply = 
texture->getUnRefImageDataAfterApply();
texture->setUnRefImageDataAfterApply(false);


// get OpenGL driver to create texture from image.
texture->apply(*state);


// restore the original setting
texture->setUnRefImageDataAfterApply(unrefImageDataAfterApply);


image->readImageFromCurrentTexture(0,true);



texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT);
}
}
}





Thank you!


Cheers,
Qi Yu



--  --
??: "Steve Powers";
: 2019??5??9??(??) 11:33
??: "osg-users";

: [osg-users] Is it possible to load texture without applying to adrawable



I am attempting to load a Texture2D into memory in order to pass the texture ID 
to a 3rd party OpenGL object that will use the ID within it's own drawable 
class.


The issue is that the TextureObject attached to the texture is not getting 
instantiated and I think this is because it is not assigned to a drawable 
object and thus not getting visited.




Instead, I set the texture to a stateset on an osg::Group node 




stateset = group->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);




Is there a way to have this texture object instantiate without physically using 
the texture on a drawable?


Thank you!


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


Re: [osg-users] Looking for big datasets to properly challenge OSGand VSG, Please help :-)

2019-04-06 Thread Garfield Pig
Hi Robert,
 I has bought a 3dmax building scene about smart city from taobao several 
month ago,size 75GB.


BaiduNetDisk: ResourceDownloadSite
passcode: 5om0


I am in china,I'm not sure whether you can use baidu netdisk.


This link is valid for 7 days,because I guess I can't share it without 
limitation.


After all,its price is only $3.




Cherrs,
Qi Yu.


-- Original --
From:  "Robert Osfield";
Date:  Fri, Apr 5, 2019 07:05 PM
To:  "OpenSceneGraph Users";

Subject:  Re: [osg-users] Looking for big datasets to properly challenge OSGand 
VSG, Please help :-)



Hi Andrea,

On Fri, 5 Apr 2019 at 11:52, Andrea Martini  wrote:
> concerning your question about big dataset, at link :
>
> http://kos.informatik.uni-osnabrueck.de/3Dscans/
>
> at bullet 25, there is a file  wue_city.tar.xz of about 5GB got by SLAM 
> process.
>
> This data set contains 6 3D laser scans. Each scan has up to 22,500,000 
> points.
>
> I don't know what is the dataset size you are looking for, i supposed 5GB 
> could be enough (i hope).
>
> It is a ascii format, and it can be download freely.

Thanks for the link.

Performance with point clouds is principally and memory management,
either getting all the data local to the GPU if possible, if not
chunking the data into appropriate sizes for streaming the GPU.  5GB
would be a good stress test for managing data on the GPU.

Point cloud rendering is a special case of rendering so won't
challenge most of design and implementation of a scene graph so I'm
keen to find more conventional vis-sim, game and modelling/CAD
datasets as well.

Cheers,
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] Looking for big datasets to properly challenge OSGand VSG, Please help :-)

2019-04-06 Thread Garfield Pig
Hi Robert,
 I has bought a 3dmax building scene about smart city from taobao several 
month ago,size 75GB.


BaiduNetDisk: ResourceDownloadSite
passcode: 7h3h 


I am in china,I'm not sure whether you can use baidu netdisk.


Cherrs,
Qi Yu.


-- Original --
From:  "Robert Osfield";
Date:  Fri, Apr 5, 2019 07:05 PM
To:  "OpenSceneGraph Users";

Subject:  Re: [osg-users] Looking for big datasets to properly challenge OSGand 
VSG, Please help :-)



Hi Andrea,

On Fri, 5 Apr 2019 at 11:52, Andrea Martini  wrote:
> concerning your question about big dataset, at link :
>
> http://kos.informatik.uni-osnabrueck.de/3Dscans/
>
> at bullet 25, there is a file  wue_city.tar.xz of about 5GB got by SLAM 
> process.
>
> This data set contains 6 3D laser scans. Each scan has up to 22,500,000 
> points.
>
> I don't know what is the dataset size you are looking for, i supposed 5GB 
> could be enough (i hope).
>
> It is a ascii format, and it can be download freely.

Thanks for the link.

Performance with point clouds is principally and memory management,
either getting all the data local to the GPU if possible, if not
chunking the data into appropriate sizes for streaming the GPU.  5GB
would be a good stress test for managing data on the GPU.

Point cloud rendering is a special case of rendering so won't
challenge most of design and implementation of a scene graph so I'm
keen to find more conventional vis-sim, game and modelling/CAD
datasets as well.

Cheers,
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] pass mat4 as attribute for glsl

2018-11-26 Thread Garfield Pig
Hi Ye Cong:
 For instance rendering,You can see osgEarth::Drawinstance,they use uniform 
texture buffer instead of vertex attribute.
 If you insist on using VertexAttribute,I guess you may inherit the 
osg::Geometry,and rewrite DrawImplement method,create a GLExtension to do this.
 just like this:
   contextID = state.getContextID();
   osg::ref_ptr ext = osg::GLExtensions::Get(contextID, 
true);
   ext->glVertexAttribPointer(blabla);
   ext->glVertexAttribPointer(blabla);


Finally,you can use Matrix Array uniform ,but it's a stupid way I think.






-- Original --
From: "Cong Ye"; 
Date: 2018??11??27??(??) 12:58
To: "osg-users"; 
Subject: [osg-users] pass mat4 as attribute for glsl



Hi,

I am currently working on a project requires gpu instancing. I worked out a way 
to do the instancing with vec4 as position attribute in. However, in the real 
case, instances need to be scaled/rotated/translated. Now, I want to send the 
transform matrix as an attribute to the shader. Normally, general opengl uses 
glVertexAttribPointer with offset and glVertexAttribDivisor to sperate mat4 to 
vec4 then pass to the shader. However, I don't find the replacement function to 
do the offset data structure pass. Could someone enlighten me about it, please? 

thanks very much!

... 

Thank you!

Cheers,
Cong

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





___
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] Adding Constraints to Draggers

2018-10-25 Thread Garfield Pig
Hi Max??
   Robert is right,add constraint to dragger.
   You can find the constraint work on command in dispatch method  of class 
Dragger.
   As for the example,you can see the class GridConstraint inherited from class 
Contraint.
   Just add breakpoint,and follow the code,you can know how it work clearly. 


-- Original --
From:  "Max Power";
Date:  Fri, Oct 26, 2018 00:14 AM
To:  "osg-users";

Subject:  Re: [osg-users] Adding Constraints to Draggers



Hi Robert,

ah okay, I understand. Thank you for your fast reply.

I saw OpenSceneGraph/examples/osgmanipulator/osgmanipulator.cpp and I noticed, 
that it also uses the Constraint class. However, I don't quite understand it 
unfortunately. All constrain methods of the class are set to true here and I 
don't get why this was done. Okay, but then I will try to take a deeper look 
into the code.

But how is the situation currently? Are osgmanipulator and especially the 
dragger classes are still used today? Or do most people rather write everything 
from scratch instead of using osgmanipulator?

Thank you for your help! :)

Cheers,
Max

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





___
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