Re: [osg-users] osg-users Digest, Vol 55, Issue 12

2012-01-10 Thread Robert Osfield
Hi Terry,

On 9 January 2012 18:35, Terry Welsh  wrote:
> Ideally, I would like to have total control over the paths to search
> just using environment variables, but I don't see a way to do this.
> Are there any ways to control the plugin search paths other than with
> setLibraryFilePathList() and OSG_LIBRARY_PATH?  Would it be alright to
> modify or amend the way OSG searches plugin paths?  Maybe we can come
> up with something more flexible.

Something like the FindFileCallback found in include/osgDB/Callbacks?
You can assign a FindFileCallback to osgDB::Options or the Registry.

class OSGDB_EXPORT FindFileCallback : public virtual osg::Referenced
{
public:

virtual std::string findDataFile(const std::string& filename,
const Options* options, CaseSensitivity caseSensitivity);

virtual std::string findLibraryFile(const std::string&
filename, const Options* options, CaseSensitivity caseSensitivity);

protected:
virtual ~FindFileCallback() {}
};

I don't recall using it in conjunction with loading libraries but as
there is the findLibraryFile method I guess I must have thought about
it!  Below is my svn entry from 2009 for include/osgDB/Options.


-- svn entry for include/osgDB/Options:

r10171 | robert | 2009-05-09 09:49:27 +0100 (Sat, 09 May 2009) | 8 lines

Refactored the Registry::ReadFileCallback, WriteFileCallback and
ReaderWriter::Options to they are now defined in their own header and
in the osgDB namespace.

Introduced a new FindFileCallback to Registry to compliement the
existing ReadFileCallback and WriteFileCallback.

Added support for assign Find, Read and WriteFileCallbacks to
osdDB::Options to enable plugins/applications to override the
callbacks just for that
read/write call and any nested file operations

--

Hope this helps,

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


Re: [osg-users] OSG website unresponsive

2012-01-10 Thread Robert Osfield
Hi All,

On the version control front I've sought feedback on the various
contenders and git looks to be the one of the best combinations for
our needs.  I don't think we need to go on debating the topic further
as we've debated it plenty of the years.

I'm curious, are their scripts available for subversion for keeping a
svn repository in sync with a git one, in the same way that the
current osg github repository is kept in sync with the osg one.   I'm
in two minds about whether we should attempt such a mirror, but if
it's possible and desired by the community then it's something we
consider as trying to support during the transition.

In terms of commits I we'll just need to have a drop dead date for the
existing subversion repository beyond which all commits then happen to
the git repository.  I would suggest that I complete the merges of the
current pending submissions to the existing svn repository make a dev
release then transfer across.

I'll get myself a github account and start learning about it.
However, I'm still deep in doing office admin work that I've been
putting aside for many months so I need to clear this backlog first.

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


Re: [osg-users] Draw line in 3D screen

2012-01-10 Thread Robert Osfield
Hi Lalit,

In the past I've tackled problems like drawing from mouse coords into
3D by creating a ray from the mouse coords and then intersecting this
with a plane.  The maths for computing the intersection point can be
handled by the osg::Plane class, there is no need to use the high
level scene graph intersection routines.

For you application only you will be able to answer how you want to
constrain the points you want to generate - would a plane that is
orthogonal to the image plane and going through the mid point of the
data cloud be appropriate?  You'll need to decide yourself what is
appropriate.

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


Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?

2012-01-10 Thread Sebas Walther
Hi robert,

I know that this is possible in general. The Problem is that all the views and 
viewers are managed by a main application. I do not have access to this 
while-loop of the viewer. Besides I need the Manipulator. I just have to 
manipulate the viewMatrix sometimes. Anyway, thanks for your attendance.

I may have found the solution. I just can't test it right now.
Instead of setting a cameraCallback with:

Code:
...->getViewerCamera()->setInitilDrawCallback(new MyInitialDrawCallback());


I should have used:

Code:
...->getViewerCamera()->setPreDrawCallback(new MyPreDrawCallback());


It sounds way better. I didn't know that this callback exists. I hope this 
helps somebody.[/code]

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





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


Re: [osg-users] Scene graph structure vs. performance question

2012-01-10 Thread Jason Daly

On 01/10/2012 02:06 AM, Joel Graff wrote:

The application isn't designed to create particularly large scene graphs, but 
it is a shader development tool.  I can't really guess at the effect of a 
bloated structure, but I have the funny feeling it won't really matter.  I also 
don't really know how flexible I may want my application node to be, but I see 
significant advantages to using the latter method and letting profiling after 
the fact bear out the bottlenecks.


I think you're right.  For your use case, I don't think a few nodes that 
are technically redundant will matter all that much.


You can always streamline later if it becomes a problem, but I doubt 
you'll need to.


--"J"

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


Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?

2012-01-10 Thread Robert Osfield
HI Sebas,

On 10 January 2012 15:38, Sebas Walther  wrote:
> Hi robert,
>
> I know that this is possible in general. The Problem is that all the views 
> and viewers are managed by a main application. I do not have access to this 
> while-loop of the viewer. Besides I need the Manipulator. I just have to 
> manipulate the viewMatrix sometimes. Anyway, thanks for your attendance.

Why not use a custom camera manipulator?

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


Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?

2012-01-10 Thread Sebas Walther
Hi Robert,


> Why not use a custom camera manipulator?


The main application manages the camera manipulators itself. My program is only 
a plugin for this application. What if another programer wants to build a new 
camera manipulator for the main application? It will be difficult and annoying 
to write a custom manipulator for every manipulator the main application knows 
and uses.

Cheers,
Sebas

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





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


Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?

2012-01-10 Thread Robert Osfield
Hi Sebas,

On 10 January 2012 17:54, Sebas Walther  wrote:
> The main application manages the camera manipulators itself. My program is 
> only a plugin for this application. What if another programer wants to build 
> a new camera manipulator for the main application? It will be difficult and 
> annoying to write a custom manipulator for every manipulator the main 
> application knows and uses.

There is a limit to how much one can provide in just a plugin, if you
want to modify the viewer then you really need access to the viewer.
You can be access to the current view in the event and cull traversals
so perhaps this would the way forward.  Or have the application
publish an API for you to use to modify the views.

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


[osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread wang shuiying

Hello,

we know that in openGL rendering pipeline, there is a stage called 
rasterization after per-vertex operation and before per-fragment 
operation. In rasterization stage, openGl generates certain properties 
(e.g. texture coordinates)for each fragment as a linear function of the 
eye-space or object-space or windows space coordinates.  My question is 
, how to check which coordinate is used in osg implementations? And how 
to change the coordinate that is used?


Thank you in advance.

Best regards

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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread Jason Daly

On 01/10/2012 02:55 PM, wang shuiying wrote:

Hello,

we know that in openGL rendering pipeline, there is a stage called
rasterization after per-vertex operation and before per-fragment
operation. In rasterization stage, openGl generates certain properties
(e.g. texture coordinates)for each fragment as a linear function of the
eye-space or object-space or windows space coordinates.  My question is
, how to check which coordinate is used in osg implementations? And how
to change the coordinate that is used?


The per-fragment attributes you're talking about are just interpolated 
from the same attributes that are assigned to the surrounding vertices.  
AFAIK, there's no way to change how these are computed, even with 
shaders (they're just simple linear interpolations).


It sounds like you might actually be talking about TexGen (texture 
coordinate generation), which in the fixed-function world can be set to 
OBJECT_LINEAR, EYE_LINEAR, SPHERE_MAP, NORMAL_MAP, or REFLECTION_MAP.  
TexGen will automatically compute the texture coordinates on the 
vertices (which will then be interpolated for each fragment, as 
mentioned above).  In OSG, the TexGen StateAttribute controls texture 
coordinate generation.  If you're using shaders, it's up to you to do 
the texture coordinate generation math yourself.


--"J"

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


Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?

2012-01-10 Thread Sebas Walther
Hi Robert,


> if you want to modify the viewer then you really need access to the viewer

I am not sure if I understand you correctly. I do have limited access to the 
viewer. It is for example possible to change the viewMatrix of the camera 
permanently if no camera manipulator is attached. The Problem is that my 
changes of the viewmatrix are overwritten if I use for example a 
TrackballManipulator. That is nothing new. That is the way it works.
What is wrong with attaching a callback to my camera? I wrote a class that 
inherits from osg::Camera::DrawCallback(). So now I have the opportunity to set 
this callback as preDrawCallback to the camera. Isn't is possible that I change 
the viewmatrix in the operator()-method of my class if it is necessary? Or do I 
have an error in reasoning here? 
I want to change the viewMatrix AFTER the manipulator changed it but right 
BEFORE the frame is rendered.

Thank you!

Cheers,
Sebas[/quote]

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





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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread wang shuiying

Hi,

To Jason Daly,

Thank you for your reply.

In my case, I record  positions of the vertexes in eye coordinate in vertex shader, and I 
want the rasterization to perform the linear interpolation function with eye coordinate 
so that I can get the position value of certain "vertex produced by 
interpolation".

In a nutshell, I want to change the way how opengl interpolates such attributes as those 
defined by "varying variables" in vertex shader.

So from your reply, only texture coordinates can be generated in different 
ways. As to general attributes, one has no way to change the interpolation 
method performed on them?

Can I at least get to know, if can not change, the interpolation method used by 
the openGl in my implemention?

Thank you.

Shuiying





Message: 16
Date: Tue, 10 Jan 2012 15:00:12 -0500
From: Jason Daly
To: OpenSceneGraph Users
Subject: Re: [osg-users] Help:How to control rasterization stage
through osg?
Message-ID:<4f0c98cc.8010...@ist.ucf.edu>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

On 01/10/2012 02:55 PM, wang shuiying wrote:


Hello,

we know that in openGL rendering pipeline, there is a stage called
rasterization after per-vertex operation and before per-fragment
operation. In rasterization stage, openGl generates certain properties
(e.g. texture coordinates)for each fragment as a linear function of the
eye-space or object-space or windows space coordinates.  My question is
, how to check which coordinate is used in osg implementations? And how
to change the coordinate that is used?


   The per-fragment attributes you're talking about are just interpolated
   from the same attributes that are assigned to the surrounding vertices.
   AFAIK, there's no way to change how these are computed, even with
   shaders (they're just simple linear interpolations).

   It sounds like you might actually be talking about TexGen (texture
   coordinate generation), which in the fixed-function world can be set to
   OBJECT_LINEAR, EYE_LINEAR, SPHERE_MAP, NORMAL_MAP, or REFLECTION_MAP.
   TexGen will automatically compute the texture coordinates on the
   vertices (which will then be interpolated for each fragment, as
   mentioned above).  In OSG, the TexGen StateAttribute controls texture
   coordinate generation.  If you're using shaders, it's up to you to do
   the texture coordinate generation math yourself.

   --"J"


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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread Jason Daly

On 01/10/2012 03:57 PM, wang shuiying wrote:

So from your reply, only texture coordinates can be generated in different 
ways. As to general attributes, one has no way to change the interpolation 
method performed on them?


I don't know of any way to change the rasterization behavior.  As far as 
I know, that's still part of the fixed-function pipeline.  I don't think 
there are even any parameters to control it, outside of the shade model, 
and anti-aliasing and multisampling parameters.




Can I at least get to know, if can not change, the interpolation method used by 
the openGl in my implemention?


Section 3.6 of the current OpenGL specification has all of the equations 
for this:


http://www.opengl.org/registry/doc/glspec42.core.20110808.pdf

--"J"

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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread Jason Daly

On 01/10/2012 03:57 PM, wang shuiying wrote:

So from your reply, only texture coordinates can be generated in different 
ways. As to general attributes, one has no way to change the interpolation 
method performed on them?


I don't know of any way to change the interpolation functions used for 
rasterization.  As far as I know, that's still part of the 
fixed-function pipeline.  I don't think there are even any parameters to 
control it,




Can I at least get to know, if can not change, the interpolation method used by 
the openGl in my implemention?


Section 3.6 of the current OpenGL specification has all of the equations 
for this:


http://www.opengl.org/registry/doc/glspec42.core.20110808.pdf

--"J"

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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread Paul Martz

On 1/10/2012 1:55 PM, Jason Daly wrote:

On 01/10/2012 03:57 PM, wang shuiying wrote:
Can I at least get to know, if can not change, the interpolation method used 
by the openGl in my implemention?


Section 3.6 of the current OpenGL specification has all of the equations for 
this:


http://www.opengl.org/registry/doc/glspec42.core.20110808.pdf 


Other sections too, 3.10.1 for example. Try searching the spec for "centroid" or 
"noperspective"; information on shader variable interpolation is scattered 
around in several places.


I'd think simple linear interpolation could be accomplished using the 
noperspective qualifier:

noperspective out vec3 eyeCoord; // for example
...but I haven't played with this.

You might consider searching/posting at the opengl.org discussion boards.
   -Paul


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


Re: [osg-users] Help:How to control rasterization stage through osg?

2012-01-10 Thread Jason Daly

On 01/10/2012 04:39 PM, Paul Martz wrote:

Other sections too, 3.10.1 for example. Try searching the spec for "centroid" or
"noperspective"; information on shader variable interpolation is scattered
around in several places.

I'd think simple linear interpolation could be accomplished using the
noperspective qualifier:
  noperspective out vec3 eyeCoord; // for example
...but I haven't played with this.

You might consider searching/posting at the opengl.org discussion boards.


Good call, Paul.  I don't remember hearing about the interpolation 
qualifiers.  Those are covered in section 4.5 of the GLSL spec...


http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.clean.pdf


--"J"

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


Re: [osg-users] [vpb] Large VPB Database build fails without

2012-01-10 Thread Shayne Tueller
Just a followup on this problem...

If I run osgdem directly on the dted files, things build just fine.

If I run vpbmaster on exactly the same dted files, it blows up with the error 
"no destination graph built, cannot proceed with build" in one of the tasks.

It's not clear to me why osgdem works and vpbmaster does not on the same data 
set... :? 

Shayne

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





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


Re: [osg-users] Sony Move.me

2012-01-10 Thread David Glenn
Greetings! Well, since no one reponded to my question, I assume that the answer 
is no - or they are too buzy hacking Kinects.

Thanks!

D Glenn


David Glenn
---
D Glenn 3D Computer Graphics & Media Systems.
www.dglenn.com

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





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


Re: [osg-users] [vpb] Large VPB Database build fails without

2012-01-10 Thread Torben Dannhauer
Hi Shayne,

Yesterday me large database finished after more then one month precessing on 12 
threads. Maybe we can now fix this issue.

It's interesting that osgdem can build the identical database without errors!

I'll try to recreate the problem in a small DB in the next week.


Thank you!

Cheers,
Torben

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





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


Re: [osg-users] Search for plugins in . first

2012-01-10 Thread Terry Welsh
Sorry about the incorrect subject line before.  I hate it when I do that :(

> But I'm not talking about that usage. I'm talking to set it just for
> your application. I have seen many commercial applications doing that ?a
> launcher script that sets LD_LIBRARY_PATH *in that shell* and then
> executes the process, so it uses the dynamic objects bundled with the
> application instead of system ones.
>
> --
> Alberto
>
That's a good point; that's probably a safe way to use it.  I tried
setting LD_LIBRARY_PATH=. and it makes it so ./osgPlugins-version is
searched but not .  I haven't figured out why yet, but it must be some
detail inside of OSG.  However, I'm still leaning toward solving this
problem with internal OSG functionality if possible since I want this
app to be cross-platform and Windows does not have a direct equivalent
to LD_LIBRARY_PATH.  I'd rather use OSG behavior that is guaranteed to
be consistent across platforms.

>
> Something like the FindFileCallback found in include/osgDB/Callbacks?
> You can assign a FindFileCallback to osgDB::Options or the Registry.
>
I just tried this out and I think it gives me full flexibility.  It
looks like I can search however I want now and still keep using
OSG_LIBRARY_PATH.  I should have remembered this since I was
experimenting with the findDataFile half of the callback a few months
ago.

Thank you both for the help.
- Terry
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org