Re: [osg-users] [build] How to play Video on Android

2012-11-08 Thread Jordi Torres
Hi Koduri,

I managed to show video in Android after a few modifications in the ffmpeg
plugin. I was going to send a submission, but somebody sent updates to make
possible to run OSG with the latest ffmepg library. So I am waiting this
submission to be merged to make the modifications again if possible.

The main modificiation is that in GL_ES the GL_BGRA mode is not supported,
so you should use GL_RGBA. And change PIX_FMT_RGB32 for PIX_FMT_BGR32 to be
consistent with the GL_RGBA change.

Cheers.

2012/11/8 Koduri Lakshmi ankiredd...@gmail.com

 Hi,

 I build OSG for Android with GLES1. I loaded models successfully on my
 mobile.
 Now  I want to play video instead of model (like the one in Windows
 desktop). Is it possible to play a video using OSG on Android.

 Can you please help me how to build plugins for these if possible. I
 searched my build installed directory but i did not found any ffmpeg or any
 other plug ins.

 I am using Ubuntu 11.10 OS and my Android OS version is 2.2.
 My mobile device is Samsung GTI 9000.



 ...


 Thank you!

 Cheers,
 Koduri

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




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




-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Review of osgQt changes.

2012-11-08 Thread Kristofer Tingdahl
Hi,

I have made a number of changes. I am not fully done yet, but I want to use
this a a starting point for a discussion. My updated files are found at
https://docs.google.com/folder/d/0B_4ZHt6ZZHE9ZTgycmQzcm9fVkk/edit

Here is in brief what I have done:


   1. I have made a new class osgQt::WidgetAdapter. The purpose of it is to
   serve as a bridge between any QWidget (not only QGLWidget) and the
   QGraphicsWindowQt. All access to the context and the realization is
   handled through the interface of the WidgetAdapter. The actual
   implementation of the WidgetAdapter is done in its subclasses. So far, I
   have made only one subclass (for the QGLWidget), but the plan is to make
   one for the indirect viewing later on. The creation of the
WidgetAdapteralso made it necessary to move some functionality into
that class from the
   QGraphicsViewerQT, such as switching the context.
   2. I have modified osgQt::GLWidget to inherit both the QGLWidget as well
   as the WidgetAdapter. Quite honestly, I do not want this double
   inheritance, and I would want it to inherit only osgQt::WidgetAdapter,
   and have a widget rather than being one. The delayed execution does however
   mandate the inheritance as the processDeferredEvents requires access to
   the QGLWidget::event() function. Hence, that still remains in the osgQt::
   GLWidget. Also, I suspect that a lot of client code counts on osgQt::
   GLWidget being a widget. All other event-handling (apart from the
   delayed one) is moved into the osgQt::WidgetAdapter, which gets the
   events through it's _receiver, and sends them to the graphics-adapter. I
   did not initially want the osgQt::WidgetAdapter::_receiver setup, but
   since osgQT::GLWidget inherits QGLWidget, I cannot let osgQt::
   WidgetAdapter inherit QObject and receive the events directly.

The example code works, my application (OpendTect) works. I do however have
a couple of questions:

   1. I never grasped the complexity of QGraphicsViewerQt::init, especially
   where we get the context from the traits, and gets the window, and then the
   osgQt::GLWidget from it (around line 550). It requires the
   QGraphicsViewerQt to have an getGLWidget just because of this, so I have
   reluctantly kept that function.
   2. There were some context-handling that I did not fully grasp: In
   GraphicsWindowQt::makeCurrentImplementation() we did not check if the
   current context was identical to our context, while in GraphicsWindowQt::
   runOperations() and swapBufferImplementation we did. I have kept this
   functionality with a bool on osgQt::WidgetAdapter::
   makeCurrentImplementation, while I have feeling that this distinction is
   bogus, and the boolean argument can be dropped.
   3. Who should own the Adapter? If it is a widget (as it is now with osgQt
   ::GLWidget), then it normally owned outside, while if it not a widget
   (which is what I want), then it would ideally inherit osg::Referenced.

There are also a few more systematic changes I want to do on osgQt (which
are not done yet).

   1. On the CMakeList.txt level, I would want to have an option whether to
   use optimized Qt or not. We have both in our environment, and today it uses
   debug-qt with debug-osg and release-qt with release-osg. Most often we
   are not debugging qt, and it I'm thinking of an option: Use optimized qt.
   Default would still be what it is today.
   2. I want to have support for global namespacing in Qt. Qt has support
   for always putting all Qt classes in a namespace, and we are planning on
   using that to avoid clashes between developers making plugins to our
   system and who want to use another Qt than we do. It would mean we make a
   set of macros that add the namespace in front of all Qt classes.


Comments and suggestions are welcome!


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


Re: [osg-users] saving camera view state

2012-11-08 Thread Elhanan Ilani
I had the same problem when using getMatrix and setByMatrix with a 
TerrainManipulator.

Using setByMatrix had no effectx. 
I fixed it by saving the actual center, distance and rotation parameters of the 
manipulator, then restoring them.

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





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


[osg-users] Need to override (redefine) Billboard::computeMatrix(...)

2012-11-08 Thread Louis Bouchard
Hi,

for my project, I need to derive Billboard and override computeMatrix().  
However, computeMatrix is not defined as virtual, so my redefined method is 
never called from within the osg pipeline since billboards, like everything 
else, are referred to via their normal osg class.

am I out of luck?


Cheers,
Louis

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





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


Re: [osg-users] problem with linear depth in fragment shader

2012-11-08 Thread Peterakos
Not sure if the different levels of depth are distinguishable in first image.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] Quesions about LOD in VPB

2012-11-08 Thread David Glenn
Greetings Robert!

I've been remerging around the code on VPB and I noticed that there is no way 
to set the PagedLOD range mode to PIXEL_SIZE_ON_SCREEN and of course do the 
setRange calculations for that. 

Is there any reason why or was was not added (sice it's part of PagedLOD) or 
there just no call to do that?

I needed to change that because the Display program that I'm working on uses 
the viewing area  (a.k.a the zoom) rather than moving the camera closer the 
terrain. It worked out very well.  

D Glenn


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

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





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


Re: [osg-users] [build] How to play Video on Android

2012-11-08 Thread Koduri Lakshmi
Hi Jordi Torres,

Thank you very much for the great help.

When can I expect new release? 

Now I am using OSG3.0.1.

... 


Thank you!

Cheers,
Koduri

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




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


[osg-users] Oddities when loading a FLT file

2012-11-08 Thread Chris Hanson
  I've encountered a strange behavior when loading a client-supplied FLT
file and I haven't been able to drill down and find an explanation. I think
I know what must be happening, but I can't find any mechanism to explain
how.

  The customer has a TXP database which refers to a FLT model. The FLT
model has a named MultiSwitch node, which controls some LightPointNodes.

  The symptom is that if the FLT file is loaded by itself (into
osgViewer.exe for example) a NodeVisitor of ours is able to locate the
MultiSwitch by name. If the FLT file is loaded via the DataBasePager from
the TXP file, the FLT loads, but the visitor is unable to locate the
MultiSwitch.

  Further investigation (adding debug code in a readfilecallback to save
out a temporary .OSG file) reveals that somehow the MultiSwitch is not even
in the resulting graph that gets produced from the FLT file. Converting the
FLT file to OSG via osgconv, or a simple readNodeFile+writeNodeFile at the
beginning of main() however produces an .OSG file that does contain the
missing MultiSwitch.

  I've gone so far as to add this debug code at the beginning of main(), as
well as in the readfilecallback that is invoked when the databasepager
loads the FLT file:

 osgDB::ReaderWriter::ReadResult result =
osgDB::Registry::instance()-readNodeImplementation(foo.flt,NULL);
osgDB::writeNodeFile(*(result.getNode()), foo.osg);


  I use readNodeImplementation to ensure we're avoiding any callbacks.

 When execute from main(), this code produces a OSG file containing the
MultiSwitch. When copy  pasted to the readfilecallback, it produces a OSG
file lacking the MultiSwitch.
.
  I don't believe the osgUtil Optimizer is in play here, as the
databasepager runs that after the load returns. I don't think any of the
FLT loader options (
http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/OpenFlight
)like
preserveObject are affecting things, because I'm passing a NULL options
pointer in both cases.

  What else could be different between these two cases that could lead to a
different graph being produced from the same FLT file, and how do I unify
this to one (correct) behavior? (I wouldn't think preserveObject or other
FLT loader options would be optimizing out a MultiSwitch as redundant
anyway, but perhaps it's misguided.)


  Please grant me some sanity.


-- 
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] Review of osgQt changes.

2012-11-08 Thread Wang Rui
Hi Kristofer,

I can't remember the exact time I wrote the GraphicsWindowQt class, maybe
two or three years ago. I designed it along with the OpenThreads for Qt to
make OSG's threading and windowing APIs compatible with Qt so that to later
migrate to Symbian/Meego... But then iPhone and Android change the world
and the plan is deprecated. :-) But Qt integration is still a very
interesting and valuable topic nowadays and thanks to the contribution of
the whole community, the GraphicsWindowQt class is now usable for some
practical uses. I myself also use Qt in some client projects and think of
integrating OSG with QML as well as some Qt 5.0 new features (e.g., the
Qt3D module) some time later.

I agree that the relationship of GraphicsWindowQt and GLWidget is
confusing. Other windowing interface like GraphicsWindowWin32 can either
create its new window or accept an existing one for the rendering context
use. An ideal result in my opinion is that we can directly set a QGLWidget
as an OSG window using Traits::inheritedWindowData, but the event handling
must be overrode, for example, using installEventFilter() to make sure OSG
can communicate with Qt window. In this way maybe we will not have to use
any adapters but only send a QGLWidget pointer to the traits like:

osg::ref_ptrosg::Referenced windata = new
osgQt::GraphicsWindowQt::WindowData(qtWidget);
traits-inheritedWindowData = windata;
osg::GraphicsContext* gc =
osg::GraphicsContext::createGraphicsContext(traits.get());

And thus remove present GLWidget class and provides a clear solution to Qt
developers. What do you think about that?

Wang Rui

2012/11/8 Kristofer Tingdahl kristofer.tingd...@dgbes.com



 The example code works, my application (OpendTect) works. I do however
 have a couple of questions:

1. I never grasped the complexity of QGraphicsViewerQt::init,
especially where we get the context from the traits, and gets the window,
and then the osgQt::GLWidget from it (around line 550). It requires
the QGraphicsViewerQt to have an getGLWidget just because of this, so
I have reluctantly kept that function.
2. There were some context-handling that I did not fully grasp: In
GraphicsWindowQt::makeCurrentImplementation() we did not check if the
current context was identical to our context, while in GraphicsWindowQt
::runOperations() and swapBufferImplementation we did. I have kept
this functionality with a bool on osgQt::WidgetAdapter::
makeCurrentImplementation, while I have feeling that this distinction
is bogus, and the boolean argument can be dropped.
3. Who should own the Adapter? If it is a widget (as it is now with
osgQt::GLWidget), then it normally owned outside, while if it not a
widget (which is what I want), then it would ideally inherit osg
::Referenced.

 There are also a few more systematic changes I want to do on osgQt (which
 are not done yet).

1. On the CMakeList.txt level, I would want to have an option whether
to use optimized Qt or not. We have both in our environment, and today it
uses debug-qt with debug-osg and release-qt with release-osg. Most
often we are not debugging qt, and it I'm thinking of an option: Use
optimized qt. Default would still be what it is today.
2. I want to have support for global namespacing in Qt. Qt has support
for always putting all Qt classes in a namespace, and we are planning
on using that to avoid clashes between developers making plugins to
our system and who want to use another Qt than we do. It would mean we make
a set of macros that add the namespace in front of all Qt classes.


 Comments and suggestions are welcome!


 - Kristofer Tingdahl

 ___
 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 linear depth in fragment shader

2012-11-08 Thread Wang Rui
Hi Peterakos,

Try changing the internal format of the output buffer to float32. I guess
it is a precision problem. During the SSAO implementation of effect
compositor (in osgRecipes now) I also encountered the problem and using 32
bit float values seems good to me.

Wang Rui


2012/11/9 Peterakos hay...@gmail.com

 Hello.

 I try to create linear values for depth using the following code:


 Vertex Shader
float depth_in_eye_space = (gl_ModelViewMatrix * gl_Vertex).z;
depth = (-depth_in_eye_space - near)/(far - near); //depth is varying

 Fragment Shader
gl_FragColor = vec4(depth, depth, depth, 1);


 The problem is that in the depth texture, many different levels of
 depth are creating. (attached 1)
 That causes problems in my next pass which uses the depth texture to
 create an ssao image. (attached 2)

 How can i get the right depth values in depth texture ?

 Thnx.

 ___
 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