[osg-users] kd tree ray tracing performance

2012-10-08 Thread Tolga Yilmaz
Hi,
is there any example that compares ray tracing performance in ms between kdtree 
and normal implementation with osg? i remember some time i found such an 
example and modified it, but couldnt find that code now.

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





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


[osg-users] [build] pdb install

2012-10-08 Thread Gianni Ambrosio
Hi All,
is there a way to install pdb files in the same directory of the dlls? if not, 
could you please help me in finding the right cmake file to modify?

Regards,
Gianni

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





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


[osg-users] OrbitManipulator::handleMouseWheel()

2012-10-08 Thread Gianni Ambrosio
Hi All,
could you please explain me the reason why handleMouseWheel() of 
OrbitManipulator class is never called? I derived from NodeTrackerManipulator 
and set a breakpoint in OrbitManipulator::handleMouseWheel() implementation but 
I never get inside that method. Even if I use an osg::TrackballManipulator I 
cannot see the wheel event handled.
Moreover, in StandardManipulator::handle(), case GUIEventAdapter::SCROLL: never 
happens.
So, how can I enable the mouse wheel event?

Regards,
Gianni

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





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


Re: [osg-users] Help:why does renderbin affect the display of textures ?

2012-10-08 Thread wang shuiying

Is nobody interested in this question?:-(

Hello,

I have two drawable nodes A and B under the same main group node. I
mapped two different textures on the drawables respectively. Those two
drawables do not have any overlappings in terms of pixels on the screen.
Drawable A is described using open scene graph library while drawable B
is described using openGL terms. Depth test is disabled by Drawable A
and enabled by drawable B. Texture display on A uses a shader while B
does not.

When the renderbin of drawable A is set to be -1 and that of drawable B
is 1, the two textures cannot show at the same time. That is to say,
when I toggle on both drawable A and drawable B and make them both seen
on the screen, the texture on drawable B doesn't show, but the color of
B is correct. Under such circumstance, when I manipulate the view in a
way such that drawable A is out of sight, then the texture on drawable B
will appear.

If I reverse the renderbins of those two drawables, then the textures
can show at the same time.

I just cannot figure out why this happens.

 If it is due to depth test, why should such conflicts happen, since
they have no overlapped pixels on the screen? Even it is due to depth
test, why is the color  correct?

Would someone please be so kind enough as to explain that to me?

Thanks millions in advance!

Best regards
Shuiying




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


Re: [osg-users] Help:why does renderbin affect the display of textures ?

2012-10-08 Thread Wang Rui
Hi Shuiying,

I guess that there may be something wrong in the draw implementation
of drawable B. Although OpenGL calls can be executable in custom
drawables, it is still suggested that you apply all kinds of rendering
states to the drawable using StateAttribute derivatives. But without
looking at some detailed code, I can hardly find out the actual reason
inside.

Wang Rui


2012/10/8 wang shuiying shuiying.w...@fu-berlin.de:
 Is nobody interested in this question?:-(

 Hello,

 I have two drawable nodes A and B under the same main group node. I
 mapped two different textures on the drawables respectively. Those two
 drawables do not have any overlappings in terms of pixels on the screen.
 Drawable A is described using open scene graph library while drawable B
 is described using openGL terms. Depth test is disabled by Drawable A
 and enabled by drawable B. Texture display on A uses a shader while B
 does not.

 When the renderbin of drawable A is set to be -1 and that of drawable B
 is 1, the two textures cannot show at the same time. That is to say,
 when I toggle on both drawable A and drawable B and make them both seen
 on the screen, the texture on drawable B doesn't show, but the color of
 B is correct. Under such circumstance, when I manipulate the view in a
 way such that drawable A is out of sight, then the texture on drawable B
 will appear.

 If I reverse the renderbins of those two drawables, then the textures
 can show at the same time.

 I just cannot figure out why this happens.

  If it is due to depth test, why should such conflicts happen, since
 they have no overlapped pixels on the screen? Even it is due to depth
 test, why is the color  correct?

 Would someone please be so kind enough as to explain that to me?

 Thanks millions in advance!

 Best regards
 Shuiying




 ___
 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] Help:How many frames at most can be achieved within OSG framework?

2012-10-08 Thread wang shuiying

Hello,

I am wondering how many frames at most can be achieved when a scene is 
rendered within OSG framework? Is it restricted by GPU performance or 
the operating system or OSG framework?


Thank you very much in advance!


Best regards

Shuiying

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


Re: [osg-users] Help:why does renderbin affect the display of textures ?

2012-10-08 Thread Sergey Polischuk
Hi
Seems like you are messing with opengl state, and osg dont know about it. You 
should either:
a) when you draw something with pure gl - after you finished, return all state 
you modified to values being before you started drawing
b) use osg::State interface members to let osg know what state you are changed, 
or use osg wrappers in osg::State to make this state changes.
c) call osg::State's dirty*() methods (like dirtyAllModes() and 
dirtyAllAttributes()) for state you've changed, after you finished with pure 
gl, but i dont recommend using this.

Cheers.

08.10.2012, 12:14, wang shuiying shuiying.w...@fu-berlin.de:
 Is nobody interested in this question?:-(

 Hello,

 I have two drawable nodes A and B under the same main group node. I
 mapped two different textures on the drawables respectively. Those two
 drawables do not have any overlappings in terms of pixels on the screen.
 Drawable A is described using open scene graph library while drawable B
 is described using openGL terms. Depth test is disabled by Drawable A
 and enabled by drawable B. Texture display on A uses a shader while B
 does not.

 When the renderbin of drawable A is set to be -1 and that of drawable B
 is 1, the two textures cannot show at the same time. That is to say,
 when I toggle on both drawable A and drawable B and make them both seen
 on the screen, the texture on drawable B doesn't show, but the color of
 B is correct. Under such circumstance, when I manipulate the view in a
 way such that drawable A is out of sight, then the texture on drawable B
 will appear.

 If I reverse the renderbins of those two drawables, then the textures
 can show at the same time.

 I just cannot figure out why this happens.

   If it is due to depth test, why should such conflicts happen, since
 they have no overlapped pixels on the screen? Even it is due to depth
 test, why is the color  correct?

 Would someone please be so kind enough as to explain that to me?

 Thanks millions in advance!

 Best regards
 Shuiying

 ___
 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] how to get number of vertices and faces

2012-10-08 Thread Robert Osfield
Hi John,

Ther a number of different ways to get stats on scene graphs:

The onscreen stats handling provides a range of options that may be
sufficient - run osgviewer on your model and press 's' a couple of
times to see the various different stats availble.

One can also convert model to .osg or .osgt files and the browse
through them in an editor to see the scene graph structure and the
sizes of the various arrays.

One can also use the osgUtil::Statsitics helper class that can be used
to tot up the various vertex and primitive dat stats from drawables in
your scene graph, you can use this in conjunction with custom
NodeVisitor to accumulate the stats for you whole scene graph.  Do a
search through the OSG code base to see how the StatsHandler/Statitics
class are used.

Robert.

On 7 October 2012 15:05, John Moore kahar...@gmail.com wrote:
 Hi guys,

 I have a scene graph with only a node containing an OBJ file.
 Do you know hot can I get the number of vertices and faces of the OBJ model?

 Actually I am using osg::Stats
 osg::Stats* stats = _viewer-getCamera()-getStats();
 I get the attribute map...
 const osg::Stats::AttributeMap attributes = stats-getAttributeMap(i);
 I iterate and then I am able to get the

 -Visible number of GL_TRIANGLE_STRIP
 -Visible vertex count

 that seems to be the values I need...

 However the real number of faces of the OBJ is different from 
 GL_TRIANGLE_STRIP, and the real number of vertices of the OBJ is different 
 from Vertex count. I know because I checked using 3DS max.

 How can I get the correct values?

 Thank you!

 Cheers,
 John

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





 ___
 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] kd tree ray tracing performance

2012-10-08 Thread Robert Osfield
H Tolga,


On 8 October 2012 08:09, Tolga Yilmaz osgfo...@tevs.eu wrote:
 is there any example that compares ray tracing performance in ms between 
 kdtree and normal implementation with osg? i remember some time i found such 
 an example and modified it, but couldnt find that code now.

There isn't any example that address this right now.  You could
modified the osginterstion example to add a command line option for
enabling the build of kdtree's and then use it as a benchmarking tool.

When developing the KdTree support I did plenty of benchmarking but I
never truned these tests into a OSG example and don't have the code
anymore unfortunately - I do lots of prototype/testing so don't tend
to keep all the tests around.   From my experience KdTree's help most
when the scene graph is composed of large osg::Geometry meshes - here
it can be 10 to 1000's of times faster, if the scene graph is already
very fine grained with many small osg::Geometry meshes then the
difference is much smaller.

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


[osg-users] [ANN] OSG exporter available for Grome editor

2012-10-08 Thread Adrian Licu
Hello dear OSG-community,

I am glad to announce our official support for OpenSceneGraph integration with 
our editing software, Grome.

The integration consists in an export plugin from Grome editor to OSG ive and 
osg formats, a sample map and documentation:
http://www.quadsoftware.com/index.php?m=sectionsec=productsubsec=editortarget=Editor/ForEngines/editor_osg;

The exporter is provided free of charge (including full source code).

Grome is a outdoor level editing software that supports procedural generation 
of terrain, placement of objects, water surfaces, road networks. The editor is 
used by professional and indie game developers and by simulation industry 
corporations.

More information about Grome here:
http://www.quadsoftware.com/index.php?m=sectionsec=productsubsec=editor

Please don't hesitate to contact us for any information. The integration forum 
can be found here:
http://www.quadsoftware.com/forum/viewforum.php?f=42

Best Regards,
Adrian Licu
Quad Software CTO

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





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


Re: [osg-users] kd tree ray tracing performance

2012-10-08 Thread Lionel Lagarde

Hi,

Here are some bench I have made few years ago (2008).

Tests description:
- scene 1: 200x200 grid (8 triangles, 40401 vertices), only one geometry
- scene 2: small part of a real terrain (16x16 km), 1600+ geometries, 
quad tree shaped scene graph


The benchmark application display the scene and 30 mobile objects (on a 
trajectory) clamped on the ground.


Clamping time:

Scene



w/o Kd-Tree



w/ Kd-Tree

Min (ms)



Max (ms)



Avg (ms)



Min (ms)



Max (ms)



Avg (ms)

1



2,890



3,280



3,105



0,021



0,029



0,023

2



0,270



1,185



0,625



0,079



0,410



0,242


Here is the same tests with the code of LineSegmentIntersector doing the 
segment/triangle intersection test commented out (== scene graph 
traversal time):


Scene



scene graph traversal time

Min (ms)



Max (ms)



Avg (ms)

1



0,003



0,005



0,003

2



0,057



0,385



0,227

So the traversal of the leaves are:




w/o Kd-Tree



w/ Kd-Tree

1



3,105 -- 0,003 = 3,102



0,023 -- 0,003 = 0,020

2



0,625 -- 0,227 = 0,398



0,242 -- 0,227 = 0,015

Here are the gain of using Kd-Trees:




Global



Only leaves

scene 1



-99,26%



-99,36%

scene 2



-61,28%



-96,23%

And the memory cost:




Number of Kd-trees



Total Kd-Tree size

scene 1



62



4,65 MB

scene 2



1



38,06 MB


On 08/10/2012 11:26, Robert Osfield wrote:

H Tolga,


On 8 October 2012 08:09, Tolga Yilmaz osgfo...@tevs.eu wrote:

is there any example that compares ray tracing performance in ms between kdtree 
and normal implementation with osg? i remember some time i found such an 
example and modified it, but couldnt find that code now.

There isn't any example that address this right now.  You could
modified the osginterstion example to add a command line option for
enabling the build of kdtree's and then use it as a benchmarking tool.

When developing the KdTree support I did plenty of benchmarking but I
never truned these tests into a OSG example and don't have the code
anymore unfortunately - I do lots of prototype/testing so don't tend
to keep all the tests around.   From my experience KdTree's help most
when the scene graph is composed of large osg::Geometry meshes - here
it can be 10 to 1000's of times faster, if the scene graph is already
very fine grained with many small osg::Geometry meshes then the
difference is much smaller.

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] how to get number of vertices and faces

2012-10-08 Thread John Moore
Dear Robert,

Actually I can't use the S key because my application is running on iOS. 
Is there any way to compute these value using a node visitor?

actually for knowing the vertices I tried using this line of code inside my 
nodevisitor
totalNumOfVertices += geo-getVertexArray()-getNumElements();

however the result is a higher than expected, so I am not sure it's the true 
value.

Am I doing it right? 
Thank you.

Bye,
John

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





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


[osg-users] Difference between osgFX and osgPPU

2012-10-08 Thread Peterakos
Hello.

Is there any difference between these 2 or are they different
implementations for the same purpose ?
For someone who wants to support multi passes (using shaders) on model
nodes which is better ?

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


Re: [osg-users] glslDevil

2012-10-08 Thread Chris Hanson
On Thu, Oct 4, 2012 at 9:33 AM, Chris Hanson xe...@alphapixel.com wrote:

   So, do we have any Germans who could give me a hand liasing with
 Stuttgart? Just the time difference makes it awkward for me in the western
 US.



  Well, since nobody has volunteered, I will try to contact them tomorrow
and see what happens. Still would be nice to hear from someone willing to
help.

-- 
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] [vpb] osgdem --image-ext option working

2012-10-08 Thread Paul Leopard
Excellent, thanks for the clarification Robert

Regards,
Paul

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





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


Re: [osg-users] glslDevil

2012-10-08 Thread Sebastian Messerschmidt

Hello Chris,

I've been working with glslDevil a while ago and found it really helpful 
up to the point where it didn't support anything beyond GLSL 1.2.
Since I'm not an academic(i.e. I don't study anymore) I didn't volunteer 
and replied to your request.
You can put me on the CC and I'm willing to help with your request, if 
this is of any value for you.



cheers
Sebastian
On Thu, Oct 4, 2012 at 9:33 AM, Chris Hanson xe...@alphapixel.com 
mailto:xe...@alphapixel.com wrote:


  So, do we have any Germans who could give me a hand liasing with
Stuttgart? Just the time difference makes it awkward for me in the
western US.



  Well, since nobody has volunteered, I will try to contact them 
tomorrow and see what happens. Still would be nice to hear from 
someone willing to help.


--
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] glslDevil

2012-10-08 Thread Chris Hanson
 I've been working with glslDevil a while ago and found it really helpful
 up to the point where it didn't support anything beyond GLSL 1.2.


  You got it to work better than I did. ;)


  Since I'm not an academic(i.e. I don't study anymore) I didn't volunteer
 and replied to your request.
 You can put me on the CC and I'm willing to help with your request, if
 this is of any value for you.


  Ok. I've contacted Stefan Roettger to see if he would be willing to help
contact and resurrect this project. Whether he can or not, your help would
certainly be welcome, as well as that of anyone who has experience with
glslDevil, or just interest. It would be nice to bring it up to modern
functionality, as GLSL can be such a fickle beast.

-- 
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] Building on Android

2012-10-08 Thread Eduardo Poyart
The error happens with the default order. I tried changing it, with no success.

In case you want to look into this further, you may want to refer to
my version that successfully builds with the latest SDK and NDK and
with dynamic runtime: https://github.com/Eduardop/osg/tree/osg-android

Eduardo


On Sun, Oct 7, 2012 at 7:05 AM, Jorge Izquierdo Ciges jori...@gmail.com wrote:
 It could be possible that the gnustl_static was included in the wrong order,
 it has happened a few times (depending NDK/Linux version) to me.

 2012/10/7 Eduardo Poyart poy...@gmail.com

 Finally, I was able to build by using the shared runtime
 (libgnustl_shared). I could not make it work with libgnustl_static.

 Eduardo


 On Fri, Oct 5, 2012 at 11:39 AM, Eduardo Poyart poy...@gmail.com wrote:
  Hello,
 
  I'm having a problem building for Android. I can build OSG, but when I
  try to build the GLES1 example I have these linker errors:
 
 
  /home/eduardo/src/osg/osg-android/obj/local/armeabi-v7a/libosgdb_osg.a(ReaderWri
  terOSG.o): In function `OSGReaderWriter::setPrecision(osgDB::Output,
  osgDB::Opt
  ions const*) const':
 
  /home/eduardo/src/osg/OpenSceneGraph/src/osgPlugins/osg/ReaderWriterOSG.cpp:295:
   undefined reference to `std::basic_istringstreamchar,
  std::char_traitschar,
  std::allocatorchar ::basic_istringstream(std::basic_stringchar,
  std::char_tr
  aitschar, std::allocatorchar  const, std::_Ios_Openmode)'
 
  /home/eduardo/src/osg/OpenSceneGraph/src/osgPlugins/osg/ReaderWriterOSG.cpp:313:
   undefined reference to `std::basic_istringstreamchar,
  std::char_traitschar,
  std::allocatorchar ::~basic_istringstream()'
 
  /home/eduardo/src/osg/OpenSceneGraph/src/osgPlugins/osg/ReaderWriterOSG.cpp:313:
   undefined reference to `std::basic_istringstreamchar,
  std::char_traitschar,
  std::allocatorchar ::~basic_istringstream()'
 
  There are several other errors related to basic_istringstream,
  basic_stringbuf, type_info and others.
 
  It seems like there is a STL incompatibility. I checked, but both osg
  and the example seem to be being built with the correct STL include
  path. The linker command is:
 
 
  /usr/local/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x
  86/bin/arm-linux-androideabi-g++ -Wl,-soname,libosgNativeLib.so -shared
  --sysroo
  t=/usr/local/android-ndk-r8b/platforms/android-5/arch-arm
  ./obj/local/armeabi-v7
  a/objs/osgNativeLib/osgNativeLib.o
  ./obj/local/armeabi-v7a/objs/osgNativeLib/Osg
  MainApp.o
  ./obj/local/armeabi-v7a/objs/osgNativeLib/OsgAndroidNotifyHandler.o ./
  obj/local/armeabi-v7a/libgnustl_static.a  -Wl,--fix-cortex-a8 -L
  /home/eduardo/s
  rc/osg/osg-android/obj/local/armeabi-v7a -losgdb_tga -losgdb_osg
  -losgdb_depreca
  ted_osgviewer -losgdb_deprecated_osgvolume -losgdb_deprecated_osgtext
  -losgdb_de
  precated_osgterrain -losgdb_deprecated_osgsim
  -losgdb_deprecated_osgshadow -losg
  db_deprecated_osgparticle -losgdb_deprecated_osgfx
  -losgdb_deprecated_osganimati
  on -losgdb_deprecated_osg -losgdb_serializers_osgvolume
  -losgdb_serializers_osgt
  ext -losgdb_serializers_osgterrain -losgdb_serializers_osgsim
  -losgdb_serializer
  s_osgshadow -losgdb_serializers_osgparticle
  -losgdb_serializers_osgmanipulator -
  losgdb_serializers_osgfx -losgdb_serializers_osganimation
  -losgdb_serializers_os
  g -losgViewer -losgVolume -losgText -losgSim -losgManipulator -losgGA
  -losgFX -l
  osgDB -losgUtil -losg -lOpenThreads -Wl,--no-undefined
  -Wl,-z,noexecstack -Wl,-z
  ,relro -Wl,-z,now
  -L/usr/local/android-ndk-r8b/platforms/android-5/arch-arm/usr/
  lib -llog -lGLESv1_CM -ldl -lz -lc -lm -o
  obj/local/armeabi-v7a/libosgNativeLib.
  so
 
  I have the latest OSG SVN version and the latest SDK and NDK. I'm
  following the instructions in both
 
  http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/Android
  and
  http://www.openscenegraph.com/index.php/documentation/platform-specifics/android/43-building-openscenegraph-for-android-3-0-2.
 
  I had to change a few false to NULL in osgNativeLib.cpp to stop
  gcc from complaining.
 ___
 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] Build osgEarth for android?

2012-10-08 Thread Mu Xing
Hi,

 I have build OSG for Android(cmake setings for OpenGL ES1.1),and it work on 
Android no problem.
Then I add osgEarth source to OSG,put osgEarthDrivers file in osgPlugins 
file,build it .I have get the osgEarth's lib,includes libosgEarth.a 
libosgEarhtAnnotation.a libosgEarthFeatures.a libosgEarthSymbology.a 
libosgEarthUtil.a and libosgdb_earth.a libosgdb_osgearth_gdal.a etc.
After,I link the need lib to the project,run it.The problem comes with the 
ANR in logcat.I pull /data/anr/traces.txt out,open it, the context's:

DALVIK THREADS:
main prio=5 tid=1 WAIT
|group=main sCount=1 dsCount=0 s=N obj=0x4001d968 self=0xcd28
|sysTid=5740  nice=0 sched=0/0  cgrp=default handle=-1345017816
at java.lang.object.wait(Native Method)
-waiting on 0x4008cbe0 (a android.opengl.GLSurfaceView$GLThreadManager)
at java.lang.object.wait(object.java:288)
at android.opengl.GLSurfaceView$GLThread.onWindowResize(GLSurfaceView.java:1486)
at android.opengl.GLSurfaceView.SurfaceChanged(GLSurfaceView.java:495)
...
...
...

I think it maybe onCreate() use too time,So I create a new thread in 
GLSurfaceView.Renderer.But the problem is remain as before.
How can I get the osgEarth working,Is anybody can help me or give me same 
advices?

Thank you!

Cheers,
MuXing

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





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


Re: [osg-users] Texture don't display on Android With GLES1 ?

2012-10-08 Thread Mu Xing
Hi,

I build OSG3.0.0 on android with OpenGLES1.
I red that Environmental mapping is not working on Android.
So I convert model to earth.ive with embedded textures.(the convert tool is 
VPB,on windows the earth.ive texture display no problem)

 On android ,these are the things what I did

1) I added -losgdb_jpeg -ljpeg -lpng -ltiff under LOCAL_LDFLAGS in 
Android.mk file
2) I added USE_OSGPLUGIN(jpeg) to OsgMainApp.hpp file.
3) The earth.ive is in Image folder only. The Image directory is in my mobile 
SD card (/mnt/sdcard/OSG/images).
4) The libosgdb_jpeg.a libjpeg.a libpng.a libtiff.a file is located in both 
/home/xing/android/obj/local/armeabi and 
/home/xing/android/obj/local/armeabi-v7a directories.

Why the texture is not displaying.

Thank you!

Cheers,
MuXing

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





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


[osg-users] Memory issues when using uniform shader variables on Intel HD graphics

2012-10-08 Thread Clemens Spencer
Hi,

I'm trying to use shaders on an Intel HD 3000 graphics chip (Windows7 x64, 
latest graphics driver).

As soon as I pass a uniform variable to the shader (regardless of the type), 
the memory of my process increases by about 400MB. Other than that, the shader 
works fine.
The size of the object the shader is attached to or the complexity of the 
shader do not make a difference. Every additional shader (containing at least 
one uniform variable) I use, increases the memory usage by another 400MB.

The problem does not occur on another machine with some NVidia graphics card.

Has anyone encountered a similar problem or does someone have an idea what 
could cause a problem like this?


Code:

osg::Program *program = new osg::Program;
osg::Shader *frag = new osg::Shader( osg::Shader::FRAGMENT, fragSource.str() );
osg::Shader *vert = new osg::Shader( osg::Shader::VERTEX, vertSource.str() );
program-addShader( frag );
program-addShader( vert );
// add shader to stateSet
sset-setAttributeAndModes( program, osg::StateAttribute::ON );
// add uniform variable
osg::Uniform *var = new osg::Uniform(MATERIAL_COLOR, 
osg::Vec4(1.0f,1.0f,0.0f,1.0f));
sset-addUniform(var);





Code:

// Vertex Shader

void main()
{
gl_Position = ftransform();
gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
}


// Fragment Shader

uniform vec4 MATERIAL_COLOR;

void main()
{
gl_FragColor = MATERIAL_COLOR;
}




By the way, I know I'm not using reference pointers :? but this shouldn't be a 
problem in this little example.

... 

Thank you!

Cheers,
Clemens[/code]

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





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


[osg-users] Design consideration using OSG

2012-10-08 Thread Faizol Abd.Halim
Hi,

I'm a total noob in using OSG and I would appreciate any advice from the 
veterans and experts here who have used it in many different projects.

Basically I've to design a CAD/CAM in house tool and I've been reading about 
OSG and OpenSG for quite some time. I've stumbled upon this FAQ (from faq 
section on 3drealtimesimulation site - osg_faq_1.htm - which I believe is 
pretty old) and in one of the sections, the author mentioned that;
One might think of the difference in a historical context as the difference 
between Inventor and Performer. OpenSG is used primarily in CAD and 
manufacturing circles (though that may have changed over the years), where 
frame rates need only be interactive, whereas Open Scene Graph is focused on 
higher performance real-time rendering. Neither seems to be exclusive of the 
needs of the other, but our respective expertise shows through in the final 
emphasis.

I believe there has been significant changes to the both frameworks since then 
that might make the differences to be smaller and smaller.

From a design perspective, what should I take into considerations to achieve 
high frame rates and interactivity needed by CAD/CAM solution using OSG?

Thank you!

Cheers,
Faizol

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





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


[osg-users] select point from pointcloud

2012-10-08 Thread Markus Ikeda
Hi,

I'm new to OSG and I tried the osgkeyboardmouse example 

root/OpenSceneGraph/trunk/examples/osgkeyboardmouse/osgkeyboardmouse.cpp 

but I still couldn't manage to use the polytope intersector to select a subset 
of points via mouseclick in a pointcloud.

Did anybody have the same problem and solve it ? 

Thank you!

Cheers,
Markus

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





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


[osg-users] Difficulty Positioning Camera Manipulator in Geocentric Database

2012-10-08 Thread Rob Dougan
Hi,

... Problem is the camera manipulator rotates but doesn't translate.

The desired gaming area consists of a geocentric terrain with a sky dome.
Using the osg::viewer and trackball camera manipulator (default view) i can 
move around the scene, go underneath the dome, look at the terrain etc.

fine. now  move the action under the dome.

I set the intial position of the camera as the center of the terrain at an 
altitude within the dome using a view matrix.
I get the view matrix from the camera and compute the eye, center and up 
vectors and use these to set the home position of the camera manipulator.

...
osg::Vec3 eye,center,up;
_viewer-getCamera()-getViewMatrixAsLookAt(eye,center,up);
osg::ref_ptrosgGA::TrackballManipulator trackBall = new 
osgGA::TrackballManipulator;
_viewer-setCameraManipulator( trackBall );
viewer-getCameraManipulator()-setHomePosition(eye,center,up,false);
...
_viewer-setSceneData(root)
...

The starting scene viewpoint is displayed correctly and i can rotate the camera 
to view everything under the dome, 

BUT the camera is FIXED in position and i can't move around. ( same behaviour 
with Flight Manipulator).

I was hoping to be able to navigate with the default camera manipulator 
initially and then add a callback to keep the camera in the gaming area 
(coordinate frame callback?).

Thank you!

Cheers,
Rob

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





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


[osg-users] Render passes and stereo handling

2012-10-08 Thread Gaurav Chaurasia
Hi,
Is there a way to know which eye (left/right) is currently being drawn inside 
osg::Camera::DrawCallback. There is the UserData field in RenderInfo, but I 
don't think I can use it for my purpose without having to patch 
osgUtil::SceneView.cpp - the patch being that I update UserData before drawing 
each eye.

Actually, I am doing render passes with render targets for a stereo 
application. So I need to switch shader inputs like textures,uniforms for each 
eye just before the draw call. I figured I can use the PreDrawCallback for the 
purpose because it is called inside RenderStage::draw just before the actual 
rendering happens. If someone has a cleaner solution, I would be most grateful.

Thank you!

Cheers,
Gaurav

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





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


Re: [osg-users] Multithreading Culling problems

2012-10-08 Thread Pjotr Svetachov
We had a similar issue. We had a stereo rendering setup that used slave 
camera's to render the scene. The only thing the main camera did was to swap 
the buffers.

Whats happened is when you do anything that will get bounding boxes of nodes 
invalidated, if you don't recalculate those they will be recalculated at cull 
traversal. But in multithreaded mode this is done in parallel and it will lead 
to flickering because of a race condition.

What you can do is call the getBound method on your root node after the update 
traversal, just before the rendering traversal. After some investigation it 
turned out this is already done at the beginning of 
ViewerBase::renderingTraversals() but in our case we had a empty scenegraph 
attached to our main camera because it did not render anything. So the getBound 
method was not called on our actual scene.

Seeing as you also render to textures and only display those, it could be that 
you also have some custom scenegraph going on and the bounding boxes are not 
calculated on the right scenegraph.

Hope this helps!

Cheers,
Pjotr

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





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


[osg-users] CompositeViewer multiple windows, same scene problem

2012-10-08 Thread Alvaro Segura
Hi,

We are having trouble using a CompositeViewer with 2 views in 2 windows, 
showing the same scene (same Node*).

The first view (in addView order) is rendered correctly, but the second view is 
badly rendered with some missing or garbled geometries.

If only one view is added, its rendering is fine. If instead of 2 windows, we 
use only one window with two contiguous viewports, rendering is fine.

Each view has its own Camera and GraphicsContext. We use GraphicsWindowQt with 
or without the shareWidget argument. Using setUpViewInWindow() instead does the 
same.

Seems that the first render is misusing the GL context or something so that the 
other has trouble. Threading is set to SingleThreaded to avoid potential 
sharing problems (but the TaskManager is showing many running threads (?)).

The problematic models are FBX exported from 3ds Max, BTW.

Is there any setting that has to be set in OSG/CompositeViewer to tell it that 
the scene is shared? Does anyone have an idea what can be wrong in such a setup?

Thank you!

Alvaro

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





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


Re: [osg-users] Problem with a Qt HUD

2012-10-08 Thread Tobias Geiselhart
Hi,

I wan't to show QT controls inside my OSG scene.
I introduced with the examples osghud and osgQTWidgets from the osg project.
First i create a sample project to solve my issue.
The problem is, that the QT- controls are never been displayed on my scene. 
I suppose the problem is the WidgetImage or the ImageHandler that i use, but i 
have no idea.

Any help is welcome.. :D


Thank you!

Cheers,
Tobias


Code:


TextView::TextView()
{
_HUDCamera = new osg::Camera;
_HUDCamera-setProjectionMatrix(osg::Matrix::ortho2D(0,640,0,480));
_HUDCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_HUDCamera-setViewMatrix(osg::Matrix::identity());
_HUDCamera-setClearMask(GL_DEPTH_BUFFER_BIT);
_HUDCamera-setRenderOrder(osg::Camera::POST_RENDER);
_HUDCamera-setAllowEventFocus(false);
_HUDCamera-getOrCreateStateSet()-setMode( GL_LIGHTING, 
osg::StateAttribute::OFF );
_HUDCamera-getOrCreateStateSet()-setMode( GL_BLEND, 
osg::StateAttribute::ON );
}


TextView::~TextView(void)
{
}

osg::Camera* TextView::creation()
{
osg::ref_ptrosgQt::QWidgetImage widgetImage = new 
osgQt::QWidgetImage( createDemoWidget() );
osg::ref_ptrosg::Texture2D texture = new osg::Texture2D;
texture-setImage( widgetImage.get() );
osg::ref_ptrosgViewer::InteractiveImageHandler handler = new 
osgViewer::InteractiveImageHandler( widgetImage.get(),texture,_HUDCamera);

osg::ref_ptrosg::Geometry quad = 
osg::createTexturedQuadGeometry(osg::Vec3(), osg::X_AXIS, osg::Z_AXIS);
quad-setEventCallback( handler.get() );
quad-setCullCallback( handler.get() );

osg::ref_ptrosg::MatrixTransform part = new osg::MatrixTransform;
osg::ref_ptrosg::Geode geode = new osg::Geode;
geode-addDrawable( quad.get() );
geode-getOrCreateStateSet()-setTextureAttributeAndModes( 0, texture.get() 
);
geode-getOrCreateStateSet()-setMode(GL_LIGHTING, 
osg::StateAttribute::OFF);

geode-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

part-getOrCreateStateSet()-setTextureAttributeAndModes( 0, 
texture.get() );
part-getOrCreateStateSet()-setRenderingHint( 
osg::StateSet::TRANSPARENT_BIN );
part-addChild( geode.get() );

/*osg::Node* n = osgDB::readNodeFile(C:\\cow.osg);*/

_HUDCamera-addChild(part);

return _HUDCamera;
}

QWidget* TextView::createDemoWidget( )
{
QLabel* label = new QLabel;
QPushButton* playBtn = new QPushButton(Play);
QPushButton* stopBtn = new QPushButton(Stop);

QWidget* demo = new QWidget;
demo-setGeometry( 0, 0, 800, 600 );
demo-setLayout( new QVBoxLayout );
demo-layout()-addWidget( label );
demo-layout()-addWidget( playBtn );
demo-layout()-addWidget( stopBtn );

return demo;
}

int main( int argc, char** argv )
{
QApplication app( argc, argv );
osgViewer::Viewer viewer;
TextView* text = new TextView();

osg::ref_ptrosg::Group root = new osg::Group;
osg::Node* n = osgDB::readNodeFile(C:\\cow.osg);

root-addChild(text-creation());   
viewer.setSceneData( root.get() );
viewer.setCameraManipulator( new osgGA::TrackballManipulator );
viewer.addEventHandler( new osgViewer::StatsHandler );
viewer.setUpViewOnSingleScreen();

while ( !viewer.done() )
{
QCoreApplication::processEvents( QEventLoop::AllEvents, 100 );
viewer.frame();
}
return 0;
}





 :D  :D

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





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


[osg-users] multipass transparency

2012-10-08 Thread Tina Guo
Hi,

In open inventor, there is a transparency mode called: delayed blend

Transparent objects are rendered using multiplicative alpha blending, in a 
second rendering pass with depth buffer updates disabled. And I want to get the 
same effect.

here's what I am trying to do

transparency-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
transparency-setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA 
,GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute::ON);
_geom_solid-setStateSet(transparency);



class TransparencyTechnique : public osgFX::Technique
{
public:
TransparencyTechnique() : osgFX::Technique() {}
virtual bool validate( osg::State ss ) const { return true; }

protected:
virtual void define_passes()
{
osg::ref_ptrosg::StateSet ss = new osg::StateSet;
ss-setAttributeAndModes( new osg::ColorMask(true, true, true, true) );
addPass( ss.get() );

ss = new osg::StateSet;
osg::Depth* depth = new osg::Depth;
depth-setWriteMask( false );
ss-setAttributeAndModes( depth, osg::StateAttribute::ON );
addPass( ss.get() );
}
};


The result is not right. how should define_passes() be defined?

... 

Thank you!

Cheers,
Tina

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





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


[osg-users] X11 Trouble, Building OSG with OpenGL ES 2.0

2012-10-08 Thread Marius Noller
Hi,

I'm trying to build OpenSceneGraph-3.1.0 (dev) using OpenGL ES 2.0 on an i.MX6Q 
(Armel), but I'm having trouble with the X11. 

By Compiling, I get the following error:

Code:
[ 62%] Building CXX object 
applications/osgversion/CMakeFiles/application_osgversion.dir/osgversion.o
Linking CXX executable ../../bin/osgversion
/usr/lib/libGAL.so: undefined reference to `XScreenOfDisplay'
/usr/lib/libGAL.so: undefined reference to `XGetImage'
/usr/lib/libGAL.so: undefined reference to `XCreatePixmap'
/usr/lib/libGAL.so: undefined reference to `XCreateGC'
/usr/lib/libGAL.so: undefined reference to `XFreeGC'
/usr/lib/libGAL.so: undefined reference to `XInitThreads'
/usr/lib/libGAL.so: undefined reference to `XMoveWindow'
/usr/lib/libGAL.so: undefined reference to `XPending'
/usr/lib/libGAL.so: undefined reference to `XStringListToTextProperty'
/usr/lib/libGAL.so: undefined reference to `XHeightOfScreen'
/usr/lib/libGAL.so: undefined reference to `XCreateImage'
/usr/lib/libGAL.so: undefined reference to `XOpenDisplay'
/usr/lib/libGAL.so: undefined reference to `XSetWMProperties'
/usr/lib/libGAL.so: undefined reference to `XNextEvent'
/usr/lib/libGAL.so: undefined reference to `XGetGeometry'
/usr/lib/libGAL.so: undefined reference to `XUnmapWindow'
/usr/lib/libGAL.so: undefined reference to `XFlush'
/usr/lib/libGAL.so: undefined reference to `XCreateWindow'
/usr/lib/libGAL.so: undefined reference to `XDestroyWindow'
/usr/lib/libGAL.so: undefined reference to `XGetWindowAttributes'
/usr/lib/libGAL.so: undefined reference to `XFreePixmap'
/usr/lib/libGAL.so: undefined reference to `XWidthOfScreen'
/usr/lib/libGAL.so: undefined reference to `XCloseDisplay'
/usr/lib/libGAL.so: undefined reference to `XMapRaised'
/usr/lib/libGAL.so: undefined reference to `XPutImage'
collect2: ld returned 1 exit status
make[2]: *** [bin/osgversion] Error 1
make[1]: *** 
[applications/osgversion/CMakeFiles/application_osgversion.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs





Checking for XInitThreads:

Code:

root@linaro-ubuntu-desktop:~# nm -o /usr/lib/* | grep XInitThreads
/usr/lib/libGAL.so: U XInitThreads
/usr/lib/libGAL-x11.so: U XInitThreads
/usr/lib/libVIVANTE.so: U XInitThreads
/usr/lib/libVIVANTE-x11.so: U XInitThreads
/usr/lib/libX11.a:locking.o:0060 T XInitThreads 


 

I tried:
-reinstalling libx11-dev
-reinstalling xserver-xorg

Thank you!

Cheers,
Marius

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





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


Re: [osg-users] select point from pointcloud

2012-10-08 Thread Wang Rui
Hi Markus,

Default LinesegmentIntersector is unable to handle intersections with
lines and points. But PolytopeIntersector which will require a
rectangle on screen (or a polytope in space) may do the work for you.

The OpenSceneGraph 3.0 Cookbook (Packt Publishing) introduces how to
use custom intersector to select points in the last chapter.
Unfortunately the whole chapter was removed at last because of page
count limitation. But you can still find the source code from the
Github repo and test it freely:
https://github.com/xarray/osgRecipes/tree/master/cookbook/chapter10/ch10_07

Another way to do point selection effectively is to make use of the
glReadPixels() function with depth component. You can then obtain the
depth value(s) at your mouse point and compute real point coordinate
when it is valid.

Wang Rui


2012/10/1 Markus Ikeda markus.ik...@profactor.at:
 Hi,

 I'm new to OSG and I tried the osgkeyboardmouse example

 root/OpenSceneGraph/trunk/examples/osgkeyboardmouse/osgkeyboardmouse.cpp

 but I still couldn't manage to use the polytope intersector to select a 
 subset of points via mouseclick in a pointcloud.

 Did anybody have the same problem and solve it ?

 Thank you!

 Cheers,
 Markus

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





 ___
 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] Render passes and stereo handling

2012-10-08 Thread Wang Rui
Hi Gaurav,

A possible solution I think (but never tested it) is to set a draw
callback to left/right render stage (stages can be obtained from
camera-getRenderer()-getSceneView()-getRenderStageLeft(), and then
use RenderBin::setDrawCallback... Oops). And you may know if left or
right render stage is drawing in the callback and change your shader
inputs in time. But this is really ugly and unsafe in multithreading
mode...

Maybe it is good for OSG to add a flag in RenderInfo to indicate if
current drawing process is for left or right eye. And I just do wonder
if there are some better ideas not to change your stereo inputs on the
fly (maybe you can only change the contents and dirty them).

Wang Rui


2012/10/2 Gaurav Chaurasia gaurav.chaura...@inria.fr:
 Hi,
 Is there a way to know which eye (left/right) is currently being drawn inside 
 osg::Camera::DrawCallback. There is the UserData field in RenderInfo, but I 
 don't think I can use it for my purpose without having to patch 
 osgUtil::SceneView.cpp - the patch being that I update UserData before 
 drawing each eye.

 Actually, I am doing render passes with render targets for a stereo 
 application. So I need to switch shader inputs like textures,uniforms for 
 each eye just before the draw call. I figured I can use the PreDrawCallback 
 for the purpose because it is called inside RenderStage::draw just before the 
 actual rendering happens. If someone has a cleaner solution, I would be most 
 grateful.

 Thank you!

 Cheers,
 Gaurav

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





 ___
 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