Re: [osg-users] post-rendering warping and off-axis projection

2012-08-20 Thread Torben Dannhauer
Hi,

you can also have a look at osgvisual.org, we are currently working on a new 
distortion framework w'll submit once it is finished. We have already a 6 
channel helicopter simulator with a specrical screen working with that 
software, only the manual setup via mouse is not working yet.

Here are some images:

http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG1.jpg
http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG2.jpg
http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG3.jpg

The CiGi-Module for multichannel communication is under construction currently, 
we hope to finish this autumn.

Do you want to use vertex distortion of the Mesh, textureCoordinate distortion 
of the RTT-Output or pixel wise distortion?


Cheers,
Torben

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





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


[osg-users] OSG Serialization - changes on custom Classes

2012-08-20 Thread Peter Bako
Hello guys,

I am using OSG serialization on my custom classes derived from 
osg::MatrixTransform and osg::Geometry.
I already use this serialization for some time, so I have many .osgb files 
exported on my disk, but now, I want to add some new properties to my Class and 
serialize them (new ADD_BOOL_SERIALIZER). The problem is, that I cannot load 
the old .osgb files anymore. It works only on .osgt files.
Is there any way, how to extend my serialization, while the old files will be 
still loadable?

Thank you!

Cheers,
Peter

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





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


[osg-users] osgDB::readNodeFile returning null after an excessive amount of calls

2012-08-20 Thread Zach
Hello,

I am having a image/node loading problem that I really hope someone can help me 
with. I am using osgDB::readNodeFile and osgDB::readImageFile a LOT of 
times during the life time of the program I am working in.  Along side those I 
setup a osgDB::ReaderWriter::Options and set it to cache everything, and I 
pass that as the second param for the read file calls. I always store returned 
nodes as a ref_ptrosg::Node.

Now, the problem is after a certain amount of reads I get this error in the 
console window ... PNGwriter::readfromfile - ERROR **: Too many open files 
... that followed by more errors saying it can't open the file. After I start 
getting that error the readNodeFile/readImageFile calls all return NULL.

How do if fix this? Has anyone come across this error? Is there any more 
information that would be useful to help figure this out? I am afraid I can't 
share the source code.

Thanks for the reading this, and thanks for any help.

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





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


Re: [osg-users] [build] [Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10

2012-08-20 Thread Jeff Bienstadt
Greetings.

Has anyone actually managed to build the ExampleGLES1 sample for Android? If 
so, what magic incantations did you invoke to achieve that goal?

Following this tutorial, I have managed to get osgSceneGraph itself to build, 
but when I get the the point of attempting to build the sample and run 
ndk-build, I get compiler errors --- perfectly reasonable ones -- when 
compiling osgNative.cpp. There are several calls to env-GetStringUTFChars that 
pass the keyword 'false' when a pointer to a jboolean is expected. That's gonna 
result in a compiler error every time.

If I edit the offending file and change false to NULL in all the right places, 
it compiles but i later end up with a slew of linker errors indicating 
undefined references to

   std::type_info::before(std::type_info const) const

I'm attempting this on Linux (openSUSE 12). Myself, I am mostly a Windows C++ 
developer.

Any assistance, hints, or magic words would be greatly appreciated.

Thank you!

Jeff

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





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


[osg-users] Evaluation of OpenSceneGraph as scene graph library for embedded devices

2012-08-20 Thread Frank Schmidt
Hi,
   we are currently evaluating scene graph libraries for an application in the 
CAD/Engineering domain, which shall run on embedded devices.
   We would like to visualize data (points, polylines, digital terrain models 
(DTMs), point clouds) in 2D and 3D views. The estimated amount of data is:
   - number of points:  5.000 (worst case: 200.000); visualized with a texture
   - number of polylines:  5.000 (worst case: 100.000)
   - number of vertices per polyline: ~10
   - number of triangles in DTMs:  100.000 (worst case: 1.000.000)
   - number of points in point clouds:  100.000 (worst case: 500.000); 
visualized as 1 pixel per point
   - number and size of textures: negligible
   
   We have to render mainly wire frame. Triangles half-transparent with lights 
for a better visualization. Good performance is a must. A good visual 
user-experience is important (anti-aliasing, stippled lines). There is no need 
for physics, sounds, materials, etc.
   
   Platform:
   - OS: Windows EC7
   - Rendering API: OpenGL ES 2.0 (we have HW acceleration)
   - RAM: 50...100 MB available for scene graph and rendering
   - Screen size: WVGA (800 x 480)
   - Floating Point Unit (FPU) available
   
   The scene graph library has to be portable to:
   - OS: WinCE 6.0, Windows 8 RT, Android
   - Rendering API: any
   - RAM: 50...100 MB available for scene graph and rendering
   - Screen size: VGA (640 x 480) ... WSVGA (1024 x 600)
   
   
   Questions:
   - Do you think the requirements could be fulfilled by this scene graph 
library?
   - What are the biggest challenges you see?
   - Is there a company offering consultancy, customization and support 
services for this library?
... 

Thank you!

Cheers,
Frank

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





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


[osg-users] [3rdparty] osg and collada

2012-08-20 Thread Nikos Patsiouras
Hi,

I'm a student currently in the process of finishing my bachelor thesis.at this 
point i have to code a bit in osg to open a .dae file with a rigged and skinned 
character.
So i've already built OSG 3.0.1 in VS2010 but now i have to build the collada 
plugin too since there's no reader to read from the .dae.

i've done things the way the compiling with VS tutorial says in 
openscenegraph_com documentation.

can someone tell me what i need to do?where to find the collada plugin what 
with the old site down almost all the time...

i'm sorry if this has been asked before but i've searched a bit and found 
nothing and i'm kind of time pressed. 


Thank you!

Cheers,
Nikos

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





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


Re: [osg-users] [build] OSG 3.1.2, MacOSX 10.6, CMAKE 2.8.8 Error

2012-08-20 Thread Panther Martin
Hi, I'm curious why this has no replies.  I seem to be experiencing similar 
issues on MacOSX 10.8 Mountain Lion.  I'll make a complete report including all 
logs shortly.  Thank you!

Cheers,
nibbles

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





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


Re: [osg-users] osgDB::readNodeFile returning null after an excessive amount of calls

2012-08-20 Thread Robert Osfield
Hi Zach,

The OSG plugins should be closing handles to files once they have
finished read or writing to them, if they aren't then this is a bug
that needs to be addressed.  As others haven't reported the error you
are seeing I would have expected the plugins mostly behave themselves
correctly with respecting to closing handles to files, so perhaps it's
one specific plugin that is a problem, or perhaps something else in
your application is not releasing file handles, or perhaps your OS has
been configured with a small maximum number of file handles.

You say a LOT of times, could you be specific?  Can you recreate the
problem in a small test program?

Robert.



On 18 August 2012 17:06, Zach zachlen...@gmail.com wrote:
 Hello,

 I am having a image/node loading problem that I really hope someone can help 
 me with. I am using osgDB::readNodeFile and osgDB::readImageFile a LOT of 
 times during the life time of the program I am working in.  Along side those 
 I setup a osgDB::ReaderWriter::Options and set it to cache everything, and 
 I pass that as the second param for the read file calls. I always store 
 returned nodes as a ref_ptrosg::Node.

 Now, the problem is after a certain amount of reads I get this error in the 
 console window ... PNGwriter::readfromfile - ERROR **: Too many open files 
 ... that followed by more errors saying it can't open the file. After I start 
 getting that error the readNodeFile/readImageFile calls all return NULL.

 How do if fix this? Has anyone come across this error? Is there any more 
 information that would be useful to help figure this out? I am afraid I can't 
 share the source code.

 Thanks for the reading this, and thanks for any help.

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





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


[osg-users] Is it possible to do boolean operations with objects (primitives)?

2012-08-20 Thread Andrey Zubarev
Hi all!

Is it possible to do some kind of boolean operations with simple objects like 
primitives? Say, there are a sphere and a cylinder, that intersects this 
sphere. Can we subtract a cylinder from this sphere?

Thank you!

Cheers,
Andrey

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





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


[osg-users] Transparent objects distorsion

2012-08-20 Thread Andrey Zubarev
Hi, all!

I have a problem with transparent objects. In the code (please, see attached 
file) there is a red (opaque) sphere inside a yellow (transparent) capsule. But 
when the capsule rotates, some kind of distorsions appear on it... Is it 
possible to avoid these distorsions? How?

Thank in advance.

Cheers,
Andrey

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




Attachments: 
http://forum.openscenegraph.org//files/transparentcapsule_402.cpp


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


Re: [osg-users] Is it possible to do boolean operations with objects (primitives)?

2012-08-20 Thread Peter Bako
Hi,

This is not possible to do with native osg function. What you say, is an 
operation on Solid models, osg scene is mainly vertices and triangles, there 
is no information about volume.

If you want to do this, try OpenCASCADe. It is also free, but there is a little 
documentation about it and its a very complex library I think.

Thank you!

Cheers,
Peter

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





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


[osg-users] Problem with loading 3d-models with asian characters in file name.

2012-08-20 Thread Carsten Scharfe
Hi,

I hope somebody can help me out with this nasty problem.

I try to load model file (e.g. a collada file) which has some asian characters 
in its file name.
Although I’ve compiled Osg with OSG_USE_UFT8_FILENAME set to true, no model is 
loaded.
osgDB::readNodeFile just returns an empty node as result, saying that the file 
was not found.

A filename like E:\3dlibnew\$龙\龙.dae is received as E:\3dlibnew\$?\?.dae even 
in our
own application.

Do I need to do additional conversions?
Please help me. Any advice is welcome.

I’m using Osg 3.0 on Win7.

Regards,
Carsten


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


Re: [osg-users] Problem with loading 3d-models with asian characters in file name.

2012-08-20 Thread Wang Rui
Hi Carsten,

The OSG_USE_UFT8_FILENAME option actually doesn't work with Asian directory
names, unless your source files are also UTF8. Sometimes I use the
setlocale() function at the beginning of an application to choose current
machine's locale, like the following:

std::locale::global( std::locale(, std::locale::all ^
std::locale::numeric) );

Or directly select the Simplified Chinese locale:

setlocale( LC_ALL, .936 );

Hope it helps. BTW, I found the latest OSG works well with Chinese
directories and filenames. Maybe you could give it a try again.

Wang Rui


2012/8/20 Carsten Scharfe cscha...@dspace.de

  Hi,

 I hope somebody can help me out with this nasty problem.

 I try to load model file (e.g. a collada file) which has some asian
 characters in its file name.
 Although I’ve compiled Osg with OSG_USE_UFT8_FILENAME set to true, no
 model is loaded.
 osgDB::readNodeFile just returns an empty node as result, saying that the
 file was not found.

 A filename like E:\3dlibnew\$龙\龙.dae is received as E:\3dlibnew\$?\?.dae
 even in our
 own application.

 Do I need to do additional conversions?
 Please help me. Any advice is welcome.

 I’m using Osg 3.0 on Win7.

 Regards,
 Carsten



 ___
 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] Problem with loading 3d-models with asian characters in file name.

2012-08-20 Thread Sergey Polischuk
Hi just guessing: may be it have something to do with current std::locale set? Cheers. 20.08.2012, 16:23, "Carsten Scharfe" cscha...@dspace.de:Hi, I hope somebody can help me out with this nasty problem. I try to load model file (e.g. a collada file) which has some asian characters in its file name.Although I’ve compiled Osg with OSG_USE_UFT8_FILENAME set to true, no model is loaded.osgDB::readNodeFile just returns an empty node as result, saying that the file was not found. A filename like E:\3dlibnew\$龙\龙.dae is received as E:\3dlibnew\$?\?.dae even in ourown application. Do I need to do additional conversions?Please help me. Any advice is welcome. I’m using Osg 3.0 on Win7. Regards,Carsten  ___osg-users mailing listosg-users@lists.openscenegraph.orghttp://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] Safe downcast

2012-08-20 Thread Peterakos
Hello.

In the example osganimationviewer in main there is the following line:
osg::Group* node =
dynamic_castosg::Group*(osgDB::readNodeFiles(arguments));

How safe is this if i use only 1 model in arguments and it is not Group ?

Thank you for your time.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-08-20 Thread Wang Rui
Hi Peter,

Yes, there is a schema mechanism in the osg plugin which could record a
serializer name list (a schema) at the beginning of every .osgb file and
the reader will automatically check and read the schema to decide each
serializer order and existence.

For your situation, the best way I think is to generate a schema file first
using the option:
writeNodeFile(*node, file.osgb, new
osgDB::Options(SchemaFile=old_version_format.txt));

This could be done only once when you save a .osgb file. Note that the
schema file should be created with the old version of plugin.

And then you may read all old .osgb files with the new version of plugin,
using the same option:
readNodeFile(file.osgb, new
osgDB::Options(SchemaFile=old_version_format.txt));

And the schema will be used to load old version files correctly.

Wang Rui


2012/8/20 Peter Bako osgfo...@tevs.eu

 Hello guys,

 I am using OSG serialization on my custom classes derived from
 osg::MatrixTransform and osg::Geometry.
 I already use this serialization for some time, so I have many .osgb files
 exported on my disk, but now, I want to add some new properties to my Class
 and serialize them (new ADD_BOOL_SERIALIZER). The problem is, that I cannot
 load the old .osgb files anymore. It works only on .osgt files.
 Is there any way, how to extend my serialization, while the old files will
 be still loadable?

 Thank you!

 Cheers,
 Peter

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





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

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


Re: [osg-users] osg(terrain) krasches on a double delete

2012-08-20 Thread Ola Nilsson

Bump. I would really appreciate some info on this problem.

The double delete originates from the DatabasePager, but the destruction  
of these objects should be safe(ref counted as well as threadsafe)  
shouldn't it? I would be grateful if someone could take a look at the  
stacktrace (prev post, below) and see if there is anything suspicious  
going on.


Cheers,

Ola


On Fri, 10 Aug 2012 11:01:49 +0200, Ola Nilsson o...@weatherone.tv wrote:


I have now also reproduced the crash on darwin/osx in i386 mode.

Cheers,

Ola


On Thu, 09 Aug 2012 17:41:12 +0200, Ola Nilsson o...@weatherone.tv  
wrote:



Here is some more info on how to reproduce our crash.

1. Compile the attached osgterrain program by overwriting
examples/osgterrain/osgterrain.cpp and recompile.
2. Run the program with
http://www.openscenegraph.org/data/earth_bayarea/earth.ive as input.
3. Wait (no further input is necessary). However, camera movement (tile
loading) produces earlier crashes. The attached image shows performance  
of

a typical run (without user input) where the frame time cyclically
increases until the program crashes.

Cheers,

Ola

ps. The output from the program is: iteration sample_ratio frame_time



On Tue, 07 Aug 2012 11:59:00 +0200, Ola Nilsson o...@weatherone.tv  
wrote:



Hi,

We have been looking for a hard-to-reproduce crash in our software that
seems to originate from a double delete inside osg. I have (finally)
been able to reproduce the crash using a version of the
osgterrain-example that _exaggerates_ the usage pattern that crashes  
our

application.

In examples/osgterrain.cpp remove return viwer.run(); an exchange it
with:

   while(!viewer.done())
 {
osg::Timer_t start_tick = osg::Timer::instance()-tick();
float sr = rand() * 1.0 / RAND_MAX ;
std::cerr  sr;

viewer.getCamera()-setLODScale(sr*10);
terrain-setSampleRatio( sr );   

osg::Timer_t middle_tick = osg::Timer::instance()-tick();

std::cerr  osg::Timer::instance()-delta_m(start_tick, middle_tick)
 std::flush;

viewer.frame();
std::cerr  ' '  osg::Timer::instance()-delta_m(middle_tick,
osg::Timer::instance()-tick())  std::endl;
 }
   return 0;

When run (tested on ive earth models generated with osgdem) the frame
time slowly increases, and, after a while, it warns about deleting a
still referenced object and then (after arbitrary time) crashes with a
glibc error.

Is this usage (setLODScale + setSampleRatio) safe? If not how should
these functions be called?

If it's a bug, we would be _very_ happy to have it fixed or pointers
about where to look in the code. We've previously submitted a patch  
that

switched to a ReentrantMutex in osgTerrain/Terrain.cpp (changeset
12904), could this be a similar issue?

My system is running Centos 6.3 (x86_64) and I compiled osg in debug
mode with gcc 4.4.6. I have tested both against the 3.0.1 tag and trunk
(r13106).

Since I suspect a threading issue; OpenThreads/Config looks like this:
#define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
/* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */
/* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */
/* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */
/* #undef OT_LIBRARY_STATIC */

If I set a break point in the warning for deleting still referenced I
get the following stack trace (using the osg 3.0.1 tag):

Breakpoint 1, osg::Referenced::~Referenced (this=0xaec2160,
__in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236
236 OSG_WARNWarning: deleting still referenced object
this of type 'typeid(this).name()'std::endl;
(gdb) bt
#0  osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value
optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236
#1  0x779e467c in osg::Object::~Object (this=0xaec2160,
__in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Object.cpp:45
#2  0x779dd71d in osg::Node::~Node (this=0xaec2160,
__in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Node.cpp:94
#3  0x77993953 in osg::Group::~Group (this=0xaec2160,
__in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Group.cpp:53
#4  0x75df4ae8 in osgTerrain::TerrainTile::~TerrainTile
(this=0xaec2160, __in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95
#5  0x75df4b1e in osgTerrain::TerrainTile::~TerrainTile
(this=0xaec2160, __in_chrg=value optimized out) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95
#6  0x77a131a6 in osg::Referenced::signalObserversAndDelete
(this=0xaec2160, signalDelete=true, doDelete=true) at
/home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:323
#7  0x0040b07d in osg::Referenced::unref (this=0xaec2160) at

Re: [osg-users] Possibility of an OSG bot

2012-08-20 Thread Sterling Somers
I've been away from the project for a while but am back.

I have used the PolytopeIntersector and am iterating through the hits. What I'd 
like to do now is to avoid duplicate hits.  If I can't avoid duplicate hits, I 
suppose I can just make a non-duplicating list of hits? 

Also, now that I can explore the graph based on hits, I would like to build a 
way of exploring my results, so I know what things I'm intersecting with. One 
thing I've been looking to do is figure out if a group node is a subgraph and 
to find out what it's filename is but I can't find a way to do that... thought 
osgDB would have something like that.   

Thank you!

Sterling

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





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


Re: [osg-users] osg(terrain) krasches on a double delete

2012-08-20 Thread Robert Osfield
Hi Ola,

On 20 August 2012 16:29, Ola Nilsson o...@weatherone.tv wrote:
 The double delete originates from the DatabasePager, but the destruction of
 these objects should be safe(ref counted as well as threadsafe) shouldn't
 it? I would be grateful if someone could take a look at the stacktrace (prev
 post, below) and see if there is anything suspicious going on.

I have just tried your modified osgterrain and it crashes for me with
a seg fault during the update traversal.  I am just doing a debug
build to see if this reveals anything more useful.

While the usage your modified osgterrain shouldn't cause a crash it's
certainly not the way I would recommend anyone to use osgTerrain - the
setSampleRatio() feature is meant to be set once in an application
rather than thrashed continuously as changing the same ratio forces a
rebuild of the terrain geometry.  The Camera::setLODScale() is however
a light weight operation without any performance or stability
consequences and can be changed every frame without problem.

The question has to be why you are changing the Terrain SampleRatio.

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


Re: [osg-users] Safe downcast

2012-08-20 Thread Jason Daly

On 08/20/2012 09:00 AM, Peterakos wrote:

Hello.

In the example osganimationviewer in main there is the following line:
osg::Group* node = 
dynamic_castosg::Group*(osgDB::readNodeFiles(arguments));


How safe is this if i use only 1 model in arguments and it is not Group ?


osgDB::readNodeFiles inserts a group at the root if there's more than 
one model loaded, but not when only a single model is loaded.  There's a 
(rather slim) chance that your one model might not contain a Group (or 
Group descendant) at the root and that the dynamic_cast would result in 
a NULL.  If you wanted to be absolutely sure, you could put in a check 
for this.


Practically, almost every useful model (especially models with 
animations) will have some kind of group at its root.


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


[osg-users] Extensions/State Update Question

2012-08-20 Thread Jeremy Moles
Hello everyone! I have a bit of a strange question here, so please bear
with me. I'll try to be as descriptive as I possibly can, though I'm
certain I will misuse some terminology.

I am adding support for the NV_path_rendering extension to
OpenSceneGraph. This extension adds a number of new functions to OpenGL
when using an NVidia card which take on the form:

glPath{_function_}NV

http://osgnvpr.googlecode.com

In order to create pointers to these new extension functions, I create
an Extensions object in OSG using the contextID given to me during the
compileGLObjects method of my overridden Drawable class. This works
fine, and the code is running as I expect.

https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45

HOWEVER, this paradigm really only works when I need to call extension
functions associated with an instance (or instances) of my Drawable.
There are other functions in the NV_path_rendering API that simply set
global state, and it is with these functions that I'm having difficulty.

The biggest problem here is that in order to get a pointer to the
Extensions static object, I need a valid GraphicsContext contextID.
However, I've tried a number of methods to obtain one of these, but
every attempt I make actually breaks the entire codebase. I wish I could
explain it better than that...

For example, if I try to use some code like the following:



Windows windows;

viewer.getWindows(window);

cID = windows[0]-getState()-getContextID();

osgNVPR::getNVPRExtensions(cID);

-

...then I seem to get an invalid contextID and all subsequent attempts
to use that contextID (even by OSG itself) won't work. The entire
rendering process seems to be broken in this manner.

If instead I create a Camera::DrawCallback object and use the RenderInfo
there instead, then everything works fine. However, I feel like I'm
grossly misusing a Camera::DrawCallback just to set and unset state...

My question is: if I need to set global state like this once, somewhere
high in the scenegraph, what is the best way--keeping in mind that I
also need a valid contextID in order to access my Extensions functions
per-context?

Thanks!

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


Re: [osg-users] post-rendering warping and off-axis projection

2012-08-20 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Torben,

That's good news about the CiGi module. If this gets completed, I will
be very interested in looking at osgVisual for our host.

On the distortion correction, is there really any need for pixel level
distortion? That would seem very expensive. I would think that
textureCoodinate distortion is more than sufficient with a reasonable
mesh resolution. I haven't seen the need for pixel level distortion in a
spherical dome display.

Does osgVisual support an interface for providing asymmetric viewing
frustums for each channel? What I mean by this is can I specify the
clipping bounds (i.e. rotation, widening or shrinking) for each channel
frustum so that I can effectively tile the channels in a dome display
optimally?

How does osgVisual deal with edge blending of the channels or do you
rely on the projectors to do this?

Thanks,
-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben
Dannhauer
Sent: Monday, August 20, 2012 1:15 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] post-rendering warping and off-axis projection

Hi,

you can also have a look at osgvisual.org, we are currently working on a
new distortion framework w'll submit once it is finished. We have
already a 6 channel helicopter simulator with a specrical screen working
with that software, only the manual setup via mouse is not working yet.

Here are some images:

http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG
1.jpg
http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG
2.jpg
http://www.osgvisual.org/projects/osgvisual/chrome/site/img/distortionNG
3.jpg

The CiGi-Module for multichannel communication is under construction
currently, we hope to finish this autumn.

Do you want to use vertex distortion of the Mesh, textureCoordinate
distortion of the RTT-Output or pixel wise distortion?


Cheers,
Torben

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





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


Re: [osg-users] OSG application on Microsoft Surface table?

2012-08-20 Thread Helen Wang
Hi J-S, Hi  Frank,

Many thanks for your reply. 

I did some further exploration about WPF. It is quite handy to use WPF to 
deveop multi-touch application as MS Surface SDK provides some useful WPF 
controls. However, In WPF there is only one HWND for the application.  It may 
be ok to embed an OpenGL application into a WPF interface but no touch event 
can be captured.  

Yes, I agree with you that it should be possible to use APIs provided by MS 
Surface SDK 2.0's core layer to develop multitouch support for OSG 
applications. But I need to explore the difficulty first and make the decsion 
based on cost-effectivness. And of course my boss has the final say.

Best,
Helen.
 


   



Cheers,
Helen

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





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


Re: [osg-users] osg(terrain) krasches on a double delete

2012-08-20 Thread Robert Osfield
Hi Ola,

I've been doing a code review of Terrain and TerrainTile looking at
how deletion of TerrainTile will affect the internal TerrainTile
pointers held in Terrain that track all the tiles.  There internal
TerrainTile pointers in Terrain are protected by a reentrant mutex but
I believe a problem can occur when the TerrainTile destructor calls
Terrain::unregisterTerrainTile(TerrainTile*) when at the same time the
Terrain::traverse(NodeVisitor) method is taking a copy of the
_updateTerrainTileSet, when this occurs the update traversal would
increment the ref count on an TerrainTile being destructed by the
DatabasePager thread that is cleaning up expired tiles.

This issue boils down to attempt to make a thread safe list
TerrainTile observers in Terrain that doesn't quite achieve what it
intends.  I haven't thought deeply enough about the issue yet to know
what the best solution will be.  My head isn't quite into zone that
will allow me to solve this one so I'll have to come back to it at a
later date.  A short term solution would be set the pager so that it
doesn't delete objects in a background pager thread via
DatabasePager::setDeleteRemovedSubgraphsInDatabaseThread(false), this
won't fix the thread safety issue but will at least prevent the
particular instance where the update traversal is occurring at the
same time as the deletion of TerrainTile.

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


Re: [osg-users] Extensions/State Update Question

2012-08-20 Thread Paul Martz
What you seem to be saying is that you want to set some OpenGL state once that 
applies to all contexts, and not have to set it every frame. AND, you don't want 
to have to add, then remove, a Camera draw callback just to make this happen). 
Is that a good synopsis of the issue?


You could keep a bool buffered_value that tells you whether or not you've set 
the initial/global state for that particular context. Initially false, then set 
the global state for a context and flip it to true. Would something like that help?

   -Paul


On 8/20/2012 10:27 AM, Jeremy Moles wrote:

Hello everyone! I have a bit of a strange question here, so please bear
with me. I'll try to be as descriptive as I possibly can, though I'm
certain I will misuse some terminology.

I am adding support for the NV_path_rendering extension to
OpenSceneGraph. This extension adds a number of new functions to OpenGL
when using an NVidia card which take on the form:

glPath{_function_}NV

http://osgnvpr.googlecode.com

In order to create pointers to these new extension functions, I create
an Extensions object in OSG using the contextID given to me during the
compileGLObjects method of my overridden Drawable class. This works
fine, and the code is running as I expect.

https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45

HOWEVER, this paradigm really only works when I need to call extension
functions associated with an instance (or instances) of my Drawable.
There are other functions in the NV_path_rendering API that simply set
global state, and it is with these functions that I'm having difficulty.

The biggest problem here is that in order to get a pointer to the
Extensions static object, I need a valid GraphicsContext contextID.
However, I've tried a number of methods to obtain one of these, but
every attempt I make actually breaks the entire codebase. I wish I could
explain it better than that...

For example, if I try to use some code like the following:



Windows windows;

viewer.getWindows(window);

cID = windows[0]-getState()-getContextID();

osgNVPR::getNVPRExtensions(cID);

-

...then I seem to get an invalid contextID and all subsequent attempts
to use that contextID (even by OSG itself) won't work. The entire
rendering process seems to be broken in this manner.

If instead I create a Camera::DrawCallback object and use the RenderInfo
there instead, then everything works fine. However, I feel like I'm
grossly misusing a Camera::DrawCallback just to set and unset state...

My question is: if I need to set global state like this once, somewhere
high in the scenegraph, what is the best way--keeping in mind that I
also need a valid contextID in order to access my Extensions functions
per-context?

Thanks!

___
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] Extensions/State Update Question

2012-08-20 Thread Jeremy Moles
On Mon, 2012-08-20 at 10:44 -0600, Paul Martz wrote:
 What you seem to be saying is that you want to set some OpenGL state once 
 that 
 applies to all contexts, and not have to set it every frame. AND, you don't 
 want 
 to have to add, then remove, a Camera draw callback just to make this 
 happen). 
 Is that a good synopsis of the issue?

It's close; I don't actually mind using a Camera draw callback for this
purpose if it's appropriate.

A real summarizing question is: under what conditions is it safe to
query for support of a particular extension? And what is the preferred
API for either fetching or being provided the contextID with which to do
this?

 You could keep a bool buffered_value that tells you whether or not you've set 
 the initial/global state for that particular context. Initially false, then 
 set 
 the global state for a context and flip it to true. Would something like that 
 help?
 -Paul

Certainly, but I'm still stuck on actually SETTING the state in the
first place. :)

 On 8/20/2012 10:27 AM, Jeremy Moles wrote:
  Hello everyone! I have a bit of a strange question here, so please bear
  with me. I'll try to be as descriptive as I possibly can, though I'm
  certain I will misuse some terminology.
 
  I am adding support for the NV_path_rendering extension to
  OpenSceneGraph. This extension adds a number of new functions to OpenGL
  when using an NVidia card which take on the form:
 
  glPath{_function_}NV
 
  http://osgnvpr.googlecode.com
 
  In order to create pointers to these new extension functions, I create
  an Extensions object in OSG using the contextID given to me during the
  compileGLObjects method of my overridden Drawable class. This works
  fine, and the code is running as I expect.
 
  https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45
 
  HOWEVER, this paradigm really only works when I need to call extension
  functions associated with an instance (or instances) of my Drawable.
  There are other functions in the NV_path_rendering API that simply set
  global state, and it is with these functions that I'm having difficulty.
 
  The biggest problem here is that in order to get a pointer to the
  Extensions static object, I need a valid GraphicsContext contextID.
  However, I've tried a number of methods to obtain one of these, but
  every attempt I make actually breaks the entire codebase. I wish I could
  explain it better than that...
 
  For example, if I try to use some code like the following:
 
  
 
  Windows windows;
 
  viewer.getWindows(window);
 
  cID = windows[0]-getState()-getContextID();
 
  osgNVPR::getNVPRExtensions(cID);
 
  -
 
  ...then I seem to get an invalid contextID and all subsequent attempts
  to use that contextID (even by OSG itself) won't work. The entire
  rendering process seems to be broken in this manner.
 
  If instead I create a Camera::DrawCallback object and use the RenderInfo
  there instead, then everything works fine. However, I feel like I'm
  grossly misusing a Camera::DrawCallback just to set and unset state...
 
  My question is: if I need to set global state like this once, somewhere
  high in the scenegraph, what is the best way--keeping in mind that I
  also need a valid contextID in order to access my Extensions functions
  per-context?
 
  Thanks!
 
  ___
  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


Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem

2012-08-20 Thread Garrett Cope
Hi Wojtek, 

Thanks for replying.

The projection matrix at the points you mention matches what it is in my main 
app. I also set do_not_compute for the near/far planes on the main camera but 
didn't find any difference.

If I understand the clipping correctly, it's just a polytope representing the 
bounds of the shadow cut by a unit bounding box transformed by the main camera 
projection matrix. This means that either the shadow bounds calculation is 
wrong or my fundamental projection matrix is wrong... Does this sound right? 

I will try to come up with a simpler example to see which is the culprit.

Thanks again for your help.

... 

Thank you!

Cheers,
Garrett

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





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


Re: [osg-users] osg(terrain) krasches on a double delete

2012-08-20 Thread Ola Nilsson
Hi,

On 20 aug 2012, at 17.47, Robert Osfield wrote:

 Hi Ola,
 
 On 20 August 2012 16:29, Ola Nilsson o...@weatherone.tv wrote:
 The double delete originates from the DatabasePager, but the destruction of
 these objects should be safe(ref counted as well as threadsafe) shouldn't
 it? I would be grateful if someone could take a look at the stacktrace (prev
 post, below) and see if there is anything suspicious going on.
 
 I have just tried your modified osgterrain and it crashes for me with
 a seg fault during the update traversal.  I am just doing a debug
 build to see if this reveals anything more useful.
 

Great news!

 While the usage your modified osgterrain shouldn't cause a crash it's
 certainly not the way I would recommend anyone to use osgTerrain - the
 setSampleRatio() feature is meant to be set once in an application
 rather than thrashed continuously as changing the same ratio forces a
 rebuild of the terrain geometry.  The Camera::setLODScale() is however
 a light weight operation without any performance or stability
 consequences and can be changed every frame without problem.
 
 The question has to be why you are changing the Terrain SampleRatio.
 

As I tried to convey in my first post, the sample program just exaggerates a 
usage scenario that _very_ seldom crashed our app. We obviously do not change 
sampleratio per frame call in our app. It can however be set per flight in a 
project. We will revise this usage.

Ola

 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] osg(terrain) krasches on a double delete

2012-08-20 Thread Ola Nilsson
Hi Robert,

This explains the behavior we have experienced, the crashes we observed were 
notoriously difficult to reproduce in a debug environment (gdb, valgrind, 
etc.). 

Thanks for taking your time to investigate this!

Ola 



On 20 aug 2012, at 18.41, Robert Osfield wrote:

 Hi Ola,
 
 I've been doing a code review of Terrain and TerrainTile looking at
 how deletion of TerrainTile will affect the internal TerrainTile
 pointers held in Terrain that track all the tiles.  There internal
 TerrainTile pointers in Terrain are protected by a reentrant mutex but
 I believe a problem can occur when the TerrainTile destructor calls
 Terrain::unregisterTerrainTile(TerrainTile*) when at the same time the
 Terrain::traverse(NodeVisitor) method is taking a copy of the
 _updateTerrainTileSet, when this occurs the update traversal would
 increment the ref count on an TerrainTile being destructed by the
 DatabasePager thread that is cleaning up expired tiles.
 

 This issue boils down to attempt to make a thread safe list
 TerrainTile observers in Terrain that doesn't quite achieve what it
 intends.  I haven't thought deeply enough about the issue yet to know
 what the best solution will be.  My head isn't quite into zone that
 will allow me to solve this one so I'll have to come back to it at a
 later date.  A short term solution would be set the pager so that it
 doesn't delete objects in a background pager thread via
 DatabasePager::setDeleteRemovedSubgraphsInDatabaseThread(false), this
 won't fix the thread safety issue but will at least prevent the
 particular instance where the update traversal is occurring at the
 same time as the deletion of TerrainTile.
 
 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] window-in-window terrain view

2012-08-20 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Dan,

Yes, you can do a picture in a picture. It's just another view in a
composite viewer that shares the same graphics context as the parent
view (i.e. the view that you're embedding into).
 
So, let's say viewA is the parent view created as usual with something
like setUpViewInWindow(...). Now you want to embed viewB into viewA.
This is done by

viewB-getCamera()-setViewport(x,y,w,h); // x,y referenced from LL
corner of parent window
viewB-getCamera()-setGraphicsContext(viewA-getCamera()-getGraphicsCo
ntext());

You can set the state and scenegraph for viewB just like any other view
that you want to render.

Hope this helps...
-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Dan
Marshal
Sent: Sunday, August 19, 2012 11:56 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] window-in-window terrain view

Hi,

I am using OSG to create a simple flight sim app.  

I want to have a terrain 'window-in-window' to show the aircrafts path
over the earth.  

The terrain view would have its own coordinates.

Is there a simple way to create a view inside another view?

Thank you!

Cheers,
Dan

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





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


Re: [osg-users] Extensions/State Update Question

2012-08-20 Thread Jean-Sébastien Guay

Hi Jeremy, nice to see you back writing graphics code!

In the past, when I've needed to have a contextID in a custom Drawable, 
I've always gotten it from inside my drawable's drawImplementation. IIRC 
it gets a State pointer and this contains a valid contextID. Same when 
I've needed to create a custom StateAttribute or something, in its 
apply() method it gets a State pointer with a valid contextID or 
something like that.


So you can have a scheme where you defer doing any initialization until 
your first Drawable / StateAttribute needs to be traversed for actual 
rendering, and then you get a valid contextID, do your initialization 
and further ones will use that since initialization has been done already.


You need to make sure you consider the case where your Drawable / 
StateAttribute will be used in multiple contexts. IIRC OSG uses the 
BufferedValue to store resources associated with a context, and I used 
the same pattern. Again IIRC, there were some order of initialization 
issues where I assumed some initialization had been done for a context 
before drawing but it hadn't, but that just involved a bit of pretty 
simple debugging to get fixed.


Hope this helps,

J-S


On 20/08/2012 12:48 PM, Jeremy Moles wrote:

On Mon, 2012-08-20 at 10:44 -0600, Paul Martz wrote:

What you seem to be saying is that you want to set some OpenGL state once that
applies to all contexts, and not have to set it every frame. AND, you don't want
to have to add, then remove, a Camera draw callback just to make this happen).
Is that a good synopsis of the issue?

It's close; I don't actually mind using a Camera draw callback for this
purpose if it's appropriate.

A real summarizing question is: under what conditions is it safe to
query for support of a particular extension? And what is the preferred
API for either fetching or being provided the contextID with which to do
this?


You could keep a bool buffered_value that tells you whether or not you've set
the initial/global state for that particular context. Initially false, then set
the global state for a context and flip it to true. Would something like that 
help?
 -Paul

Certainly, but I'm still stuck on actually SETTING the state in the
first place. :)


On 8/20/2012 10:27 AM, Jeremy Moles wrote:

Hello everyone! I have a bit of a strange question here, so please bear
with me. I'll try to be as descriptive as I possibly can, though I'm
certain I will misuse some terminology.

I am adding support for the NV_path_rendering extension to
OpenSceneGraph. This extension adds a number of new functions to OpenGL
when using an NVidia card which take on the form:

glPath{_function_}NV

http://osgnvpr.googlecode.com

In order to create pointers to these new extension functions, I create
an Extensions object in OSG using the contextID given to me during the
compileGLObjects method of my overridden Drawable class. This works
fine, and the code is running as I expect.

https://code.google.com/p/osgnvpr/source/browse/trunk/src/PathCommands.cpp#45

HOWEVER, this paradigm really only works when I need to call extension
functions associated with an instance (or instances) of my Drawable.
There are other functions in the NV_path_rendering API that simply set
global state, and it is with these functions that I'm having difficulty.

The biggest problem here is that in order to get a pointer to the
Extensions static object, I need a valid GraphicsContext contextID.
However, I've tried a number of methods to obtain one of these, but
every attempt I make actually breaks the entire codebase. I wish I could
explain it better than that...

For example, if I try to use some code like the following:



Windows windows;

viewer.getWindows(window);

cID = windows[0]-getState()-getContextID();

osgNVPR::getNVPRExtensions(cID);

-

...then I seem to get an invalid contextID and all subsequent attempts
to use that contextID (even by OSG itself) won't work. The entire
rendering process seems to be broken in this manner.

If instead I create a Camera::DrawCallback object and use the RenderInfo
there instead, then everything works fine. However, I feel like I'm
grossly misusing a Camera::DrawCallback just to set and unset state...

My question is: if I need to set global state like this once, somewhere
high in the scenegraph, what is the best way--keeping in mind that I
also need a valid contextID in order to access my Extensions functions
per-context?

Thanks!

___
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

Re: [osg-users] Is it possible to do boolean operations with objects (primitives)?

2012-08-20 Thread Chris Hanson
http://www.opencsg.org/

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


Re: [osg-users] Is it possible to do boolean operations with objects (primitives)?

2012-08-20 Thread Wang Rui
Hi,

OpenCSG is good enough to perform stencil-based CSG operations at realtime.
But it is difficult to integrate it with OSG because OpenCSG maintains a
rendrable list itself. The only way I think is to get the renderbin list
deeply in the OSG core and transfer it to OpenCSG, but it is absolutely a
terrible idea. That's why I exclude this library from the osgRecipes plan.
:-)

Wang Rui


2012/8/21 Chris Hanson xe...@alphapixel.com

 http://www.opencsg.org/

 --
 Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
 http://www.alphapixel.com/
 Training • Consulting • Contracting
 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
 LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android


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


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


Re: [osg-users] osg(terrain) krasches on a double delete

2012-08-20 Thread Christiansen, Brad
Hi,

As another data point for you, I tried to reproduce the crash on a Win 7 
machine (VS2010) using a trunk build from a few weeks ago, and couldn't 
reproduce the crash. I left the example running for about 10 minutes with the 
camera spinning.

Cheers,
Brad

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ola Nilsson
Sent: Thursday, 9 August 2012 11:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osg(terrain) krasches on a double delete

Here is some more info on how to reproduce our crash.

1. Compile the attached osgterrain program by overwriting 
examples/osgterrain/osgterrain.cpp and recompile.
2. Run the program with
http://www.openscenegraph.org/data/earth_bayarea/earth.ive as input.
3. Wait (no further input is necessary). However, camera movement (tile
loading) produces earlier crashes. The attached image shows performance of a 
typical run (without user input) where the frame time cyclically increases 
until the program crashes.

Cheers,

Ola

ps. The output from the program is: iteration sample_ratio frame_time



On Tue, 07 Aug 2012 11:59:00 +0200, Ola Nilsson o...@weatherone.tv wrote:

 Hi,

 We have been looking for a hard-to-reproduce crash in our software
 that seems to originate from a double delete inside osg. I have
 (finally) been able to reproduce the crash using a version of the
 osgterrain-example that _exaggerates_ the usage pattern that crashes
 our application.

 In examples/osgterrain.cpp remove return viwer.run(); an exchange it
 with:

while(!viewer.done())
  {
   osg::Timer_t start_tick = osg::Timer::instance()-tick();
   float sr = rand() * 1.0 / RAND_MAX ;
   std::cerr  sr;

   viewer.getCamera()-setLODScale(sr*10);
   terrain-setSampleRatio( sr );

   osg::Timer_t middle_tick = osg::Timer::instance()-tick();

   std::cerr  osg::Timer::instance()-delta_m(start_tick, middle_tick)
  std::flush;

   viewer.frame();
   std::cerr  ' '  osg::Timer::instance()-delta_m(middle_tick,
 osg::Timer::instance()-tick())  std::endl;
  }
return 0;

 When run (tested on ive earth models generated with osgdem) the frame
 time slowly increases, and, after a while, it warns about deleting a
 still referenced object and then (after arbitrary time) crashes with a
 glibc error.

 Is this usage (setLODScale + setSampleRatio) safe? If not how should
 these functions be called?

 If it's a bug, we would be _very_ happy to have it fixed or pointers
 about where to look in the code. We've previously submitted a patch
 that switched to a ReentrantMutex in osgTerrain/Terrain.cpp (changeset
 12904), could this be a similar issue?

 My system is running Centos 6.3 (x86_64) and I compiled osg in debug
 mode with gcc 4.4.6. I have tested both against the 3.0.1 tag and
 trunk (r13106).

 Since I suspect a threading issue; OpenThreads/Config looks like this:
 #define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
 /* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
 /* #undef _OPENTHREADS_ATOMIC_USE_SUN */
 /* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */
 /* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */
 /* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */
 /* #undef OT_LIBRARY_STATIC */

 If I set a break point in the warning for deleting still referenced I
 get the following stack trace (using the osg 3.0.1 tag):

 Breakpoint 1, osg::Referenced::~Referenced (this=0xaec2160,
 __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236
 236 OSG_WARNWarning: deleting still referenced object
 this of type 'typeid(this).name()'std::endl;
 (gdb) bt
 #0  osg::Referenced::~Referenced (this=0xaec2160, __in_chrg=value
 optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:236
 #1  0x779e467c in osg::Object::~Object (this=0xaec2160,
 __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Object.cpp:45
 #2  0x779dd71d in osg::Node::~Node (this=0xaec2160,
 __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Node.cpp:94
 #3  0x77993953 in osg::Group::~Group (this=0xaec2160,
 __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Group.cpp:53
 #4  0x75df4ae8 in osgTerrain::TerrainTile::~TerrainTile
 (this=0xaec2160, __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95
 #5  0x75df4b1e in osgTerrain::TerrainTile::~TerrainTile
 (this=0xaec2160, __in_chrg=value optimized out) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osgTerrain/TerrainTile.cpp:95
 #6  0x77a131a6 in osg::Referenced::signalObserversAndDelete
 (this=0xaec2160, signalDelete=true, doDelete=true) at
 /home/ola/src/OpenSceneGraph-3.0.1/src/osg/Referenced.cpp:323
 #7  0x0040b07d in osg::Referenced::unref (this=0xaec2160) at