Re: [osg-users] Stats not showing after changing camera manipulator, what would be the cause?

2016-03-30 Thread Alexandre Vaillancourt
Apparently, the issue was linked to the fact that the View containing the
camera for the mirror were not added as children of the main
CompositeViewer that we use.

I'm not sure why it's like that as I don't know enough of the relations
that are between the StatsHandler and everything else, but it seems to have
fixed the issue.

Thanks for reading :)


--
Alexandre Vaillancourt

2016-03-30 10:42 GMT-04:00 Alexandre Vaillancourt <
alexandre.vaillancourt.l...@gmail.com>:

>
>
>> There isn't too much others can help with because the problem is likely
>> very specific to the things you've done.  The best we can do is make
>> general suggestions and things to try.  The finding that mirrors have an
>> effect is hint that either the mirrors are overdrawing the stats or leaking
>> OpenGL state in a way that is causing problems with the rendering of the
>> stats.  It could be other issues, but these are my best guess based on
>> small amount of info.
>>
>> Robert.
>>
>>
>
> Yeah the system is quite complex, not knowing where to look at myself does
> not help get help hehe!
>
> I'll keep digging!
>
> Thanks for your input!
>
> --
> Alexandre Vaillancourt
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Get all vertices of an OSG Group

2016-03-30 Thread Sebastian Messerschmidt


Hi Clement,

I checked what you suggested but I don't really understand how I can retrieve 
the respective colors of each points I am looking for.

Do you have any idea how it can be done ?
You need to extend your visitor to capture the StateSet active for your 
drawable. You need to add a osg::Node apply function which 
merges/unmerges the current state until you reach your drawable. Then 
check for the osg::Material StateAttribute of your accumulated state and 
retrieve the diffuse or whatever color your are after (there is some 
getAttribute function on the StateSet)
Take a look at the obj-exporter, it basically does the accumulation and 
material retrieval. In case you have no vertex-colors simply use the 
state-colors or fallback to some default.


Hope that helps
Sebastian


...

Thank you!

Cheers,
Clement

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





___
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] VR headset integration

2016-03-30 Thread Björn Blissing
Hi Christian,


I have started working with the integration of the Oculus 1.3 SDK, but haven't 
finished quite yet. Mostly because due to lack of time.

Hopefully I will get some spare time and be able to complete the work during 
the week.


Best regards

Björn



Från: osg-users  för Christian 
Buchner 
Skickat: den 30 mars 2016 15:19
Till: OpenSceneGraph Users
Ämne: [osg-users] VR headset integration

Hi,

I just wanted to ask around rather generally, how OSG integration with various 
VR SDKs is coming along.

Can osgoculus be built against the recently released SDK version 1.3 at this 
time?

Is anyone working on a HTC Vive (OpenVR) or OSVR ( 
http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?

Christian

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


Re: [osg-users] Get all vertices of an OSG Group

2016-03-30 Thread Clement Begotto
I checked what you suggested but I don't really understand how I can retrieve 
the respective colors of each points I am looking for.

Do you have any idea how it can be done ?

... 

Thank you!

Cheers,
Clement

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





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


Re: [osg-users] draw callbacks

2016-03-30 Thread Peter Bako
Hi,

I tried Javier's example, but I don't know how to modify the code, so that the 
stencil plane covers the "holes" on the clipped geometry.
In this case the plane is renedered over the whole scene. 
I tried to remove the transformation and projection, then the plane was 
rendered on the correct position but it was still a square.

I know, how should it work, but I cannot find a solution..
How should I change it? can you help me?
Thank you!


Code:


#include 
#include 
#include 
#include 

class CappingTechnique : public osgFX::Technique {

private:
osg::ref_ptr _capPlane;

public:
virtual bool validate(osg::State&) const
{ return true; }

META_Technique("CappingTechnique","Pimpel capping technique");
/// Constructor
CappingTechnique()
{
// Build the plane to draw with the stencil mask
osg::Geometry *geometry = new osg::Geometry();
osg::Vec3Array *vertices = new osg::Vec3Array();
osg::Vec4Array *colors = new osg::Vec4Array();

vertices->push_back(osg::Vec3(-1.0, -1.0, 0.0));
vertices->push_back(osg::Vec3(-1.0, 1.0, 0.0));
vertices->push_back(osg::Vec3(1.0, 1.0, 0.0));
vertices->push_back(osg::Vec3(1.0, -1.0, 0.0));
geometry->setVertexArray(vertices);
colors->push_back(osg::Vec4(1.0, 0.0, 1.0, 1.0));
geometry->setColorArray(colors);
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
geometry->addPrimitiveSet(new
osg::DrawArrays(osg::PrimitiveSet::QUADS, 0, 4));

osg::Geode *geode = new osg::Geode();
geode->addDrawable(geometry);

osg::Transform *trans = new osg::Transform();
trans->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
trans->addChild( geode );

osg::Projection *proj = new
osg::Projection(osg::Matrix::ortho2D(-1,1,-1,1));
proj->addChild( trans );

_capPlane = proj;

}
protected:
virtual void define_passes()
{
// pass #0
{
osg::ref_ptr ss = new osg::StateSet;
osg::Stencil *stencil = new osg::Stencil;
stencil->setFunction(osg::Stencil::ALWAYS, 0x0, ~0);
stencil->setOperation(osg::Stencil::INVERT, 
osg::Stencil::INVERT, osg::Stencil::INVERT);
ss->setAttributeAndModes(stencil, 
osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE);
ss->setMode(GL_CULL_FACE,osg::StateAttribute::OFF);
addPass(ss.get());
}
// pass #1
{
osg::ref_ptr ss = new osg::StateSet;
osg::Stencil *stencil = new osg::Stencil;
stencil->setFunction(osg::Stencil::NOTEQUAL, 0x0, ~0);
stencil->setOperation(osg::Stencil::ZERO, 
osg::Stencil::ZERO,osg::Stencil::ZERO);
ss->setAttributeAndModes(stencil, 
osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE);
osg::Depth *depth = new osg::Depth();
depth->setWriteMask(false);
ss->setAttributeAndModes( depth, 
osg::StateAttribute::ON );
addPass(ss.get());
}
}

virtual osg::Node *getOverrideChild(int pass){
switch(pass) {
case 1:// Second pass (pass #1) draws the cap plane
return _capPlane;
break;
default:
return NULL;
break;
}
}
};

class CappingEffect : public osgFX::Effect {
public:
CappingEffect() : osgFX::Effect() {}
CappingEffect( const CappingEffect& copy, const osg::CopyOp 
op=osg::CopyOp::SHALLOW_COPY )
:   osgFX::Effect(copy, op) {}

META_Effect( osgFX, CappingEffect, "CappingEffect", "", "" );
protected:
virtual bool define_techniques(){
CappingTechnique* technique = new CappingTechnique();
addTechnique(technique);
return true;
}
};

int main( int argc, char** argv )
{
//load any node
osg::ref_ptr scene = new osg::Geode;
scene->addDrawable( new TeapotDrawable(1.0f) );

osg::ClipNode* clipnode = new osg::ClipNode; 
osg::ref_ptr clipplane = new osg::ClipPlane(); 
clipplane->setClipPlane(0, 0, -1, 0); 

clipnode->addClipPlane(clipplane); 
clipnode->addChild(scene.get()); 

CappingEffect* capping_effect = new CappingEffect(); 
  

Re: [osg-users] Stats not showing after changing camera manipulator, what would be the cause?

2016-03-30 Thread Alexandre Vaillancourt
>
> There isn't too much others can help with because the problem is likely
> very specific to the things you've done.  The best we can do is make
> general suggestions and things to try.  The finding that mirrors have an
> effect is hint that either the mirrors are overdrawing the stats or leaking
> OpenGL state in a way that is causing problems with the rendering of the
> stats.  It could be other issues, but these are my best guess based on
> small amount of info.
>
> Robert.
>
>

Yeah the system is quite complex, not knowing where to look at myself does
not help get help hehe!

I'll keep digging!

Thanks for your input!

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


Re: [osg-users] VR headset integration

2016-03-30 Thread Christian Buchner
There appears to be ongoing integration work for OpenVR (SteamVR) here:

https://github.com/ChrisDenham/osgopenvrviewer

Christian


2016-03-30 16:14 GMT+02:00 Chris Hanson :

> On Wed, Mar 30, 2016 at 7:19 AM, Christian Buchner <
> christian.buch...@gmail.com> wrote:
>
>> Hi,
>> I just wanted to ask around rather generally, how OSG integration with
>> various VR SDKs is coming along.
>>
> Can osgoculus be built against the recently released SDK version 1.3 at
>> this time?
>>
>
>   I haven't tried it with the 1.3 SDK. I had it working with OSG and
> osgEarth with an earlier SDK (might have been .8) at I/ITSEC back in
> December.
>
>   If you want somebody to make it work with the 1.3 SDK, I can probably do
> that work for you.
>
>
>> Is anyone working on a HTC Vive (OpenVR) or OSVR (
>> http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?
>>
>
>   I'm not, but it shouldn't be hard to do either/both. The base for
> supporting them has already been done and tested for Oculus so it'd just be
> a matter of connecting up to a different API that does roughly the same
> thing, so I wouldn't think it would be tough.
>
>
>> Christian
>>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel  facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> 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 to collada

2016-03-30 Thread Chris Hanson
Yeah, I had a client that did this (in reverse).

You don't really need it statically linked unless you want an EXE that has
no dependent DLLs. My client just used a build of OSG that was made with
the COLLADA plugin, and OSGconv's DAE models into OSGB. Another client of
mine did use the OSG COLLADA plugin for saving successfully, but they did
it from within their full app, not just using osgconv.

So, it should work either way.

Building OSG with COLLADA can be an exercise in frustration due to the
difficulty of building a specific version of COLLADA-DOM from source, and
the fact that only certain versions of the same library are available
pre-built. But it can be done.
​
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VR headset integration

2016-03-30 Thread Chris Hanson
On Wed, Mar 30, 2016 at 7:19 AM, Christian Buchner <
christian.buch...@gmail.com> wrote:

> Hi,
> I just wanted to ask around rather generally, how OSG integration with
> various VR SDKs is coming along.
>
Can osgoculus be built against the recently released SDK version 1.3 at
> this time?
>

  I haven't tried it with the 1.3 SDK. I had it working with OSG and
osgEarth with an earlier SDK (might have been .8) at I/ITSEC back in
December.

  If you want somebody to make it work with the 1.3 SDK, I can probably do
that work for you.


> Is anyone working on a HTC Vive (OpenVR) or OSVR (
> http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?
>

  I'm not, but it shouldn't be hard to do either/both. The base for
supporting them has already been done and tested for Oculus so it'd just be
a matter of connecting up to a different API that does roughly the same
thing, so I wouldn't think it would be tough.


> Christian
>

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] VR headset integration

2016-03-30 Thread Christian Buchner
Hi,

I just wanted to ask around rather generally, how OSG integration with
various VR SDKs is coming along.

Can osgoculus be built against the recently released SDK version 1.3 at
this time?

Is anyone working on a HTC Vive (OpenVR) or OSVR (
http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?

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


Re: [osg-users] osg to collada

2016-03-30 Thread Christian Buchner
A statically linked osgconv binary with the required DAE and OSG2 plug-ins
activated should do the trick. See the osgstaticviewer example for the
required preprocessor macros to activate statically linked plug-ins.

Christian



2016-03-30 9:41 GMT+02:00 Joe Kindle :

> Hey :)
> I'm looking for a simple way to convert osgb file to .dae file, in a
> computer that which doesn't have osg environment installed.
> In other words, I want to build an .exe file that gets .osgb file and
> converts it to .dae file
> Thanks!:)
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=7#7
>
>
>
>
>
> ___
> 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] osg to collada

2016-03-30 Thread Joe Kindle
Hey :)
I'm looking for a simple way to convert osgb file to .dae file, in a computer 
that which doesn't have osg environment installed.
In other words, I want to build an .exe file that gets .osgb file and converts 
it to .dae file
Thanks!:)

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





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


Re: [osg-users] viewport is changing after huge sized object ; updating only visible nodes

2016-03-30 Thread Mathias Fröhlich
Hi,

On Wednesday, March 30, 2016 08:19:31 Robert Osfield wrote:
> On 30 March 2016 at 08:14, Andrey Perper  wrote:
> 
> > >I guess he wants to have the updateCallback called for "culled" geodes,
> > or some way to check if the node was culled.

For a similar problem, I also had subclassed the standard update visitor
to walk only these parts that are sufficiently close to the camera
and really deserve an update. The node visitor already contains a lot of
functionality to make this work somehow easily. Not perfect either, but
worked there.

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


Re: [osg-users] viewport is changing after huge sized object ; updating only visible nodes

2016-03-30 Thread Robert Osfield
On 30 March 2016 at 08:14, Andrey Perper  wrote:

> >I guess he wants to have the updateCallback called for "culled" geodes,
> or some way to check if the node was culled.
>
> Yes!! that is correct!
>

The OSG by default calls update callbacks on all nodes that have an update
callback, so works fine for culled and non culled nodes/drawables/statesets.

If you want to just do updates on objects that aren't culled and in the
view frustum then you'll be best using a cull callback, but would need to
take care if your application is multi-threaded as multiple threads could
end up reading/writing to the shared data structures.


>
> > I know too little about the specifics of your application.
> The Application has earth + missile tracks on earth.
> I just add these tracks to scene and my viewer must stay at point before
> adding. Camera rotating is performed around earth center
>

There is the osgGA::NodeTrackerManipulator, see the osgsimulation example -
it tracks an oversized cessna model as it tracks around the eath.

I suspect this camera manipualator isn't exactly what you'll need so will
need to consider writing your own camera manipulator to simple computing
the view matrix in the main loop and applying this to the viewer's master
Camera's view matrix each frame. If you do the later then there isn't any
need for camera manipulator.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stats not showing after changing camera manipulator, what would be the cause?

2016-03-30 Thread Robert Osfield
On 29 March 2016 at 21:50, Alexandre Vaillancourt <
alexandre.vaillancourt.l...@gmail.com> wrote:

> It seems related to how we do our mirrors: it works well when there are no
> mirrors, but when we start the software with the mirrors, the issue
> happens. I'll keep on digging...
>

There isn't too much others can help with because the problem is likely
very specific to the things you've done.  The best we can do is make
general suggestions and things to try.  The finding that mirrors have an
effect is hint that either the mirrors are overdrawing the stats or leaking
OpenGL state in a way that is causing problems with the rendering of the
stats.  It could be other issues, but these are my best guess based on
small amount of info.

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


Re: [osg-users] viewport is changing after huge sized object ; updating only visible nodes

2016-03-30 Thread Andrey Perper
>I guess he wants to have the updateCallback called for "culled" geodes, or 
>some way to check if the node was culled. 

Yes!! that is correct!


> I know too little about the specifics of your application. 
The Application has earth + missile tracks on earth.
I just add these tracks to scene and my viewer must stay at point before 
adding. Camera rotating is performed around earth center

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





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