Re: [osg-users] Conan C++ dependency manager

2018-01-10 Thread Ben Chern
Hi,
Great to see integrate osg to conan.
Users could use osg from conan without having to rebuild it.
... 

Thank you!

Cheers,
Ben

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





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


Re: [osg-users] How to get Center Parameter of CameraManipulator

2018-01-10 Thread Ben Chern
Hi,

Why not use getHomePosition(), which is a member of CameraManipulator
... 

Thank you!

Cheers,
Ben

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





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


[osg-users] PIXEL_SIZE_ON_SCREEN And RangeList of osgb file

2018-01-10 Thread Mouming Ning
Hi,

my osgb's "head" is like this:

osg::PagedLOD {
  UniqueID 1 
  CenterMode USER_DEFINED_CENTER 
  UserCenter -1619.41 -187.445 1047.71 40.4089 
  RangeMode PIXEL_SIZE_ON_SCREEN 
  RangeList 2 {
0 1293.08 
1293.08 1e+030 
  }
  DatabasePath TRUE "D:\\Tile_050_050/" 
  RangeDataList 2 {
"" 
"Tile_050_050_L21_0.osgb" 
  }
  PriorityList 2 {
0 1 
0 1 
  }

My problem is that  how the rangelist correspond to the pixel size on screen?
such as the pixel size is 1300,then this osgb is display on the screen?but when 
the pixel size is 300,then what will happen?? or 2,what will happen??

Another question is that what's meaning of PriorityList?? What is it used for ??

Thank you!

Cheers,
Mouming

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





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


Re: [osg-users] Conan C++ dependency manager

2018-01-10 Thread Julien Valentin
@korner
I rethink of your idea to merge recipe into master but I think a dedicated repo 
for per release conan recipes would be best for package maintenance (one recipe 
involving multiple different arch packages, one per release allows the number 
of potential differents packages to be controllable).

Cheers 


kornerr wrote:
> Hi.
> May be introduce some sort of subdirectory (like
> osg_src/packaging/conan) into the main OSG source tree as a pull
> request?
> Having separate repository doesn't seem correct.
> 
> On 10 January 2018 at 02:13, Julien Valentin <> wrote:
> 
> > 
> > mp3butcher wrote:
> > 
> > > Hi all
> > > I made my first step with conan and for that i made a recipe for osg3.4.0
> > > https://github.com/mp3butcher/osg_conan_recipe
> > > I also upload this bintray but it require approval to be public
> > > 
> > > I doubt to understood everything but it could be a great multiplatform 
> > > tool to aggregate the scattered osg eco system.
> > > 
> > > Just a few look at my script gives you an idea of what can be done and 
> > > not...It doesn't solve all problems but can represent an homogenous 
> > > solution to adress lib dependencies in user space
> > > 
> > > Feel free to give feedback and improvements via github
> > > Cheers
> > > 
> > > 
> > > robertosfield wrote:
> > > 
> > > > Hi All,
> > > > 
> > > > Below is an "Issue" posted on the openscengraph github page from an
> > > > non OSG developer touting for us to integrate the OSG with the Conan
> > > > C++ depency manager.
> > > > 
> > > > Personally, I'm not familiar with Conan, I have no use for itself
> > > > myself, I guess it might be useful to some in the community.  I don't
> > > > have time to go chasing it up myself as I have way too much on my
> > > > plate already, so I'll defer to the community as to whether it's worth
> > > > pursuing and doing any legwork required.
> > > > 
> > > > As it's really not an "Issue" relating to the OSG but a sales pitch it
> > > > really isn't appropriate place to clog up out Issue list so I'll be
> > > > closing it, but thought it be better at least tell the community about
> > > > it before I do so.
> > > > 
> > > > If you are interested than please look into it and report back to us
> > > > about what steps would need to be taken add the OSG into Conan mix.
> > > > 
> > > > Cheers,
> > > > Robert.
> > > > 
> > > > --- https://github.com/openscenegraph/OpenSceneGraph/issues/395 --
> > > > 
> > > > Hello,
> > > > Do you know about Conan?
> > > > Conan is modern dependency manager for C++. And will be great if your
> > > > library will be available via package manager for other developers.
> > > > 
> > > > Here you can find example, how you can create package for the library.
> > > > 
> > > > If you have any questions, just ask :-)
> > > > --
> > > > ___
> > > > 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=72699#72699
> > 
> > 
> > 
> > 
> > 
> > ___
> > 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=72718#72718





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


Re: [osg-users] Conan C++ dependency manager

2018-01-10 Thread Chris Hanson
I think integrating Conan and OSG is a fantastic idea, and one I've wanted
to do but haven't had time in the past.

On Wed, Jan 10, 2018 at 8:50 AM, Julien Valentin  wrote:

> Hi korner
>
> as the repo title says it's just an experiment
> I shared it but there are problems..just try it if you have the time to
> experiment these.
> As an example problem :
> I passed the night wandering why it didn't copy all headers but haven't
> found why
>
> cheers
>
>
> kornerr wrote:
> > Hi.
> > May be introduce some sort of subdirectory (like
> > osg_src/packaging/conan) into the main OSG source tree as a pull
> > request?
> > Having separate repository doesn't seem correct.
> >
> > On 10 January 2018 at 02:13, Julien Valentin <> wrote:
> >
> > >
> > > mp3butcher wrote:
> > >
> > > > Hi all
> > > > I made my first step with conan and for that i made a recipe for
> osg3.4.0
> > > > https://github.com/mp3butcher/osg_conan_recipe
> > > > I also upload this bintray but it require approval to be public
> > > >
> > > > I doubt to understood everything but it could be a great
> multiplatform tool to aggregate the scattered osg eco system.
> > > >
> > > > Just a few look at my script gives you an idea of what can be done
> and not...It doesn't solve all problems but can represent an homogenous
> solution to adress lib dependencies in user space
> > > >
> > > > Feel free to give feedback and improvements via github
> > > > Cheers
> > > >
> > > >
> > > > robertosfield wrote:
> > > >
> > > > > Hi All,
> > > > >
> > > > > Below is an "Issue" posted on the openscengraph github page from an
> > > > > non OSG developer touting for us to integrate the OSG with the
> Conan
> > > > > C++ depency manager.
> > > > >
> > > > > Personally, I'm not familiar with Conan, I have no use for itself
> > > > > myself, I guess it might be useful to some in the community.  I
> don't
> > > > > have time to go chasing it up myself as I have way too much on my
> > > > > plate already, so I'll defer to the community as to whether it's
> worth
> > > > > pursuing and doing any legwork required.
> > > > >
> > > > > As it's really not an "Issue" relating to the OSG but a sales
> pitch it
> > > > > really isn't appropriate place to clog up out Issue list so I'll be
> > > > > closing it, but thought it be better at least tell the community
> about
> > > > > it before I do so.
> > > > >
> > > > > If you are interested than please look into it and report back to
> us
> > > > > about what steps would need to be taken add the OSG into Conan mix.
> > > > >
> > > > > Cheers,
> > > > > Robert.
> > > > >
> > > > > --- https://github.com/openscenegraph/OpenSceneGraph/issues/395 --
> > > > >
> > > > > Hello,
> > > > > Do you know about Conan?
> > > > > Conan is modern dependency manager for C++. And will be great if
> your
> > > > > library will be available via package manager for other developers.
> > > > >
> > > > > Here you can find example, how you can create package for the
> library.
> > > > >
> > > > > If you have any questions, just ask :-)
> > > > > --
> > > > > ___
> > > > > 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=72699#72699
> > >
> > >
> > >
> > >
> > >
> > > ___
> > > 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=72712#72712
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
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 • Forensics • Imaging • UAVs • 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


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Ravi Mathur
No worries, thank you for looking into it anyway. :)

To be honest, I don't think that "fixing" this behavior within OSG is worth
it. The code additions to ViewerBase::renderingTraversals() would be
duplicated from Renderer and SceneView, and would only benefit fringe cases
where the user wants NO_LIGHT with an explicitly disabled master camera.

I'm fine with the solution I outlined before (manually disabling
GL_LIGHTING on master camera). Plus as you said, most lighting management
should be done by the user anyway.

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


[osg-users] OpenThreads Doxygen documentation

2018-01-10 Thread Montgomery, David
The OpenSceneGraph 3.4.0 documentation will build (after adding 
EXTENSION_MAPPING = "no_extension=C++" to the doxyfile).

However, the OpenThreads documentation will not build even with that additional 
line.

Errors on Windows 7 include the following along with numerous additional ones 
of the same variety:

2>CUSTOMBUILD : error : Problems running dot: exit code=-1, command='dot', 
arguments='"C:/Sandbox/OpenSceneGraph-3.4.0/build/doc/OpenThreadsReferenceDocs/a00035.dot"
 -Tpng -o 
"C:/Sandbox/OpenSceneGraph-3.4.0/build/doc/OpenThreadsReferenceDocs/a00035.png"'

2>CUSTOMBUILD : error : problems opening map file 
C:/Sandbox/OpenSceneGraph-3.4.0/build/doc/OpenThreadsReferenceDocs/a00035.map 
for inclusion in the docs!

The necessary PNG and MAP files are not generated anywhere. Any thoughts on 
what the problem could be?




--

Notice: This e-mail is intended solely for use of the individual or entity to 
which it is addressed and may contain information that is proprietary, 
privileged and/or exempt from disclosure under applicable law. If the reader is 
not the intended recipient or agent responsible for delivering the message to 
the intended recipient, you are hereby notified that any dissemination, 
distribution or copying of this communication is strictly prohibited. This 
communication may also contain data subject to U.S. export laws. If so, data 
subject to the International Traffic in Arms Regulation cannot be disseminated, 
distributed, transferred, or copied, whether incorporated or in its original 
form, to foreign nationals residing in the U.S. or abroad, absent the express 
prior approval of the U.S. Department of State. Data subject to the Export 
Administration Act may not be disseminated, distributed, transferred or copied 
contrary to U. S. Department of Commerce regulations. If you have received this 
communication in error, please notify the sender by reply e-mail and destroy 
the e-mail message and any physical copies made of the communication.
 Thank you. 
*
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Robert Osfield
Hi Ravi,

Oh well.  I've removed the LightingMode changes, there is a little
clean up in there so I've merged this with master.

FYI, LightingMode is really just there for convince and backwards
compatibility back to the 1.0/2,0 days of the OSG.

These days I'd write lighting management all myself rather than
leverage these built-in defaults.

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


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Ravi Mathur

robertosfield wrote:
> Ops, don't send modifications without compiling them first...
> 
> The View::LightingMode and SceneView::LightingMode aren't compatible
> enum's so can't be passed as is.  I've spotted a better way of doing
> this update, putting into the Renderer::updateSceneView() method along
> with the setting of the fusion distance.
> 
> Could you test this one?
> 
> Robert.
> 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


Unfortunately your update to Renderer::updateSceneView() doesn't address the 
issue, nor would I expect it to. SceneView already gets the updated 
osg::View::LightingMode value inside SceneView::inheritCullSettings(), which is 
called inside Renderer::cull() (line 69, just a few lines down from the call to 
updateSceneView()).

The problem is that the Renderer is never run for the master camera since I 
disabled it using mastercamera->setGraphicsContext(NULL). So the SceneViews for 
the slaves, which use the master camera's StateSet as their _globalStateSet, 
still have lighting enabled.

I'm not saying this behavior is wrong per se, since I did explicitly disable 
the master camera. But if any change is to made to the OSG, it would have to be 
in ViewerBase::renderingTraversals() since that is where the master camera's 
Renderer::cull() method would normally be called.

Let me think of an appropriate minimal update to 
ViewerBase::renderingTraversals(). Basically it needs to first update the 
lighting modes for each disabled camera's StateSet before performing 
Renderer::cull() for each enabled camera.

Ravi

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





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


Re: [osg-users] Conan C++ dependency manager

2018-01-10 Thread Julien Valentin
Hi korner

as the repo title says it's just an experiment
I shared it but there are problems..just try it if you have the time to 
experiment these.
As an example problem :
I passed the night wandering why it didn't copy all headers but haven't found 
why

cheers


kornerr wrote:
> Hi.
> May be introduce some sort of subdirectory (like
> osg_src/packaging/conan) into the main OSG source tree as a pull
> request?
> Having separate repository doesn't seem correct.
> 
> On 10 January 2018 at 02:13, Julien Valentin <> wrote:
> 
> > 
> > mp3butcher wrote:
> > 
> > > Hi all
> > > I made my first step with conan and for that i made a recipe for osg3.4.0
> > > https://github.com/mp3butcher/osg_conan_recipe
> > > I also upload this bintray but it require approval to be public
> > > 
> > > I doubt to understood everything but it could be a great multiplatform 
> > > tool to aggregate the scattered osg eco system.
> > > 
> > > Just a few look at my script gives you an idea of what can be done and 
> > > not...It doesn't solve all problems but can represent an homogenous 
> > > solution to adress lib dependencies in user space
> > > 
> > > Feel free to give feedback and improvements via github
> > > Cheers
> > > 
> > > 
> > > robertosfield wrote:
> > > 
> > > > Hi All,
> > > > 
> > > > Below is an "Issue" posted on the openscengraph github page from an
> > > > non OSG developer touting for us to integrate the OSG with the Conan
> > > > C++ depency manager.
> > > > 
> > > > Personally, I'm not familiar with Conan, I have no use for itself
> > > > myself, I guess it might be useful to some in the community.  I don't
> > > > have time to go chasing it up myself as I have way too much on my
> > > > plate already, so I'll defer to the community as to whether it's worth
> > > > pursuing and doing any legwork required.
> > > > 
> > > > As it's really not an "Issue" relating to the OSG but a sales pitch it
> > > > really isn't appropriate place to clog up out Issue list so I'll be
> > > > closing it, but thought it be better at least tell the community about
> > > > it before I do so.
> > > > 
> > > > If you are interested than please look into it and report back to us
> > > > about what steps would need to be taken add the OSG into Conan mix.
> > > > 
> > > > Cheers,
> > > > Robert.
> > > > 
> > > > --- https://github.com/openscenegraph/OpenSceneGraph/issues/395 --
> > > > 
> > > > Hello,
> > > > Do you know about Conan?
> > > > Conan is modern dependency manager for C++. And will be great if your
> > > > library will be available via package manager for other developers.
> > > > 
> > > > Here you can find example, how you can create package for the library.
> > > > 
> > > > If you have any questions, just ask :-)
> > > > --
> > > > ___
> > > > 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=72699#72699
> > 
> > 
> > 
> > 
> > 
> > ___
> > 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=72712#72712





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


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Robert Osfield
Ops, don't send modifications without compiling them first...

The View::LightingMode and SceneView::LightingMode aren't compatible
enum's so can't be passed as is.  I've spotted a better way of doing
this update, putting into the Renderer::updateSceneView() method along
with the setting of the fusion distance.

Could you test this one?

Robert.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
 *
 * This library is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * OpenSceneGraph Public License for more details.
*/

#include 

#include 
#include 

#include 
#include 
#include 

#include 
#include 

#include 
#include 

#include 

#include 

using namespace osgViewer;

//#define DEBUG_MESSAGE OSG_NOTICE
#define DEBUG_MESSAGE OSG_DEBUG

OpenGLQuerySupport::OpenGLQuerySupport():
_extensions(0)
{
}

class OSGVIEWER_EXPORT EXTQuerySupport : public OpenGLQuerySupport
{
 public:
EXTQuerySupport();
void checkQuery(osg::Stats* stats, osg::State* state, osg::Timer_t startTick);
virtual void beginQuery(unsigned int frameNumber, osg::State* state);
virtual void endQuery(osg::State* state);
virtual void initialize(osg::State* state, osg::Timer_t startTick);
 protected:
GLuint createQueryObject();
typedef std::pair QueryFrameNumberPair;
typedef std::list QueryFrameNumberList;
typedef std::vector QueryList;

QueryFrameNumberList_queryFrameNumberList;
QueryList   _availableQueryObjects;
double  _previousQueryTime;
};


EXTQuerySupport::EXTQuerySupport():
_previousQueryTime(0.0)
{
}

void EXTQuerySupport::checkQuery(osg::Stats* stats, osg::State* /*state*/,
 osg::Timer_t startTick)
{
for(QueryFrameNumberList::iterator itr = _queryFrameNumberList.begin();
itr != _queryFrameNumberList.end();
)
{
GLuint query = itr->first;
GLint available = 0;
_extensions->glGetQueryObjectiv(query, GL_QUERY_RESULT_AVAILABLE, );
if (available)
{
GLuint64 timeElapsed = 0;
_extensions->glGetQueryObjectui64v(query, GL_QUERY_RESULT, );

double timeElapsedSeconds = double(timeElapsed)*1e-9;
double currentTime = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick());
double estimatedEndTime = (_previousQueryTime + currentTime) * 0.5;
double estimatedBeginTime = estimatedEndTime - timeElapsedSeconds;

stats->setAttribute(itr->second, "GPU draw begin time", estimatedBeginTime);
stats->setAttribute(itr->second, "GPU draw end time", estimatedEndTime);
stats->setAttribute(itr->second, "GPU draw time taken", timeElapsedSeconds);


itr = _queryFrameNumberList.erase(itr);
_availableQueryObjects.push_back(query);
}
else
{
++itr;
}

}
_previousQueryTime = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick());
}

GLuint EXTQuerySupport::createQueryObject()
{
if (_availableQueryObjects.empty())
{
GLuint query;
_extensions->glGenQueries(1, );
return query;
}
else
{
GLuint query = _availableQueryObjects.back();
_availableQueryObjects.pop_back();
return query;
}
}

void EXTQuerySupport::beginQuery(unsigned int frameNumber, osg::State* /*state*/)
{
GLuint query = createQueryObject();
_extensions->glBeginQuery(GL_TIME_ELAPSED, query);
_queryFrameNumberList.push_back(QueryFrameNumberPair(query, frameNumber));
}

void EXTQuerySupport::endQuery(osg::State* /*state*/)
{
_extensions->glEndQuery(GL_TIME_ELAPSED);
}

void OpenGLQuerySupport::initialize(osg::State* state, osg::Timer_t /*startTick*/)
{
_extensions = state->get();
}

void EXTQuerySupport::initialize(osg::State* state, osg::Timer_t startTick)
{
OpenGLQuerySupport::initialize(state, startTick);
_previousQueryTime = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick());

}

class ARBQuerySupport : public OpenGLQuerySupport
{
public:
virtual void checkQuery(osg::Stats* stats, osg::State* state,
osg::Timer_t startTick);

virtual void beginQuery(unsigned int frameNumber, osg::State* state);
virtual void endQuery(osg::State* state);
virtual void initialize(osg::State* state, osg::Timer_t startTick);
protected:
typedef 

Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Robert Osfield
HI Ravi,

On 10 January 2018 at 14:53, Ravi Mathur  wrote:
> I just checked, and the same behavior & solution exists on master.

Looking at the internal setup of the rendering backend I think the
reason for the behavior is that the Renderer implement found in
OpenSceneGraph/src/osgViewer/Renderer.cpp constructor reads the View's
LightingMode and then passes this on to the SceneView's it setups to
do the rendering.  This setup happens when you add the slave cameras.

I think the problem comes in that the osg::View::LightingMode value
isn't passed onto the SceneView's by the Renderer's.

Attached is a modification of src/osgViewer/Renderer.cpp that passes
the View::LightingMode value to the SceneView on each new cull
traversal.

Could you try this out to see if it works, if so I'll check it in.

Robert.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
 *
 * This library is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * OpenSceneGraph Public License for more details.
*/

#include 

#include 
#include 

#include 
#include 
#include 

#include 
#include 

#include 
#include 

#include 

#include 

using namespace osgViewer;

//#define DEBUG_MESSAGE OSG_NOTICE
#define DEBUG_MESSAGE OSG_DEBUG

OpenGLQuerySupport::OpenGLQuerySupport():
_extensions(0)
{
}

class OSGVIEWER_EXPORT EXTQuerySupport : public OpenGLQuerySupport
{
 public:
EXTQuerySupport();
void checkQuery(osg::Stats* stats, osg::State* state, osg::Timer_t startTick);
virtual void beginQuery(unsigned int frameNumber, osg::State* state);
virtual void endQuery(osg::State* state);
virtual void initialize(osg::State* state, osg::Timer_t startTick);
 protected:
GLuint createQueryObject();
typedef std::pair QueryFrameNumberPair;
typedef std::list QueryFrameNumberList;
typedef std::vector QueryList;

QueryFrameNumberList_queryFrameNumberList;
QueryList   _availableQueryObjects;
double  _previousQueryTime;
};


EXTQuerySupport::EXTQuerySupport():
_previousQueryTime(0.0)
{
}

void EXTQuerySupport::checkQuery(osg::Stats* stats, osg::State* /*state*/,
 osg::Timer_t startTick)
{
for(QueryFrameNumberList::iterator itr = _queryFrameNumberList.begin();
itr != _queryFrameNumberList.end();
)
{
GLuint query = itr->first;
GLint available = 0;
_extensions->glGetQueryObjectiv(query, GL_QUERY_RESULT_AVAILABLE, );
if (available)
{
GLuint64 timeElapsed = 0;
_extensions->glGetQueryObjectui64v(query, GL_QUERY_RESULT, );

double timeElapsedSeconds = double(timeElapsed)*1e-9;
double currentTime = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick());
double estimatedEndTime = (_previousQueryTime + currentTime) * 0.5;
double estimatedBeginTime = estimatedEndTime - timeElapsedSeconds;

stats->setAttribute(itr->second, "GPU draw begin time", estimatedBeginTime);
stats->setAttribute(itr->second, "GPU draw end time", estimatedEndTime);
stats->setAttribute(itr->second, "GPU draw time taken", timeElapsedSeconds);


itr = _queryFrameNumberList.erase(itr);
_availableQueryObjects.push_back(query);
}
else
{
++itr;
}

}
_previousQueryTime = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick());
}

GLuint EXTQuerySupport::createQueryObject()
{
if (_availableQueryObjects.empty())
{
GLuint query;
_extensions->glGenQueries(1, );
return query;
}
else
{
GLuint query = _availableQueryObjects.back();
_availableQueryObjects.pop_back();
return query;
}
}

void EXTQuerySupport::beginQuery(unsigned int frameNumber, osg::State* /*state*/)
{
GLuint query = createQueryObject();
_extensions->glBeginQuery(GL_TIME_ELAPSED, query);
_queryFrameNumberList.push_back(QueryFrameNumberPair(query, frameNumber));
}

void EXTQuerySupport::endQuery(osg::State* /*state*/)
{
_extensions->glEndQuery(GL_TIME_ELAPSED);
}

void OpenGLQuerySupport::initialize(osg::State* state, osg::Timer_t /*startTick*/)
{
_extensions = state->get();
}

void EXTQuerySupport::initialize(osg::State* state, osg::Timer_t startTick)
{
OpenGLQuerySupport::initialize(state, startTick);

Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Ravi Mathur

ravidavi wrote:
> 
> robertosfield wrote:
> > HI Ravi,
> > 
> > I haven't yet looked deeply into the issue as I'm still in post
> > holiday catch up mode.  What version of the OSG are you using?
> > 
> > Robert.
> > 
> 
> 
> I'm on the OpenSceneGraph-3.5.6 tag.


I just checked, and the same behavior & solution exists on master.

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





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


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Ravi Mathur

robertosfield wrote:
> HI Ravi,
> 
> I haven't yet looked deeply into the issue as I'm still in post
> holiday catch up mode.  What version of the OSG are you using?
> 
> Robert.
> 


I'm on the OpenSceneGraph-3.5.6 tag.

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





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


Re: [osg-users] Free camera manipulator

2018-01-10 Thread Kazim Kamilov
Okay. Thank you!

Cheers,
Kazim

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





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


Re: [osg-users] [vpb] support for WildCard

2018-01-10 Thread Saket Chawla
Thanks Robert.

--
Thank You,
Saket

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





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


Re: [osg-users] Conan C++ dependency manager

2018-01-10 Thread michael kapelko
Hi.
May be introduce some sort of subdirectory (like
osg_src/packaging/conan) into the main OSG source tree as a pull
request?
Having separate repository doesn't seem correct.

On 10 January 2018 at 02:13, Julien Valentin  wrote:
>
> mp3butcher wrote:
>> Hi all
>> I made my first step with conan and for that i made a recipe for osg3.4.0
>> https://github.com/mp3butcher/osg_conan_recipe
>> I also upload this bintray but it require approval to be public
>>
>> I doubt to understood everything but it could be a great multiplatform tool 
>> to aggregate the scattered osg eco system.
>>
>> Just a few look at my script gives you an idea of what can be done and 
>> not...It doesn't solve all problems but can represent an homogenous solution 
>> to adress lib dependencies in user space
>>
>> Feel free to give feedback and improvements via github
>> Cheers
>>
>>
>> robertosfield wrote:
>> > Hi All,
>> >
>> > Below is an "Issue" posted on the openscengraph github page from an
>> > non OSG developer touting for us to integrate the OSG with the Conan
>> > C++ depency manager.
>> >
>> > Personally, I'm not familiar with Conan, I have no use for itself
>> > myself, I guess it might be useful to some in the community.  I don't
>> > have time to go chasing it up myself as I have way too much on my
>> > plate already, so I'll defer to the community as to whether it's worth
>> > pursuing and doing any legwork required.
>> >
>> > As it's really not an "Issue" relating to the OSG but a sales pitch it
>> > really isn't appropriate place to clog up out Issue list so I'll be
>> > closing it, but thought it be better at least tell the community about
>> > it before I do so.
>> >
>> > If you are interested than please look into it and report back to us
>> > about what steps would need to be taken add the OSG into Conan mix.
>> >
>> > Cheers,
>> > Robert.
>> >
>> > --- https://github.com/openscenegraph/OpenSceneGraph/issues/395 --
>> >
>> > Hello,
>> > Do you know about Conan?
>> > Conan is modern dependency manager for C++. And will be great if your
>> > library will be available via package manager for other developers.
>> >
>> > Here you can find example, how you can create package for the library.
>> >
>> > If you have any questions, just ask :-)
>> > --
>> > ___
>> > 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=72699#72699
>
>
>
>
>
> ___
> 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] support for WildCard

2018-01-10 Thread Robert Osfield
Hi Saket,

It's the OS's command line parser that it expanding the wild card,
this will expand the command line with a list of files, only the first
of which will be prefixed by a -d.

I don't know of other help tools that might provide the functionality
you are after.  osgdem is just a small application on top of the vpb
library that does all the real work so you could just write you own
equivilant to osgdem and have your own custom parsing.

Robert.

On 10 January 2018 at 10:28, Saket Chawla  wrote:
> Hi,
>
> During my initial understanding for the command line arguments, I observed 
> that wildcard do not work in path for terrain [-d] or texture [-t] files.
> i.e. such arguments do not work -d  /path/*N15*.tiff
>
> If i use wildcard, only the first file in listing is taken up.
>
> Can someone suggest an alternate method to use for passing only a subset of 
> files from the directory which contains a large number of files?
>
> ...
>
> Thank you,
> Saket
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72702#72702
>
>
>
>
>
> ___
> 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] [vpb] support for WildCard

2018-01-10 Thread Saket Chawla
Hi,

During my initial understanding for the command line arguments, I observed that 
wildcard do not work in path for terrain [-d] or texture [-t] files.
i.e. such arguments do not work -d  /path/*N15*.tiff 

If i use wildcard, only the first file in listing is taken up.

Can someone suggest an alternate method to use for passing only a subset of 
files from the directory which contains a large number of files?

... 

Thank you,
Saket

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





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


Re: [osg-users] Slave camera lighting with disabled main camera

2018-01-10 Thread Robert Osfield
HI Ravi,

> If Robert or any of the other experienced folks on here think that I'm 
> mistaken on this, or have other more elegant solutions, please let me know. 
> Otherwise I'll consider the matter closed.

I haven't yet looked deeply into the issue as I'm still in post
holiday catch up mode.  What version of the OSG are you using?

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