Re: [osg-users] Develop a scalable binary file format for native OSG scenes?

2009-12-11 Thread Wang Rui
Hi Robert,

2009/12/11 Robert Osfield robert.osfi...@gmail.com:

 I believe .osg would be the most appropriate extension, the header
 could declare which version of the format it is - whether it's binary,
 new ascii or old ascii.  We could possible have a .osgb for binary.


It should be easy to change the extension at any time. So I'd like to
keep the polysemic name bin until the plugin is ready for public
testing. I agree that .osg is the best choice, but obviously ther is a
long way to go.


 In the ascii format the unique id for each class porperty is
 effectively the keyword that identifies it, this could work with a xml
 style ascii or an existing .osg style ascii format.  Having a keyword
 string for each class property would obviously be very inefficient for
 a binary format, both in terms of speed and size, using a string to id
 mapping in the form of dictionary placed at the beginning of the
 binary file might map between them so that id's could be used in the
 data section of the binary format.


In fact this is something like a DTD or XSD, which describes the
structures of classes of a specifed version. This could be placed at
the beginning of the binary file, or just as an individual one, for
instance, osg_3.0.schema. It will be automatically searched and used
by any files without a description header. The content of this schema
file could be simply filled with keyword=value pairs, or even in a
standard XML format. I'm dreaming of having a binary/ascii/xml
compatible file format in the future. :)


 This would be a useful addition.  Did you have an idea how you'd
 provide the property naming?  With the DataInpurStream did you have an
 idea how to cope with the potentially altered ordering of properties -
 or do we just declare such changes in ordering as invalid ascii files?
  Declaring an invalid ordering would certainly make the reading code
 easier.


Today I just overrided a series of operator() functions to make the
OutputStream class clearer and even ready to be serialized sometime
later, so do the InputStream class. And to implement ascii property
naming support, I coded one of them like:

OutputStream operator( OutputProperty prop )
{
if ( this-isBinary() )  // Ignored by binary formats
this-_stream  prop._name;
return *this;
}

Here OutputProperty is a custom struct for recording property name
temporarily. Then I could just modify the writing functions of each
wrapper using a PROPERTY macro:

os  PROPERTY(Name)  obj.getName();

The only thing it to totally rewrite all 102 existing classes. Oops..
I'd prefer use a limited number of core classes for test at present.


 I just checke he FPC webpage out, the license doesn't look open source
 friendly, so were you just thinking of learning about the technique
 and then re-implementing from scratch?


I had the plan to recode the FPC algorithm if possible. But I'm also
very happy to have a rest if there are already other friendly and
useful float point compressions for use.

I'll be ready to be merged for fully tests and submissions after
having finished the initial ascii/binary support. May the plugin be
placed in an inconspicuous subdirectory and mentioned as
not-recommended for public use, or just as a working copy in the
branch?

Cheers,

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


Re: [osg-users] Frustum/Culling issue with PagedLod

2009-12-11 Thread Robert Osfield
Hi Vincent,

Could it be that your home position is changing with changes in the
sphere's dimensions/poistion, and the home position is affecting the
LOD selection.

Robert.

On Thu, Dec 10, 2009 at 8:15 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
 Hi all,

 I just get something very strange I cannot really understand :

 In my scene, there is a graph will hundred of PagedLOD nodes, and no geodes.
 I manually set the frustum of the viewer :

 /
  view-getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR
 );
   float divider = (float)(zNear/config-frustumNearPlan);
   view-getCamera()-setProjectionMatrixAsFrustum (left/divider,
 right/divider,bottom/divider, top/divider, zNear/divider,
 config-frustumFarPlan);/
 (near is 2 and far is 2e+07)

 The scene render normally... there is no problem... BUT

 When I add a little Sphere (osg::Sphere) on the scene (center 0,0,0  radius
 1) before the render loop starts, the LODs never loads anything
 and nothing but the Sphere is visible...

 Because I set the frustum myself with the same values each time, I do not
 understand why I didn't see the LODs nodes

 The StatsHandler do not show the databasePager stats, which means there is
 no cull on the LOD ? This is a real question I am not yet a
 osg master...

 To conclude, when I add the Sphere with a radius upper than 5000, the LODs
 are visible... It really seems to be a wrong far plan frustum
 value... but I verified it is always the same and never change from 2e+06
 ...

 Any idea or suggestion could help me a lot :-)

 Thanks.

 Regards,
   Vincent.


 __ Information from ESET NOD32 Antivirus, version of virus signature
 database 4677 (20091210) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com


 ___
 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] Frustum/Culling issue with PagedLod

2009-12-11 Thread Vincent Bourdier

Hi Robert,

Sorry, the camera manipulator is my own one, and the position is hard 
coded for the home position.

I spend 3h yesterday night to find any explanation without success

Thanks.

Regards,
  Vincent.

Robert Osfield a écrit :

Hi Vincent,

Could it be that your home position is changing with changes in the
sphere's dimensions/poistion, and the home position is affecting the
LOD selection.

Robert.

On Thu, Dec 10, 2009 at 8:15 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
  

Hi all,

I just get something very strange I cannot really understand :

In my scene, there is a graph will hundred of PagedLOD nodes, and no geodes.
I manually set the frustum of the viewer :

/
 
view-getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR
);
  float divider = (float)(zNear/config-frustumNearPlan);
  view-getCamera()-setProjectionMatrixAsFrustum (left/divider,
right/divider,bottom/divider, top/divider, zNear/divider,
config-frustumFarPlan);/
(near is 2 and far is 2e+07)

The scene render normally... there is no problem... BUT

When I add a little Sphere (osg::Sphere) on the scene (center 0,0,0  radius
1) before the render loop starts, the LODs never loads anything
and nothing but the Sphere is visible...

Because I set the frustum myself with the same values each time, I do not
understand why I didn't see the LODs nodes

The StatsHandler do not show the databasePager stats, which means there is
no cull on the LOD ? This is a real question I am not yet a
osg master...

To conclude, when I add the Sphere with a radius upper than 5000, the LODs
are visible... It really seems to be a wrong far plan frustum
value... but I verified it is always the same and never change from 2e+06
...

Any idea or suggestion could help me a lot :-)

Thanks.

Regards,
  Vincent.


__ Information from ESET NOD32 Antivirus, version of virus signature
database 4677 (20091210) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


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





__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4677 (20091210) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


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


Re: [osg-users] OpenGL capture/logging in OSG

2009-12-11 Thread Alberto Luaces
Another program worth for considering would be Bugle
(http://www.opengl.org/sdk/tools/BuGLe/).

Just my 2 cents.

--

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


Re: [osg-users] Large coords and _clampProjectionMatrix not applied

2009-12-11 Thread Robert Osfield
HI Martin,

I can't really work out what exactly is going on from your email. The
compute near/far doesn't normally have problems these days, and the
values your are reporting suggest that they haven't been set at all -
is the scene empty?

As for large numbers, I would always recommend keeping your vertex
data with a local origin and using a MatrixTransform above the local
subgraph that positions it in the large coordinate frame i.e. Earth
Center Earth Fixed.  VPB/osgTerrain use this technique to ensure
numercial stability during rendering and intersection testing.   I
would say that this isn't done to avoid near/far issues though as they
don't normally arise when handling large coords - you instance sounds
pretty odd.

Robert.

On Thu, Dec 10, 2009 at 9:43 PM, Martin Beckett m...@mgbeckett.com wrote:
 When displaying a model positioned at real world coords (ie values in 6 
 figures) I get an error about _clampProjectionMatrix not applied and a 
 znear of roughly max_float and a zfar of -max_float.

 This only seems to be a problem with vertex data, display osg::shapes at 
 these coords is fine.

 Is there a simple fix to set the near/far planes to this coordinate system?

 Each part of the scene is in local coords with a PAT node setting the map 
 coords. Would it help to have a parent map node with the large offset handled 
 there?


 Martin

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





 ___
 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] opengl es 2.0

2009-12-11 Thread Robert Osfield
Hi Alok,

On Thu, Dec 10, 2009 at 10:02 PM, Alok Priyadarshi alo...@gmail.com wrote:
 I have not had any luck with this yet. I am trying to test ES 2.0 by
 just disabling the fixed function pipeline...

 I tried osggeometry example. I do not see anything render - just
 warnings about polygon stipple.

This is to be expected as the osggeometry example uses the fixed
function pipeline, and you've disabled this path ;-)

From my earlier email on this topic:
 Please note that most OSG examples won't work as is under OpenGLES 2.0
 thanks to the lack of the fixed function pipeline.  This means you
 need to code up vertex and fragment shaders to replace the fixed
 function pipeline.  You can use the osgUtil::ShaderGen to help do some
 automatic conversions of fixed function pipeline scene graphs to
 shader based ones but it's far from a perfect mapping.

For my own testing during the GLES port I wrote a test example callled
osgvertexattributes.  This example loads a model then runs
osgUtil::ShaderGen on it to convert the fixed function pipeline to
shaders, and with sets the options in osg::State that tell it remap
the traditional vertex arrays like
VertexArrays/ColorArrays/NormalArrays to vertex attrib equivalents,
and to turn on the adaption of shader programs to avoid using the GL2
style builtins, instead substituting in OSG equivalent builtins - such
as for the modelview + projections matrices.

So try:

   osgvertexattributes glider.osg

When build for GLES2 I've set osgViewer::Viewer::setSceneData() to run
ShaderGen automatically so it can actually get by a little better than
when using the Config settings to disable fixed function features
under GL2.

So have a try with osgvertexattributes and see how you get on.  It
won't be perfect, as osgUtil::ShaderGen does convert the full fixed
function pipeline but it should at least get you something on screen.

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


Re: [osg-users] Clarification with regard to Dragger

2009-12-11 Thread Robert Osfield
Hi Neil,

I can't follow your email, so can't comment specifically.  I can say
that I did a refactor of osgManipulator a couple of months back that
is now available in the 2.9.6 dev release, and svn/trunk.  This
refactor makes it easier to use so I would recommend using this.

I'm not the original author of osgManipulator so prior to my refactor
the code base was a bit of uknown, but since the refactor it is a bit
more familiar, which means I have a better chance of understanding
issues/code so moving this the latest OSG would help with support as
well.

Robert.

On Fri, Dec 11, 2009 at 12:34 AM, Neil Clayton n...@shinywhitebox.com wrote:
 Hi,

 I'm fairly new to OSG, and am wondering if my understanding of Draggers is 
 correct.

 I've a scene with a graph like so:   ClearNode - Black box - Group ( { Pat 
 - Geode}, { Dragger} ). The real graph is a touch more complex, but it's 
 pretty simple. A few geometry objects only at the moment. I'm missing a 
 matrix transform for the dragger in the above - but it gives the idea.

 I'm manipulating planes of data. So while it's in perspective, everything 
 sits on the y=0 plane.
 When I click, sometimes the dragger is selected, sometimes not.

 Printing out the objects intersected within Dragger::handle, it seems like 
 it's either random or based (maybe?) on z order.  If the nodepath containing 
 the TranslatePaneDragger happens to be the first it works. Otherwise it 
 doesn't.

 Dragger seems to assume that the first intersection will always contain the 
 dragger node.  Which I'm not finding to be the case.  I modified dragger so 
 that it examines all intersections (and remembers the correct iterator, 
 passing that to ::handle() for ::DRAG and ::RELEASE events), and now it works 
 fine.

 Have I misunderstood how draggers work though?  I'm worried that I've 
 modified code because of my own lack of understanding of OSG.

 Cheers,
 Neil

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





 ___
 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] OpenGL capture/logging in OSG

2009-12-11 Thread Robert Osfield
Hi Paul,

My instinct would be to be not recommend trying to add some extra
level of indirection in OpenGL calls to the OSG, from a maintenance
and performance perspective.   Considering most of us can get by
without it it's sure note a cost that I ever want to push out to
everyone.  Cost of maintenance also means that other tasks go slower
as they receive less time so the potential fallout isn't just
localised to OpenGL call management.

In terms of centralization of extensions/GL calls, this is something I
have deliberately avoided as it's not a extensible approach as you'd
have a single class that everyone would have to extend to add their
extension support into.  3rd party NodeKits that add their own
extensions would either have to get them added into the core OSG is
just roll their own as they do now.

I would, however, be happy to see a more formalized system for
extension setup, as the current distributed approach has let the
styles of implementation diverge as a series of different developers
have got their hands dirty contributing code.

In terms of a GL capture I would personal go the route of a 3rd party
tool like GLintercept, and parse the GL headers to capture function
calls and add diagnostics.  On the OSG side would could add an ability
to pick a different GL library that than the standard one to make this
diagnostics easier, but given we can control link paths to libs it's
not too hard to substitute as is.

Robert.


On Fri, Dec 11, 2009 at 2:49 AM, Paul Martz pma...@skew-matrix.com wrote:
 Hi all --

 I have some funding to capture OSG's OpenGL calls. This is required for
 development, debugging, and performance analysis work that I am currently
 contracted for. I have already ruled out updating GLIntercept for this
 purpose.

 Purchasing gDEBugger is a possibility. However, the upfront cost is large,
 and the lack of control in this closed-source tool is undesirable. Most of
 my work is OSG-related, so I have little need for gDEBugger's general OpenGL
 analysis capability.

 This brings me to the point of my post: adding OpenGL capture directly to
 OSG.

 My idea so far is to take a private snapshot of OSG, then modify it so that
 all OpenGL calls go through function wrappers (many do already) or a CPP
 macro. By default, the call would go straight into OpenGL, but a developer
 could enable instrumentation through CMake so that OSG captures OpenGL
 command info before calling into OpenGL. This would record the call to a
 log, allow breakpoints, record timing data, capture texture image data and
 shader source to files, any number of things, really, but essentially the
 capabilities found in GLIntercept.

 The capture would be thread safe and support multiple contexts. Support for
 new OpenGL features and extensions would be trivial; the OpenGL wrapper code
 would be automatically generated from gl.h or extension header files, so
 just drop in the enum defs and function declarations and rebuild.

 Initially, my inclination was to do this on my own, basically make my own
 private instrumented branch of OSG. But then I realized that there are other
 benefits that this change could bring to OSG, and it might be worth folding
 into the source.

 Consider how OSG currently calls into OpenGL. OSG might call OpenGL
 directly, or load and call through a function pointer, or call into a
 function wrapper that manages a function pointer. When OSG does call through
 a function pointer or into a function wrapper, the code for doing this is
 scattered in multiple classes, headers, and source files (e.g.,
 GL2Extensions, FrameBufferObject, etc). Adding OpenGL capture to OSG would
 give us a chance to unify this code and make it consistent. Access to all
 OpenGL commands would go through a single class, and done consistently
 through a CPP macro or function wrapper. This would be a good code cleanup.

 Plus, I also thought there might be others besides myself that wanted to
 capture OpenGL command streams. It's really quite a valuable development
 tool.

 Because this might have value for many developers, I am posting here for
 discussion. If the community is interested, I am willing to work with others
 to satisfy requirements. If the community is not interested, I'll either do
 my own private branch or purchase gDEBugger.
 --
 Paul Martz
 Skew Matrix Software LLC
 _http://www.skew-matrix.com_ http://www.skew-matrix.com/
 +1 303 859 9466

 ___
 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] Develop a scalable binary file format for native OSG scenes?

2009-12-11 Thread Robert Osfield
Hi Paul,

If .osgb isn't yet used in anything public, and it's the most nature
naming for a OSG native binary format then I believe we should forgo
the first dibs on the file extension and adopt it for the native
binary OSG format - what we want is clarity for the widest number of
people.  Alternatively such as .bosg just aren't as natural, or fit in
with the existing .osg and .osga file extensions.

Another aspect is that Wang Rui's approach is for an extensible binary
format, and this means that 3rd party NodeKits won't need their own
binary formats, then can just extend the OSG's native binary format.
This means the pressure on having lots of new file formats diminishes.

Robert.

On Thu, Dec 10, 2009 at 8:18 PM, Paul Martz pma...@skew-matrix.com wrote:
 Paul Martz wrote:

 That would be true if it weren't for the fact that .osgb is already in
 use: http://osgbullet.googlecode.com.

 Oops! Sorry, I made a mistake. .osgb is _not_ used by osgBullet, but it is
 used in a related project that is still in development and not yet open
 source. That code is a candidate for inclusion in osgBullet in the future.

 Regardless, I did ask that the .osgb extension be reserved for my uses back
 in June '09. So, to avoid an extension name collision, I'll ask that we
 consider an alternative extension for the new binary format.

 I'll vote against using the same extension string for both ASCII and binary
 forms of OSG's (new) native format. It would complicate use of osgconv to
 convert between the two formats. Also, I like to know what is optimized for
 production loading and what isn't, and what can be opened in a text editor
 and what can't; using a different extension gives me this info at a glance.
   -Paul
 ___
 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] light lobes

2009-12-11 Thread Robert Osfield
Hi Nick,

On Fri, Dec 11, 2009 at 9:40 AM, Trajce Nikolov
nikolov.tra...@gmail.com wrote:
 I mimic the code from osgspotlight and here are the results. To me it looks
 like one half of the lobe is mirrored. Any idea ?

This is a classic issue with projective texturing - the way around it
is either to use a shader to disable the lighting behind, or to use a
1D texture along the axis of the light that clips out the light from
behind.  Such a texture would also enable you to attenuate the light.

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


Re: [osg-users] light lobes

2009-12-11 Thread Trajce Nikolov
Hi Robert,

1D texture approach with attenuation, based on your state should do the
work. However, I am not familiar with this technique. Could you give more
words on this, or point me what is to search for

Thanks !
Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey

On Fri, Dec 11, 2009 at 12:06 PM, Robert Osfield
robert.osfi...@gmail.comwrote:

 Hi Nick,

 On Fri, Dec 11, 2009 at 9:40 AM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  I mimic the code from osgspotlight and here are the results. To me it
 looks
  like one half of the lobe is mirrored. Any idea ?

 This is a classic issue with projective texturing - the way around it
 is either to use a shader to disable the lighting behind, or to use a
 1D texture along the axis of the light that clips out the light from
 behind.  Such a texture would also enable you to attenuate the light.

 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] light lobes

2009-12-11 Thread Trajce Nikolov
ok .. did some experiments and made it work. Now I am seeing it the same
with Texture1D. Any ideas how this texture should look like?

Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey

On Fri, Dec 11, 2009 at 12:10 PM, Trajce Nikolov
nikolov.tra...@gmail.comwrote:

 Hi Robert,

 1D texture approach with attenuation, based on your state should do the
 work. However, I am not familiar with this technique. Could you give more
 words on this, or point me what is to search for

 Thanks !

 Nick

 http://www.linkedin.com/in/tnikolov
 Sent from Gümüşsuyu, İstanbul, Turkey

 On Fri, Dec 11, 2009 at 12:06 PM, Robert Osfield robert.osfi...@gmail.com
  wrote:

 Hi Nick,

 On Fri, Dec 11, 2009 at 9:40 AM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  I mimic the code from osgspotlight and here are the results. To me it
 looks
  like one half of the lobe is mirrored. Any idea ?

 This is a classic issue with projective texturing - the way around it
 is either to use a shader to disable the lighting behind, or to use a
 1D texture along the axis of the light that clips out the light from
 behind.  Such a texture would also enable you to attenuate the light.

 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] light lobes

2009-12-11 Thread Trajce Nikolov
one more thing. The matrix that I pass to TexGen seem to not be taken into
account. No matter how I set the far plane it shows same results. Is this
expected behavior ?

Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey

2009/12/11 Trajce Nikolov nikolov.tra...@gmail.com

 ok .. did some experiments and made it work. Now I am seeing it the same
 with Texture1D. Any ideas how this texture should look like?

 Nick

 http://www.linkedin.com/in/tnikolov
 Sent from Gümüşsuyu, İstanbul, Turkey

 On Fri, Dec 11, 2009 at 12:10 PM, Trajce Nikolov nikolov.tra...@gmail.com
  wrote:

 Hi Robert,

 1D texture approach with attenuation, based on your state should do the
 work. However, I am not familiar with this technique. Could you give more
 words on this, or point me what is to search for

 Thanks !

 Nick

 http://www.linkedin.com/in/tnikolov
 Sent from Gümüşsuyu, İstanbul, Turkey

 On Fri, Dec 11, 2009 at 12:06 PM, Robert Osfield 
 robert.osfi...@gmail.com wrote:

 Hi Nick,

 On Fri, Dec 11, 2009 at 9:40 AM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  I mimic the code from osgspotlight and here are the results. To me it
 looks
  like one half of the lobe is mirrored. Any idea ?

 This is a classic issue with projective texturing - the way around it
 is either to use a shader to disable the lighting behind, or to use a
 1D texture along the axis of the light that clips out the light from
 behind.  Such a texture would also enable you to attenuate the light.

 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


[osg-users] Text Crash On Main Thread While DB Pager Unrefs Font From Temp Object Cache

2009-12-11 Thread Ryan H. Kawicki
I've been investigating a crash that has plagued us for quite some time.  I've 
finally gotten some time to sit down and take a look at this.

Details:
OSG: 2.8.1
OS: WinXP SP3 32Bit
CPU: 8 Core 2.5GHz Xenon
Graphics: Quadro FX 3700 512 MB
Memory: Plenty

Description:
Our application embeds OSG into two views.  There are multiple threads at work 
here, but the two of importance are the Map thread and the DatabasePager thread.

At certain points during the execution of our application, the Map thread will 
be given a request to create an osgText object.  One of the operations is to 
request a font for the osgText object.  At this point we call down into 
osgText::readFontFile( ... ).

At this same time, the database pager is hard at work reading paged files from 
disk on its own thread.  At some point, the database pager gets into 
Registry::readImplementation( ... ) and begins to copy the object cache to a 
temp object cache.  There is only one object in the cache and it is an 
osgText::Font object.  At some point during this stage, an unref of the object 
happens.  Here is where the oddity comes in.  When the object is getting 
unreferenced, the code checks to see if the object needs to be deleted.  For 
some odd reason this value is 0 on the DB thread but 2 on the Map thread.  When 
the Map thread tries to use the font object, it dies, as the DB thread has 
already released it.  I would give more details on this, but the computer I was 
working on did not come back from standby and everything I am stating is from 
memory.  Sorry.

Question:
Now that we have gotten through that, the question I have is related to the 
implementation of osgText::readFontFile.  Would it not be safer to have this 
function use ref_ptr objects internally rather than standard pointers?  I'm 
quite confused as to the design decisions behind this and hope someone can help 
me here.


Code:

osgText::Font* osgText::readFontFile(const std::string filename, const 
osgDB::ReaderWriter::Options* userOptions)
{
if (filename==) return 0;

std::string foundFile = findFontFile(filename);
if (foundFile.empty()) return 0;

OpenThreads::ScopedLockOpenThreads::Mutex lock(s_FontFileMutex);

osg::ref_ptrosgDB::ReaderWriter::Options localOptions;
if (!userOptions)
{
localOptions = new osgDB::ReaderWriter::Options;

localOptions-setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_OBJECTS);
}

osg::Object* object = osgDB::readObjectFile(foundFile, userOptions ? 
userOptions : localOptions.get());

// if the object is a font then return it.
osgText::Font* font = dynamic_castosgText::Font*(object);
if (font) return font;

// otherwise if the object has zero references then delete it by doing 
another unref().
if (object  object-referenceCount()==0) object-unref();
return 0;
}




Thanks,
Ryan

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





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


Re: [osg-users] light lobes

2009-12-11 Thread Robert Osfield
Hi Nick,

On Fri, Dec 11, 2009 at 1:01 PM, Trajce Nikolov
nikolov.tra...@gmail.com wrote:
 one more thing. The matrix that I pass to TexGen seem to not be taken into
 account. No matter how I set the far plane it shows same results. Is this
 expected behavior ?

I can't comment on the issues you are seeing as I'm not party to your code.

As for the 1D texture - this would just be a simple alpha textured
with a region set to zero for behind the light source, and 1.0 or
attenuated in front.

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


Re: [osg-users] Text Crash On Main Thread While DB Pager Unrefs Font From Temp Object Cache

2009-12-11 Thread Robert Osfield
Hi Ryan,

I sounds like the lack of a readRefFontFile() is a potential problem.
In the case of include/osgDB/ReadFile there are readRefNodeFile() etc.
functions that pass back a ref_ptr rather than a C pointer, and are
all safer in multi-thread situations where object cache is in play.
Could you try implementing a readRefFontFile() and convert osgText
across to use this to see if it helps.

Cheers,
Robert.

On Fri, Dec 11, 2009 at 1:04 PM, Ryan H. Kawicki
ryan.h.kawi...@boeing.com wrote:
 I've been investigating a crash that has plagued us for quite some time.  
 I've finally gotten some time to sit down and take a look at this.

 Details:
 OSG: 2.8.1
 OS: WinXP SP3 32Bit
 CPU: 8 Core 2.5GHz Xenon
 Graphics: Quadro FX 3700 512 MB
 Memory: Plenty

 Description:
 Our application embeds OSG into two views.  There are multiple threads at 
 work here, but the two of importance are the Map thread and the DatabasePager 
 thread.

 At certain points during the execution of our application, the Map thread 
 will be given a request to create an osgText object.  One of the operations 
 is to request a font for the osgText object.  At this point we call down into 
 osgText::readFontFile( ... ).

 At this same time, the database pager is hard at work reading paged files 
 from disk on its own thread.  At some point, the database pager gets into 
 Registry::readImplementation( ... ) and begins to copy the object cache to a 
 temp object cache.  There is only one object in the cache and it is an 
 osgText::Font object.  At some point during this stage, an unref of the 
 object happens.  Here is where the oddity comes in.  When the object is 
 getting unreferenced, the code checks to see if the object needs to be 
 deleted.  For some odd reason this value is 0 on the DB thread but 2 on the 
 Map thread.  When the Map thread tries to use the font object, it dies, as 
 the DB thread has already released it.  I would give more details on this, 
 but the computer I was working on did not come back from standby and 
 everything I am stating is from memory.  Sorry.

 Question:
 Now that we have gotten through that, the question I have is related to the 
 implementation of osgText::readFontFile.  Would it not be safer to have this 
 function use ref_ptr objects internally rather than standard pointers?  I'm 
 quite confused as to the design decisions behind this and hope someone can 
 help me here.


 Code:

 osgText::Font* osgText::readFontFile(const std::string filename, const 
 osgDB::ReaderWriter::Options* userOptions)
 {
    if (filename==) return 0;

    std::string foundFile = findFontFile(filename);
    if (foundFile.empty()) return 0;

    OpenThreads::ScopedLockOpenThreads::Mutex lock(s_FontFileMutex);

    osg::ref_ptrosgDB::ReaderWriter::Options localOptions;
    if (!userOptions)
    {
        localOptions = new osgDB::ReaderWriter::Options;
        
 localOptions-setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_OBJECTS);
    }

    osg::Object* object = osgDB::readObjectFile(foundFile, userOptions ? 
 userOptions : localOptions.get());

    // if the object is a font then return it.
    osgText::Font* font = dynamic_castosgText::Font*(object);
    if (font) return font;

    // otherwise if the object has zero references then delete it by doing 
 another unref().
    if (object  object-referenceCount()==0) object-unref();
    return 0;
 }




 Thanks,
 Ryan

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





 ___
 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] light lobes

2009-12-11 Thread Ümit Uzun
Hi Nick,

I advice you to look at, How can I ask smart question? from
http://catb.org/~esr/faqs/smart-questions.html

Regards.

Ümit Uzun


2009/12/11 Robert Osfield robert.osfi...@gmail.com

 Hi Nick,

 On Fri, Dec 11, 2009 at 1:01 PM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  one more thing. The matrix that I pass to TexGen seem to not be taken
 into
  account. No matter how I set the far plane it shows same results. Is this
  expected behavior ?

 I can't comment on the issues you are seeing as I'm not party to your code.

 As for the 1D texture - this would just be a simple alpha textured
 with a region set to zero for behind the light source, and 1.0 or
 attenuated in front.

 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] light lobes

2009-12-11 Thread Trajce Nikolov
here is the code. The osgspotlight sample with :
- flatten the terrain (only a quad - all zerors height)
- put closer the plane
- change the far plane from 100 to 10
- use of 1D texture

What causes the mirroring on the light? to me looks like it should be
mirrored along the Y axis (negative x-ses) instead of mirroring it along the
X axis. It is half of the projected thing. It should be displayed. Is this a
bug?


#include osg/Notify
#include osg/MatrixTransform
#include osg/ShapeDrawable
#include osg/PositionAttitudeTransform
#include osg/Geometry
#include osg/Texture2D
#include osg/Texture1D
#include osg/Geode
#include osg/LightSource
#include osg/TexGenNode
#include osgShadow/ShadowedScene
#include osgShadow/LightSpacePerspectiveShadowMap
#include osgShadow/ParallelSplitShadowMap

#include osgUtil/Optimizer

#include osgDB/Registry
#include osgDB/ReadFile

#include osgViewer/Viewer


// for the grid data..
#include ../osghangglide/terrain_coords.h

static int sunit=2;

osg::Image* createSpotLightImage(const osg::Vec4 centerColour, const
osg::Vec4 backgroudColour, unsigned int size, float power)
{
osg::Image* image = new osg::Image;
image-allocateImage(size,1,1,
 GL_RGBA,GL_UNSIGNED_BYTE);


float mid = (float(size)-1)*0.5f;
float div = 2.0f/float(size);
for(unsigned int r=0;r1;++r)
{
unsigned char* ptr = image-data(0,r,0);
for(unsigned int c=0;csize;++c)
{
unsigned char clr = 128-osg::minimum((int)c,128);
float dx = (float(c) - mid)*div;
float dy = (float(r) - mid)*div;
float r = powf(1.0f-sqrtf(dx*dx+dy*dy),power);
if (r0.0f) r=0.0f;
osg::Vec4 color = centerColour*r+backgroudColour*(1.0f-r);
*ptr++ = (unsigned char)clr;//((color[0])*255.0f);
*ptr++ = (unsigned char)clr;//((color[1])*255.0f);
*ptr++ = (unsigned char)clr;//((color[2])*255.0f);
*ptr++ = (unsigned char)255;//((color[3])*255.0f);
}
}
return image;

//return osgDB::readImageFile(spot.dds);
}

osg::StateSet* createSpotLightDecoratorState(unsigned int lightNum, unsigned
int textureUnit)
{
osg::StateSet* stateset = new osg::StateSet;

stateset-setMode(GL_LIGHT0+lightNum, osg::StateAttribute::ON);

osg::Vec4 centerColour(1.0f,1.0f,1.0f,1.0f);
osg::Vec4 ambientColour(0.05f,0.05f,0.05f,1.0f);

// set up spot light texture
osg::Texture1D* texture = new osg::Texture1D();
texture-setImage(createSpotLightImage(centerColour, ambientColour, 256,
1.0));
texture-setBorderColor(osg::Vec4(ambientColour));
texture-setWrap(osg::Texture::WRAP_S,osg::Texture::CLAMP_TO_BORDER);
texture-setWrap(osg::Texture::WRAP_T,osg::Texture::CLAMP_TO_BORDER);
texture-setWrap(osg::Texture::WRAP_R,osg::Texture::CLAMP_TO_BORDER);

stateset-setTextureMode(sunit,GL_TEXTURE_1D,osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED);

stateset-setTextureMode(sunit,GL_TEXTURE_2D,osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED);

 
stateset-setTextureMode(sunit,GL_TEXTURE_3D,osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED);
stateset-setTextureAttributeAndModes(sunit, texture,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);

// set up tex gens
stateset-setTextureMode(sunit, GL_TEXTURE_GEN_S,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
stateset-setTextureMode(sunit, GL_TEXTURE_GEN_T,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
stateset-setTextureMode(sunit, GL_TEXTURE_GEN_R,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
stateset-setTextureMode(sunit, GL_TEXTURE_GEN_Q,
osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);

return stateset;
}


osg::Node* createSpotLightNode(const osg::Vec3 position, const osg::Vec3
direction, float angle, unsigned int lightNum, unsigned int textureUnit)
{
osg::Group* group = new osg::Group;

// create light source.
osg::LightSource* lightsource = new osg::LightSource;
osg::Light* light = lightsource-getLight();
light-setLightNum(lightNum);
light-setPosition(osg::Vec4(position,1.0f));
light-setAmbient(osg::Vec4(0.00f,0.00f,0.05f,1.0f));
light-setDiffuse(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
group-addChild(lightsource);

// create tex gen.

osg::Vec3 up(0.0f,0.0f,1.0f);
up = (direction ^ up) ^ direction;
up.normalize();

osg::TexGenNode* texgenNode = new osg::TexGenNode;
texgenNode-setTextureUnit(sunit);
osg::TexGen* texgen = texgenNode-getTexGen();
texgen-setMode(osg::TexGen::EYE_LINEAR);
texgen-setPlanesFromMatrix(osg::Matrixd::lookAt(position,
position+direction, up) *

 osg::Matrixd::perspective(angle,1.0,0.1,10));


group-addChild(texgenNode);

return group;

}


osg::AnimationPath* createAnimationPath(const osg::Vec3 center,float
radius,double looptime)
{
  

Re: [osg-users] light lobes

2009-12-11 Thread Trajce Nikolov
LOL ... ;-) ...

Thanks Umit. I will have a look.

btw. You know that saying ... There are no stupid questions. Only stupid
answers.

Be a wise man and point me to my questions that need to be smartened.
Instead of criticizing me you can give some answers. I really have high
respect to this community and I appreciate and benefit from it, like all of
us.

Thanks again!
Nick

http://www.linkedin.com/in/tnikolov
Sent from Gümüşsuyu, İstanbul, Turkey

On Fri, Dec 11, 2009 at 3:54 PM, Ümit Uzun umituzu...@gmail.com wrote:

 Hi Nick,

 I advice you to look at, How can I ask smart question? from
 http://catb.org/~esr/faqs/smart-questions.html

 Regards.

 Ümit Uzun


 2009/12/11 Robert Osfield robert.osfi...@gmail.com

 Hi Nick,

 On Fri, Dec 11, 2009 at 1:01 PM, Trajce Nikolov
 nikolov.tra...@gmail.com wrote:
  one more thing. The matrix that I pass to TexGen seem to not be taken
 into
  account. No matter how I set the far plane it shows same results. Is
 this
  expected behavior ?

 I can't comment on the issues you are seeing as I'm not party to your
 code.

 As for the 1D texture - this would just be a simple alpha textured
 with a region set to zero for behind the light source, and 1.0 or
 attenuated in front.

 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


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


[osg-users] PagedLod expired children

2009-12-11 Thread Vincent Bourdier

Hi everybody !

Once again, i have a question about PagedLod managment, concerning 
memory usage this time


My PagedLOD have 2 children with ranges [0, n] [n, 1e20]
I put a spy on one, and I see : 0child on load, 1 child during loading, 
2child when the camera is near, 1child again when the camera goes far 
from the node...

I did setNumChildrenThatCannotBeExpired(1) on each LOD.

So why are there 2 children when the camera is near ?
Do 1child seems the other one is released in memory ?

If it is not... how to set the pagedLod to keep only one child ?

Thanks for you help.

Regards,
  Vincent.


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4679 (20091211) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


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


Re: [osg-users] PagedLod expired children

2009-12-11 Thread Robert Osfield
Hi Vincent,

PagedLOD only ever expires high rest children that are nolonger
needed.  It never expires low res children when viewing a high rest
child as you always want the low res child to fallback on when you
suddenly move away.  The cost of a low res child is very much lower
than the high res child (typically a 4:1 ratio) so the cost of keeping
it around for when it'll be needed in the future is actually very low.

Robert.

On Fri, Dec 11, 2009 at 2:16 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
 Hi everybody !

 Once again, i have a question about PagedLod managment, concerning memory
 usage this time

 My PagedLOD have 2 children with ranges [0, n] [n, 1e20]
 I put a spy on one, and I see : 0child on load, 1 child during loading,
 2child when the camera is near, 1child again when the camera goes far from
 the node...
 I did setNumChildrenThatCannotBeExpired(1) on each LOD.

 So why are there 2 children when the camera is near ?
 Do 1child seems the other one is released in memory ?

 If it is not... how to set the pagedLod to keep only one child ?

 Thanks for you help.

 Regards,
  Vincent.


 __ Information from ESET NOD32 Antivirus, version of virus signature
 database 4679 (20091211) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com


 ___
 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] Clarification with regard to Dragger

2009-12-11 Thread Jean-Sébastien Guay

Hello Neil,


When I click, sometimes the dragger is selected, sometimes not.


If you want clicks to always select the dragger, then you can just use 
node masks. Use a given bit to indicate the dragger, then set the 
dragger to this node mask, and remove that bit from your other objects' 
node masks. Then when picking, use that bit as your intersection 
visitor's traversal mask.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [VPB] Usage question

2009-12-11 Thread Sukender
Hi all,

I've got model tiles (urban zone, files such as .osg/ive, .3ds ...) which need 
to be visualized using pagedLODs.
Can VPB do with models what it does with terrain? That is to say, can VPB help 
me in a way or another to:
- Create less detailed version of the tiles? (Am I a bit optimistic?)
- Arrange tiles under LODs/pagedLODs into a master file?
- Deform tiles according to coordinates system? (I guess so, using OGR?)

If answers are no, do you have an idea on how to acheive this goal?

Thank you.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSG 2.9.6, cmake and QtWebKit config error.

2009-12-11 Thread Sewell, Kenneth R Civ USAF AFRL/RYZW
When trying to configure OSG 2.9.6, if the system doesn't have QtWebKit
installed cmake will not configure the examples.  Making the following
change seems to fix it (at least on my Suse 11.0 box):

 

IF (QT4_FOUND)

 ADD_SUBDIRECTORY(osgQtBrowser)

ENDIF()

 

changed to:

 

IF (QT4_FOUND AND QT_USE_WEBKIT)

 ADD_SUBDIRECTORY(osgQtBrowser)

ENDIF()

 

 

 

-Ken.

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


Re: [osg-users] Fix for osgPPU FindOSG.cmake; lack of svn properties

2009-12-11 Thread Philip Lowman
If anyone is interested, you can also check out FindOpenSceneGraph.cmake
which is part of CMake now.  It does debug/release libraries and version
support.

On Dec 10, 2009 3:30 PM, Paul Martz pma...@skew-matrix.com wrote:

Try this one instead; I forgot that CMake can't handle backslashes.

Paul Martz Skew Matrix Software LLC _http://www.skew-matrix.com_ 
http://www.skew-matrix.com/ +1 ...
Paul Martz wrote:

   Hi Art -- I've modified the FindOSG.cmake script so that it looks in MS
 Windows standard OSG ins...
 

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


# This module defines

# OSG_LIBRARY
# OSG_FOUND, if false, do not try to link to osg
# OSG_INCLUDE_DIRS, where to find the headers
# OSG_INCLUDE_DIR, where to find the source headers
# OSG_GEN_INCLUDE_DIR, where to find the generated headers

# to use this module, set variables to point to the osg build
# directory, and source directory, respectively
# OSGDIR or OSG_SOURCE_DIR: osg source directory, typically OpenSceneGraph
# OSG_DIR or OSG_BUILD_DIR: osg build directory, place in which you've
#built osg via cmake

# Header files are presumed to be included like
# #include osg/PositionAttitudeTransform
# #include osgUtil/SceneView

## headers ##

SET( CMAKE_DEBUG_POSTFIX d )

MACRO( FIND_OSG_INCLUDE THIS_OSG_INCLUDE_DIR THIS_OSG_INCLUDE_FILE )

# configure matched pair of include / library search paths
SET( OSG_SEARCH_PATHS
   $ENV{OSG_SOURCE_DIR}
   $ENV{OSG_BUILD_DIR}
   ${OSGDIR}
   $ENV{OSGDIR}
   ${OSG_DIR}
   $ENV{OSG_DIR}
   ${OSG_ROOT}
   $ENV{OSG_ROOT}
   ${OSG_ROOT_DEBUG}
   $ENV{OSG_ROOT_DEBUG}
   ${CMAKE_INSTALL_PREFIX}
   ${CMAKE_PREFIX_PATH}
   /usr/local
   /usr/local/lib64
   /usr
   /sw # Fink
   /opt/local # DarwinPorts
   /opt/csw # Blastwave
   /opt
   /usr/freeware
   [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\
Manager\\Environment;OSG_ROOT]/
   ~/Library/Frameworks
   /Library/Frameworks
   C:/Program Files/OpenSceneGraph
   C:/Program Files (x86)/OpenSceneGraph
   )

FIND_PATH( ${THIS_OSG_INCLUDE_DIR} ${THIS_OSG_INCLUDE_FILE}
   PATHS   ${OSG_SEARCH_PATHS}
   PATH_SUFFIXES   include build/include Build/include
)

ENDMACRO(FIND_OSG_INCLUDE THIS_OSG_INCLUDE_DIR THIS_OSG_INCLUDE_FILE)

#FIND_OSG_INCLUDE( OSG_GEN_INCLUDE_DIR  osg/Config )
FIND_OSG_INCLUDE( OSG_INCLUDE_DIR  osg/Node )

## libraries ##

MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)

FIND_LIBRARY(${MYLIBRARY}
   NAMES   ${MYLIBRARYNAME}
   PATHS   ${OSG_SEARCH_PATHS}
   PATH_SUFFIXES   lib build/lib Build/lib
)

ENDMACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)

SET( TMP_LIBRARY_LIST
   OpenThreads osg osgGA osgUtil osgDB osgText osgViewer )

FOREACH(LIBRARY ${TMP_LIBRARY_LIST})
   STRING( TOUPPER ${LIBRARY} UPPPERLIBRARY )
   FIND_OSG_LIBRARY( ${UPPPERLIBRARY}_LIBRARY_RELEASE  ${LIBRARY} )
   FIND_OSG_LIBRARY( ${UPPPERLIBRARY}_LIBRARY_DEBUG
 ${LIBRARY}${CMAKE_DEBUG_POSTFIX} )
   LIST( APPEND OSG_LIBRARIES debug ${${UPPPERLIBRARY}_LIBRARY_DEBUG}
optimized ${${UPPPERLIBRARY}_LIBRARY_RELEASE} )
ENDFOREACH(LIBRARY ${TMP_LIBRARY_LIST})

SET( OSG_FOUND NO )
#IF(OSG_LIBRARY_RELEASE OR OSG_LIBRARY_DEBUG AND OSG_INCLUDE_DIR AND
OSG_GEN_INCLUDE_DIR)
#SET( OSG_FOUND YES )
#SET( OSG_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSG_GEN_INCLUDE_DIR} )
#GET_FILENAME_COMPONENT( OSG_LIBRARY_DIR_RELEASE ${OSG_LIBRARY_RELEASE}
PATH )
#GET_FILENAME_COMPONENT( OSG_LIBRARY_DIR_DEBUG   ${OSG_LIBRARY_DEBUG}
  PATH )
#SET( OSG_LIBRARY_DIRS ${OSG_LIBRARY_DIR_RELEASE}
${OSG_LIBRARY_DIR_DEBUG} )
#ENDIF(OSG_LIBRARY_RELEASE OR OSG_LIBRARY_DEBUG AND OSG_INCLUDE_DIR AND
OSG_GEN_INCLUDE_DIR)


IF(OSG_LIBRARY_RELEASE OR OSG_LIBRARY_DEBUG AND OSG_INCLUDE_DIR)
   SET( OSG_FOUND YES )
   SET( OSG_INCLUDE_DIRS ${OSG_INCLUDE_DIR} )
   GET_FILENAME_COMPONENT( OSG_LIBRARY_DIR_RELEASE ${OSG_LIBRARY_RELEASE}
PATH )
   GET_FILENAME_COMPONENT( OSG_LIBRARY_DIR_DEBUG   ${OSG_LIBRARY_DEBUG}
PATH )
   SET( OSG_LIBRARY_DIRS ${OSG_LIBRARY_DIR_RELEASE} ${OSG_LIBRARY_DIR_DEBUG}
)
ENDIF(OSG_LIBRARY_RELEASE OR OSG_LIBRARY_DEBUG AND OSG_INCLUDE_DIR)


___
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] Transparent skydome

2009-12-11 Thread Dominic Stalder

Hi there

we use the skydome.osg of the OSG examples. Is it possible to make this 
one transparent, so that only the clouds are visible.


We converted the skymap.jpg to a PNG file with a transparent alpha 
channel. Instead of a transparent skydome, it's just white where the 
transparent color is.


Is it possible to make the skydome.osg transparent in the code and how?

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


Re: [osg-users] Transparent skydome

2009-12-11 Thread Paul Martz

Dominic Stalder wrote:

Hi there

we use the skydome.osg of the OSG examples. Is it possible to make this 
one transparent, so that only the clouds are visible.


We converted the skymap.jpg to a PNG file with a transparent alpha 
channel. Instead of a transparent skydome, it's just white where the 
transparent color is.


Sounds like you are using the wrong TexEnv (or applying it wrong in your 
shader, if not using FFP). Maybe you're using decal instead of modulate? 
You'd need to look it up in the blue book, I forget the exact formulas 
for each.

   -Paul

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


Re: [osg-users] [VPB] Usage question

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 7:54 AM, Sukender wrote:
 Hi all,
 
 I've got model tiles (urban zone, files such as .osg/ive, .3ds ...) which 
 need to be visualized using pagedLODs.
 Can VPB do with models what it does with terrain? That is to say, can VPB 
 help me in a way or another to:
 - Create less detailed version of the tiles? (Am I a bit optimistic?)
 - Arrange tiles under LODs/pagedLODs into a master file?
 - Deform tiles according to coordinates system? (I guess so, using OGR?)
 If answers are no, do you have an idea on how to acheive this goal?

  The answers, in my experience are no, no and no. ;)

  Can you clarify what your tiles are exactly? Are they a ground surface and 
building on
top of them?

  If so, I don't expect VPB would ever be able to do #1 for you. Creating lower 
LODs of
arbitrary geometry is sort of beyond its scope.

  #2 would be nice, but isn't done at this time. My experience is that the usual
work-around is to install callbacks on the PagedLOD load so that when a new 
VPB-created
terrain tile is loaded, your callback is invoked and can locate, load and 
attach any
cultural decorations like buildings and such.

  #3: OGR is probably way too slow to do this. There might be a way to 
translate your
model in advance into the same coordinate system VPB builds your data into 
(often
geographic lat/lon) and then employ a technique similar to osgTerrain::Locator 
to then
transform those coordinates into 3D space so that they come deformed the same 
way the
terrain tiles do. I believe it's the Locator that performs the Earth-curvature 
process.

 Thank you.
 Sukender
 PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Transparent skydome

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 8:53 AM, Dominic Stalder wrote:
 we use the skydome.osg of the OSG examples. Is it possible to make this
 one transparent, so that only the clouds are visible.
 We converted the skymap.jpg to a PNG file with a transparent alpha
 channel. Instead of a transparent skydome, it's just white where the
 transparent color is.
 Is it possible to make the skydome.osg transparent in the code and how?


  I think it should be possible. Did you actually set the state of the skydome 
to include
transparency (simply adding an Alpha texture doesn't do it, if I recall). Also, 
skydome is
often set to render FIRST in the scene, and transparent objects need to go into 
the
transparent bin so they are Z-sorted and rendered last in the scene. In this 
case, you
might want to have your skydome not sorted (a dome has no intersecting geometry 
to
required this) and have it render right after whatever you use to define the sky
background color.

  See: StateSet::setRenderBinDetails (and possibly StateSet::setRenderingHint)

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenGL capture/logging in OSG

2009-12-11 Thread Paul Martz

Responding to all three posts at once...

Chris 'Xenon' Hanson wrote:

  I think I've used glIntercept before and dfound it pretty useful. What was the
motivation in not building on it?


Lack of support for multiple threads, and no obvious way to add that 
support, was one reason for abandoning it. Also, when I attempted to use 
GLIntercept with (single threaded) OSG, I encountered problems as 
described recently in the discussion thread GLIntercept and OSG 2.8.2 
on this list, as if the device driver were launching its own internal 
thread that called back into itself.


As for BuGLe, there's an obvious bias towards Linux. Also a heavy third 
party dependency chain (my scheme would have no dependencies other than 
OSG plugins for optionally writing images). BuGLe also has its own 
debugging interface, whereas my system would allow the user to set 
breakpoints and collect backtraces using the debugger they are already 
familiar with, a much better solution IMO.


I think I've already addressed the performance and maintenance concerns 
in my first post. To recap, by default, OpenGL calls would go directly 
into OpenGL. As for maintenance issues, I'd argue that we already have 
them, and a system like I'm proposing would actually make it easier to 
add new OpenGL features and extensions, as well as add them in a unified 
and consistent way.


Anyhow, I just wanted to throw it out for consideration in case others 
were interested.

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


Re: [osg-users] [vpb] Usage question

2009-12-11 Thread Torben Dannhauer
Hi,

what is OGR?

I'm searching for a tool which can flat terrain (cut volume away, that 
surface is not geocentric but flat at this area) at a specified area for adding 
3D HiRes submodels.

your mention of OGR sounds interesting, what is it for a tool?

Thank you!

Cheers,
Torben

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





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


Re: [osg-users] OSG 2.9.6, cmake and QtWebKit config error.

2009-12-11 Thread Robert Osfield
Hi Ken,

Does QT_USE_WEBKIT get defined by cmake on your system?  I've just run
ccmake and and can't spot QT_USE_WEBKIT on my list at QT related
variables - I have cmake 2.6.2 installed.

I have QT_QTWEBKIT_INCLUDE_DIR listed, would using this work for you?

Robert.

On Fri, Dec 11, 2009 at 3:14 PM, Sewell, Kenneth R Civ USAF AFRL/RYZW
kenneth.sew...@wpafb.af.mil wrote:
 When trying to configure OSG 2.9.6, if the system doesn’t have QtWebKit
 installed cmake will not configure the examples.  Making the following
 change seems to fix it (at least on my Suse 11.0 box):



 IF (QT4_FOUND)

  ADD_SUBDIRECTORY(osgQtBrowser)

 ENDIF()



 changed to:



 IF (QT4_FOUND AND QT_USE_WEBKIT)

  ADD_SUBDIRECTORY(osgQtBrowser)

 ENDIF()







 -Ken.

 ___
 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] Transparent skydome

2009-12-11 Thread Dominic Stalder

Hi Paul

thanks for the answer, but I don't need any shader in my programm.

Regards
Dominic

Paul Martz schrieb:

Dominic Stalder wrote:

Hi there

we use the skydome.osg of the OSG examples. Is it possible to make 
this one transparent, so that only the clouds are visible.


We converted the skymap.jpg to a PNG file with a transparent alpha 
channel. Instead of a transparent skydome, it's just white where the 
transparent color is.


Sounds like you are using the wrong TexEnv (or applying it wrong in 
your shader, if not using FFP). Maybe you're using decal instead of 
modulate? You'd need to look it up in the blue book, I forget the 
exact formulas for each.

   -Paul

___
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] Transparent skydome

2009-12-11 Thread Dominic Stalder

How can I set the state to include transparency?

Chris 'Xenon' Hanson schrieb:

On 12/11/2009 8:53 AM, Dominic Stalder wrote:
  

we use the skydome.osg of the OSG examples. Is it possible to make this
one transparent, so that only the clouds are visible.
We converted the skymap.jpg to a PNG file with a transparent alpha
channel. Instead of a transparent skydome, it's just white where the
transparent color is.
Is it possible to make the skydome.osg transparent in the code and how?




  I think it should be possible. Did you actually set the state of the skydome 
to include
transparency (simply adding an Alpha texture doesn't do it, if I recall). Also, 
skydome is
often set to render FIRST in the scene, and transparent objects need to go into 
the
transparent bin so they are Z-sorted and rendered last in the scene. In this 
case, you
might want to have your skydome not sorted (a dome has no intersecting geometry 
to
required this) and have it render right after whatever you use to define the sky
background color.

  See: StateSet::setRenderBinDetails (and possibly StateSet::setRenderingHint)

  


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


Re: [osg-users] [vpb] Usage question

2009-12-11 Thread Gordon Tomlinson
http://www.osgeo.org/gdal_ogr

OGR is part of the GDAL project

OT: what happened to www.remotesensing.org ?



__
Gordon Tomlinson 

gor...@gordontomlinson.com IM: gordon3db...@3dscenegraph.com 
www.vis-sim.comwww.gordontomlinson.com 

__

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: Friday, December 11, 2009 4:54 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] Usage question

Hi,

what is OGR?

I'm searching for a tool which can flat terrain (cut volume away, that
surface is not geocentric but flat at this area) at a specified area for
adding 3D HiRes submodels.

your mention of OGR sounds interesting, what is it for a tool?

Thank you!

Cheers,
Torben

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





___
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] Usage question

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 9:54 AM, Torben Dannhauer wrote:
 Hi,
 what is OGR?

http://lmgtfy.com/?q=OGR

  ;)

 I'm searching for a tool which can flat terrain (cut volume away, that 
 surface is not geocentric but flat at this area) at a specified area for 
 adding 3D HiRes submodels.

  Are your models pieces of terrain, or are they buildings that sit atop the 
terrain the
simply need a flat piece of land to sit on?

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Transparent skydome

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 10:15 AM, Dominic Stalder wrote:
 How can I set the state to include transparency?

  Here's an example:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-June/029244.html

  You might be able to skip the rendering hint, and the backface cull will 
probably be
beneficial to you.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenGL capture/logging in OSG

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 9:46 AM, Paul Martz wrote:
 Lack of support for multiple threads, and no obvious way to add that
 support, was one reason for abandoning it. Also, when I attempted to use
 GLIntercept with (single threaded) OSG, I encountered problems as
 described recently in the discussion thread GLIntercept and OSG 2.8.2
 on this list, as if the device driver were launching its own internal
 thread that called back into itself.


  Makes sense. I always look for the widest opportunity to share technology 
with other
groups, so I wondered what glintercept's poison was that made it unsuitable.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Transparent skydome

2009-12-11 Thread Dominic Stalder

Hi Chris

I will try this, thanks a lot.

regards
Dominic

Chris 'Xenon' Hanson schrieb:

On 12/11/2009 10:15 AM, Dominic Stalder wrote:
  

How can I set the state to include transparency?



  Here's an example:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-June/029244.html

  You might be able to skip the rendering hint, and the backface cull will 
probably be
beneficial to you.

  


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


Re: [osg-users] [vpb] Usage question

2009-12-11 Thread Norman Vine


On Dec 11, 2009, at 12:24 PM, Gordon Tomlinson wrote:


http://www.osgeo.org/gdal_ogr

OGR is part of the GDAL project

OT: what happened to www.remotesensing.org ?


The server crashed a couple of years ago and while
rebuilding it, it was decided that www.osgeo.org was a better
home for the projects that remotesensing.org had been
hosting

e.g.  remotesensing.org was a project of the ossim team
whereas osgeo was a formal community

note remotesensing.org predates osgeo by several years

see
download.osgeo.org
trac.ossgeo.org
etc ...

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


Re: [osg-users] Hi, everyone! I've got one question about negative parallax stereo rendering.

2009-12-11 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

On 2009-12-11 03:35, HyeongCheol Kim wrote:

 Hi, Jan!
 Thanks again,
 but I wonder what appropriative coordinates means.

 I'm using trackball manuplator so I have been trying to get camera pointer 
 when I set stereo mode as HORIZONTAL_SPLIT.

 If I can get two camera pointer when I set stereo mode as HORIZONTAL_SPLIT 
 (left and right), I think that might be possible to change their focal length 
 to create nagative parallax stereo.

 Is it wrong?

 If my knowledge is too short as you think, haha;;
 I'm so sorry about that!


You certainly can get the focal length of the cameras (or rather their
projection matrices) by getting the osgViews from your viewer instance
and then fetching the cameras.

osg::Camera has a get/setProjectionMatrix methods. You can use that to
set up your camera frustums by hand.

However, even with the default settings, it is possible to get negative
disparity, just make sure that the stereo-related environment variables
are set correctly to match your setup. You can get the list of all
variables by typing:

osgviewer --help-env

and the variables you need are:

OSG_SCREEN_DISTANCE=2.0
OSG_SCREEN_HEIGHT=2.0
OSG_SCREEN_WIDTH=5.0
OSG_EYE_SEPARATION=0.06
OSG_STEREO_MODE=QUAD_BUFFER

These are the config for our VizWall, you need to customize them to
match your setup - mainly the screen size and viewer distance are
important (numbers are in meters), then the eye separation needs to
match the scale of your model (0.06 is 6cm).

The math behind is well explained here:
http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/stereographics/stereorender/

Regards,

Jan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD4DBQFLIqqGn11XseNj94gRApIpAKDAmS/uCZUmyEHDcU9UZjlHfRGZ4ACXXCiq
e8bIeOVJz0oADa1kDnecKg==
=clLa
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Large coords and _clampProjectionMatrix not applied

2009-12-11 Thread Martin Beckett
I've upgraded to 2.9.6 and done some more tests

With just vertex data it can handle large coordinates in the scans.
But fails if I also have marker and text components.

However that does work if I subtract off the large part of the coords and put 
that offset in a root level PAT, leaving all the children near 0,0.

My guess is that I'm somehow setting some part of the marker/text at 0,0,0 and 
it's the range of positions from 'large map coord' back to 0,0,0 that's 
overloading it.

I will do some more investigating.

Martin

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





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


Re: [osg-users] Hi, everyone! I've got one question about negative parallax stereo rendering.

2009-12-11 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2009-12-11 03:35, HyeongCheol Kim wrote:
 If my knowledge is too short as you think, haha;;
 I'm so sorry about that!

One more thing - the reason why I have pointed you to Paul Bourke's web
site (an excellent resource for anything graphics-related, btw!) is that
OSG is using the asymmetric frusta method for producing stereo.

Therefore you cannot use a simple focal length only to create the
frustum/projection matrix - that would give you symmetric frusta and
stereo only in the centre of the screen.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLIqw+n11XseNj94gRAsN2AKCNX5i523FGMl26ctSOshvU+0RJfgCg75rA
ElZO7wMv0gQsmaqvgTaTy88=
=AYcy
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Terrain generation question

2009-12-11 Thread Clay, Bruce
This is probably a dumb question but is there any rule of thumb or logic
to use when creating terrain databases of differing resolutions that
will reduce edge differences.

 

For example if I create a full world database from the Blue Marble
images and higher resolution local area database from NAIP 1 or 2 meter
images how should we decide the number of tile layers to limit the
transition effects?

 

Second question - has anyone used VirtualPlanetBuilder with 6in/pixel
rasters?  Will it work with a 1.8G SID file without choking?  I would
like to create a terrain dataset to support driving separate from the
flying dataset.

 

Bruce




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this 
 
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [vpb] Geocentric Database, how to flattening area or cut out piece

2009-12-11 Thread Torben Dannhauer
Hi,

I use a lowRes local database and want to add small 3D townmodels for local 
areas which require a completely flat underground. Unfortunately the global 
elevation model is not flat and not correct at the models area.

Is it possible to flatten the geocentric database at specific coordiantes, or 
cout out speciffic areas, so the gap can be refilled with a completely flat 
area?

What would be the best approach to get some areas flat? I don't know how to 
reach this goal at runtime or at compile time.



Thank you!

Cheers,
Torben

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





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


[osg-users] BuGLe (was: OpenGL capture/logging in OSG)

2009-12-11 Thread Paul Martz

Alberto Luaces wrote:

Another program worth for considering would be Bugle
(http://www.opengl.org/sdk/tools/BuGLe/).


Being thoroughly underwhelmed by OSG community interest in my proposal 
:-), I might take a second look at this.


Please tell me about your experience with BuGLe. Was it easy for you to 
build? What platform do you use it on? How does it handle multiple 
threads/contexts? How easy/hard is it to add support for new extensions 
or features?

   -Paul

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


Re: [osg-users] [vpb] Geocentric Database, how to flattening area or cut out piece

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 2:20 PM, Torben Dannhauer wrote:
 Hi,
 I use a lowRes local database and want to add small 3D townmodels for local 
 areas which require a completely flat underground. Unfortunately the global 
 elevation model is not flat and not correct at the models area.
 Is it possible to flatten the geocentric database at specific coordiantes, or 
 cout out speciffic areas, so the gap can be refilled with a completely flat 
 area?
 What would be the best approach to get some areas flat? I don't know how to 
 reach this goal at runtime or at compile time.

  I have been making enhancements to VPB and OSG to support this sort of 
deformation.
While my work is not complete, doing a trivial 
flatten-within-rectangular-region would not
be tough for you to implement.

  I have made changes to support VPB terrain elevation alteration during 
load/save
operations (through a pseudoloader) or during the initial VPB build time (via a 
callback).

  If this would work for you, I can explain more.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Terrain generation question

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 1:44 PM, Clay, Bruce wrote:
 This is probably a dumb question but is there any rule of thumb or logic
 to use when creating terrain databases of differing resolutions that
 will reduce edge differences.
 For example if I create a full world database from the Blue Marble
 images and higher resolution local area database from NAIP 1 or 2 meter
 images how should we decide the number of tile layers to limit the
 transition effects?

  I haven't had much luck with hiding the edges. I have done some magic to 
force the
high-res dataset to always render on top of the low-res one, which can work well
sometimes. I can write more if you are interested.

  Remind me which Ball location you're at again?

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Terrain generation question

2009-12-11 Thread Jason Beverage
Hi Bruce,

Take a look at osgEarth (http://www.osgearth.org) and see if it can help you
out.  osgEarth can composite multiple layers at runtime, so there is no need
to create a low-res base database and high-res inset databases.  This also
allows you to add/remove layers from your scene quite easily by just editing
a simple XML file or changing the layers through the API.

Let me know if you have any questions and I'll be glad to help you out.

Thanks!

Jason

On Fri, Dec 11, 2009 at 3:44 PM, Clay, Bruce bc...@ball.com wrote:

  This is probably a dumb question but is there any rule of thumb or logic
 to use when creating terrain databases of differing resolutions that will
 reduce edge differences.



 For example if I create a full world database from the Blue Marble images
 and higher resolution local area database from NAIP 1 or 2 meter images how
 should we decide the number of tile layers to limit the transition effects?



 Second question – has anyone used VirtualPlanetBuilder with 6in/pixel
 rasters?  Will it work with a 1.8G SID file without choking?  I would like
 to create a terrain dataset to support driving separate from the flying
 dataset.



 Bruce

 This message and any enclosures are intended only for the addressee.  Please
 notify the sender by email if you are not the intended recipient.  If you are
 not the intended recipient, you may not use, copy, disclose, or distribute 
 this
 message or its contents or enclosures to any other person and any such actions
 may be unlawful.  Ball reserves the right to monitor and review all messages
 and enclosures sent to or from this email address.


 ___
 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] Some overview of OSG and VPB databases

2009-12-11 Thread Paul Martz
Hi Chris -- One thing I've learned about PagedLOD... Even though it 
derives from LOD, it has a couple restrictions not present in the LOD 
base class. For example, there can only be one highest-res PagedLOD 
child, and its range can not overlap with other children. LOD allows 
this usage. So, PagedLOD is a LOD, but really it isn't. :-)


There might be more, I'm digging in my memory on this. These differences 
aren't noted in the PagedLOD header comments, but probably should be. 
Perhaps your entire set of notes should be added as a comment somewhere, 
perhaps the VPB source or the DatabasePager source? (Wikis tend to 
disappear but code lives on forever.)


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



Chris 'Xenon' Hanson wrote:

  Corrections, suggestions or comments very welcomed.



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


Re: [osg-users] [vpb] Geocentric Database, how to flattening area or cut out piece

2009-12-11 Thread Torben Dannhauer
Hi,

yes, a simple rectangular region would be enough.
Does your algorithm determine the height of your flattend area itself by the 
selected area, or do you specify a destination height and you lift/sink your 
rectangular area to this level?

I'm interested in both methods. Some models are always on, so in best case this 
flattening is compiled into DB to save rendering time. Additionally some models 
are inserted on demand on free coordinates, so this flattening would be great..

Is your feature closed source or is it planned to integrate it into VPB? 


Thank you very much!

Cheers,
Torben

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





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


Re: [osg-users] [vpb] Geocentric Database, how to flattening area or cut out piece

2009-12-11 Thread Chris 'Xenon' Hanson
On 12/11/2009 3:55 PM, Torben Dannhauer wrote:
 Hi,
 yes, a simple rectangular region would be enough.
 Does your algorithm determine the height of your flattend area itself by 
 the selected area, or do you specify a destination height and you lift/sink 
 your rectangular area to this level?
 I'm interested in both methods. Some models are always on, so in best case 
 this flattening is compiled into DB to save rendering time. Additionally some 
 models are inserted on demand on free coordinates, so this flattening would 
 be great..
 Is your feature closed source or is it planned to integrate it into VPB? 

  Well, the code I can release now is simply the 
what-elevation-should-I-put-here
callback for the loader/saver. It provides you with the location and current 
elevation and
you can return a new elevation. but, obviously for simple rectangular regions 
it's easy
for you to determine if you're within the rectangle and return a new elevation.

  In this case it would be more like your or do you specify a destination 
height and you
lift/sink your rectangular area to this level.

  I provided a .modifyterrain pseudoloader/saver a while ago, but I've had to 
modify it
since to avoid needing changes in the core OSG. I can probably provide a new 
version of it
shortly. At the present time, it has not been selected for inclusion in core 
OSG, so it
will probably make its home in some sort of osgTerrainTools add-on library.


  The deformation library that goes with this, that actually can answer the 
what-elevation
question given some number of area or line features and additional attributes 
is something
I'm developing for a client of mine, and the open-ness of it is an issue not 
yet fully
determined.

  If this is something your organization needs, maybe we could discuss 
cost-sharing on the
development.

 Cheers,
 Torben

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Hi, everyone! I've got one question about negative parallax stereo rendering.

2009-12-11 Thread HyeongCheol Kim
Hi, jan,
Thanks, a lot.
I don't know how to appreciate that, Thanks.

When I started how to use osg it was really difficult because there was no any 
reference book except for just function reference book.

I am a student in master degree in Korea and I have took lectures related to 
graphics, but I have been not good at applying the theory to application yet.

At first, when I tried to make negative parallax rendering, I red the article 
which you linked at previous post and I understood roughly how to do it.

So I have made an effort to change focal lengh.
According to your explaination, I think I have been misunderstanding something 
in nagative parallax.

I have been thinking the interoclur point in nagative parallax means two 
camera's intersection in perspective mode so I have tried to change focal 
lengh. But it look like just intersection of cameras' FOV as your explaination.

So you mean because OSG use just asymmetric frustum, just set some variables as 
you written and set object to have appropriative coordinate.

And VizWall might be projection plane.

I hope my understanding is right.
I'll try to do that right now! :)

Really Thanks,
you seem for me to find good teacher!




... 

Thank you!

Cheers,
HyeongCheol

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





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


Re: [osg-users] Clarification with regard to Dragger

2009-12-11 Thread Neil Clayton
Thank you. That does help. I will take a look at node masks and see what I come 
up with.

Cheers,
Neil

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





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


Re: [osg-users] Hi, everyone! I've got one question about negative parallax stereo rendering.

2009-12-11 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

On 2009-12-12 00:20, HyeongCheol Kim wrote:
 Hi, jan,
 Thanks, a lot.
 I don't know how to appreciate that, Thanks.
 
 When I started how to use osg it was really difficult because there
 was no any reference book except for just function reference book.
 

Actually there is a book published on OSG. I think that there is a link
on the website. There are also quite a few tutorials and examples
available as well.

 I have been thinking the interoclur point in nagative parallax means
 two camera's intersection in perspective mode so I have tried to
 change focal lengh. But it look like just intersection of cameras'
 FOV as your explaination.

I am not sure what you mean by interoclur point. The camera optical
axes are parallel for proper stereo, they do not intersect. Only the
frusta do. If your optical axes intersect (the cameras are turned
towards each other), you are doing the toe-in stereo, which is
incorrect and causes eye strain.


 So you mean because OSG use just asymmetric frustum, just set some
variables as you written and set object to have appropriative coordinate.

No, what I meant is that if you start fiddling with the projection
matrices and set them based only on focal length, you will get symmetric
frusta - if your cameras are parallel, parts of the screen will not be
in stereo, because the frusta will not overlap completely (see the
description and illustrations on Bourke's web site - it is pretty
self-explanatory).

The environment variables were mentioned because you can achieve what
you want without going deep into OSG - what you want is a completely
standard setup. It will work without doing anything, just set the size
of the screen and the viewer distance from it correctly.

 And VizWall might be projection plane.

VizWall is actually this:
http://www.cyviz.com/cyviz/public/openIndex?ARTICLE_ID=108

That is the setup the settings I gave you were for.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLIwqIn11XseNj94gRAgPZAJ4gh2ObJjk+5NL4b7Mix0wSL/IBkQCg3Kjn
ppu1q4QAMf130jiOpl9hcGg=
=/4jr
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG on IPhone

2009-12-11 Thread Thomas Hogarth

 I commited a fix for the bounding box computation. It should fix your
 problem. Could you update and have a try ?


Hi Cedric

Had a chance to try your new changes, seems to have worked a treat. Much
appreciated. Whilst I'm here I was wondering if you had any advise regarding
the best approach to getting skinned models into OSG. I'm currently using a
beta version of the osg exporter for 3DS Max, which supports export of
skinning infomation. If i have any spare time I may try to help improve it,
but was wondering if you already new of a better approach?

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


Re: [osg-users] OSG on IPhone

2009-12-11 Thread Cedric Pinson
Hi Thomas,

I dont know in which state is the 3ds max osg exporter. I use the osg
exporter for blender, i maintain it and use it. Examples from osg-data
comes from blender so it's a working path and the one i use.
In futur there will be a collada that will support osgAnimation but not
yet ready.


Cheers,
Cedric

-- 
Provide services around OpenSceneGraph
+33 659 598 614 Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Sat, 2009-12-12 at 06:09 +, Thomas Hogarth wrote:
 I commited a fix for the bounding box computation. It should
 fix your
 problem. Could you update and have a try ?
 
 
 
 Hi Cedric
 
 
 Had a chance to try your new changes, seems to have worked a treat.
 Much appreciated. Whilst I'm here I was wondering if you had any
 advise regarding the best approach to getting skinned models into OSG.
 I'm currently using a beta version of the osg exporter for 3DS Max,
 which supports export of skinning infomation. If i have any spare time
 I may try to help improve it, but was wondering if you already new of
 a better approach?
 
 
 Cheers
 Tom
 


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org