Re: [osg-users] changing the up direction of the SphericalManiuplator

2010-10-21 Thread J.P. Delport

Hi,

On 20/10/10 21:55, Cory Riddell wrote:

  Tim

Thanks for the reassurance and the explanation. My code is working well
now and I'm very happy with it. I hardly had to change anything, so that
makes me think I got it right.

I do kind of wish I could always have my orbits be around the center of
my scene rather than the center of the view. I typically only have one
blob of stuff in my entire scene and it would be nice to make it look
like my blob of stuff is being rotated rather than I'm orbiting the
camera around some arbitrary center point (which starts at the center of
my blob but can be moved by a pan).


Just force the _center value to be what you want and disallow 
modification of it.


jp



Cory


On 10/20/2010 2:24 AM, Tim Moore wrote:

On Mon, Oct 18, 2010 at 10:23 PM, Cory Riddell c...@codeware.com
mailto:c...@codeware.com wrote:

I've been plowing through this and I can almost get what I need, I
just don't entirely understand a couple of things.

Is it safe to think of the view matrix as the camera position and
orientation? By doing so, I think I understand
SphericalManipulator::getMatrix() method. It returns:

As was mentioned recently, the view matrix is actually the inverse of
camera position and orientation in the world. You can also think of it
as the position and orientation of the world in eye space. The
matrix returned by the manipulator classes is the camera pose; the
matrix returned by getInverseMatrix() is the view matrix.

return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))*
osg::Matrixd::rotate(M_PI_2-m_elevation, 1.0, 0.0, 0.0)*
osg::Matrixd::rotate(M_PI_2+m_heading, 0.0, 0.0, 1.0)*
osg::Matrixd::translate(m_center);

This manipulator has two parameters - heading and elevation.
Heading is the angle from the x-axis in the x-y plane and
elevation is the angle from the x-y plane (pi/2 would give you the
z-axis).

If I want the x-axis to be up rather than the z-axis, I add an
additional rotation:

return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))*
osg::Matrixd::rotate(M_PI_2-m_elevation, 1.0, 0.0, 0.0)*
osg::Matrixd::rotate(M_PI_2+m_heading, 0.0, 0.0, 1.0)*
osg::Matrixd::rotate(M_PI_2, 0.0, 1.0, 0.0)* // NEW!
osg::Matrixd::translate(m_center);

Am I tinkering with the right stuff here? (I've also made the
appropriate change to my getInverseMatrix() method.)

Yes, that looks fine.
Tim


It's feeling ok, but I do need to make more changes to the
manipulators code that handles pans.

Cory


On 10/15/2010 5:03 PM, Cory Riddell wrote:

I have been using the SphericalManipulator and it works really
well for my application.

One thing I would like to do is change which direction is up. The
default is Z == up. Sometimes I want X to be up. If I understand
the code, I need to make fairly extensive modifications to the
existing manipulator. Before I start down that road, I just
wanted to ask if that sounds right. I'm hoping I'm not missing
some place where I obviously just need to apply some
transformation matrix.

I actually want my entire scene to go sideways, not just orbit up
and down on my screen rather than right and left. For example, if
I were modeling a pencil (coaxial the z axis), I sometimes want
it standing on end, and sometimes lying on its side on my screen.

I think I'm asking a question that has been asked before:
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33695.html

Cory



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


___
osg-users mailing list
osg-users@lists.openscenegraph.org
mailto: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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


___
osg-users mailing list
osg-users@lists.openscenegraph.org

[osg-users] I want to use VncClient

2010-10-21 Thread Jianfeng Zhang
Hi all,

I download a file just like:

#include osgWidget/VncClient
#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers
class EscapeHandler : public osgGA::GUIEventHandler
{
public:
EscapeHandler() {}

bool handle(const osgGA::GUIEventAdapter
ea,osgGA::GUIActionAdapter aa)
{
if (ea.getHandled()) return false;

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYUP):
{
if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Escape)
{
osgViewer::View* view =
dynamic_castosgViewer::View*(aa);
if (view) view-getViewerBase()-setDone(true);

return true;
}
}

default:
return false;
}
return false;
}
};

int main(int argc,char** argv)
{
osg::ArgumentParser arguments(argc, argv);
osgViewer::Viewer viewer(arguments);

osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
   osg::Vec3(1.0f,0.0f,0.0f),
   osg::Vec3(0.0f,0.0f,1.0f),
   osg::Vec4(1.0f,1.0f,1.0f,1.0f),

osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);

osg::ref_ptrosg::Group group = new osg::Group;

for(int i=1; iarguments.argc(); ++i)
{
if (!arguments.isOption(i))
{
osg::ref_ptrosgWidget::VncClient vncClient = new
osgWidget::VncClient;
if (vncClient-connect(arguments[i], hints))
{
group-addChild(vncClient.get());

hints.position.x() += 1.1f;
}
}
}

viewer.setSceneData(group.get());

viewer.addEventHandler(new osgViewer::StatsHandler);

// add a custom escape handler, but disable the standard viewer one to
enable the vnc images to handle
// the escape without it getting caught by the viewer.
viewer.addEventHandler(new EscapeHandler);
viewer.setKeyEventSetsDone(0);

return viewer.run();
}


Then ,I use command g++ osgv.cpp -o osgv -losg -lvncclient -lvncserver
-losg -losgViewer -losgWidget

./osgv 127.0.0.1:0

output Warning: Could not find plugin to read objects from file 127.0.0.1:
insecure.vnc.

How can I connect vnc?

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


Re: [osg-users] osgviewer shortcut

2010-10-21 Thread Sébastien Barthélemy
Hi Alberto,

On Wed, Oct 13, 2010 at 3:26 PM, Alberto Luaces alua...@udc.es wrote:
 Sébastien Barthélemy writes:

 1) when one presses the h key, the text appears (after several seconds
 on my macbook pro) but is so small that it is unreadable
 I think this is the default font when arial.ttf is not found, you can
 check this from the messages in the console. You can point to

you're right, thanks!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] gprof integration?

2010-10-21 Thread Robert Osfield
Hi Terry,

On Thu, Oct 21, 2010 at 12:40 AM, Terry Welsh mogu...@gmail.com wrote:
 Is there any formal support for compiling on linux with -pg and using
 gprof?  I can only find support from before the cmake days.

I'm not familiar with gprof, but cmake build system is pretty flexible
and allows you to add in extra build options via the CMAKE_CXX_FLAGS,
perhaps this would be sufficient.

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


Re: [osg-users] I want to use VncClient

2010-10-21 Thread Robert Osfield
Hi Jianfeng? Zhang?  Could you sign with the name you wish to be
addressed as, thanks.

As for using the vnc support, you'll need the libvncserver dependency
and then reconfigure the build system to compile that OSG's vnc
plugin.

Robert.

On Thu, Oct 21, 2010 at 8:30 AM, Jianfeng Zhang zjf.ha2...@gmail.com wrote:
 Hi all,

 I download a file just like:

 #include osgWidget/VncClient
 #include osgViewer/Viewer
 #include osgViewer/ViewerEventHandlers
 class EscapeHandler : public osgGA::GUIEventHandler
 {
     public:
     EscapeHandler() {}

     bool handle(const osgGA::GUIEventAdapter
 ea,osgGA::GUIActionAdapter aa)
     {
     if (ea.getHandled()) return false;

     switch(ea.getEventType())
     {
     case(osgGA::GUIEventAdapter::KEYUP):
     {
     if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Escape)
     {
     osgViewer::View* view =
 dynamic_castosgViewer::View*(aa);
     if (view) view-getViewerBase()-setDone(true);

     return true;
     }
     }

     default:
     return false;
     }
     return false;
     }
 };

 int main(int argc,char** argv)
 {
     osg::ArgumentParser arguments(argc, argv);
     osgViewer::Viewer viewer(arguments);

     osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
    osg::Vec3(1.0f,0.0f,0.0f),
    osg::Vec3(0.0f,0.0f,1.0f),
    osg::Vec4(1.0f,1.0f,1.0f,1.0f),

 osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);

     osg::ref_ptrosg::Group group = new osg::Group;

     for(int i=1; iarguments.argc(); ++i)
     {
     if (!arguments.isOption(i))
     {
     osg::ref_ptrosgWidget::VncClient vncClient = new
 osgWidget::VncClient;
     if (vncClient-connect(arguments[i], hints))
     {
     group-addChild(vncClient.get());

     hints.position.x() += 1.1f;
     }
     }
     }

     viewer.setSceneData(group.get());

     viewer.addEventHandler(new osgViewer::StatsHandler);

     // add a custom escape handler, but disable the standard viewer one to
 enable the vnc images to handle
     // the escape without it getting caught by the viewer.
     viewer.addEventHandler(new EscapeHandler);
     viewer.setKeyEventSetsDone(0);

     return viewer.run();
 }


 Then ,I use command g++ osgv.cpp -o osgv -losg -lvncclient -lvncserver
 -losg -losgViewer -losgWidget

 ./osgv 127.0.0.1:0

 output Warning: Could not find plugin to read objects from file
 127.0.0.1:insecure.vnc.

 How can I connect vnc?

 Thanks very much




 ___
 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] gprof integration?

2010-10-21 Thread Alberto Luaces
Terry Welsh writes:

 Is there any formal support for compiling on linux with -pg and using
 gprof?  I can only find support from before the cmake days.

I think there is not any, but it should not be complicated. Just a
matter of calling

cmake -DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg 
-DCMAKE_SHARED_LINKER_FLAGS=-pg

-- 
Alberto

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


[osg-users] bugs with the collada loader: cannot share arrays

2010-10-21 Thread Sébastien Barthélemy
Hello,

I'm generating collada 1.4 animations from a simulator. In order avoid
redundant information and generate smaller files, I tried to share
data between the animation channels. For instance, the timeline is
common to all the animation channels and could be stored once.

Are are two examples of such optimized files:

http://gist.github.com/610049#file_factor_timeline.dae
http://gist.github.com/610049#file_factor_output.dae

osganimationviewer crashes when opening them.

Here is another example, without any animation, where vertices are
factorized between two meshes.

http://gist.github.com/610049#file_factor_vertices.dae

osgviewer fails to open it:

$ osgviewerd factor_vertices.dae
No float array found
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check
Abort trap

I believe these example files are valid : they pass coherencytest, and
I asked on the collada forum [1] for a confirmation. The dae plugins
seems to make invalid assumptions about the structure of the XML.

[1] https://collada.org/public_forum/viewtopic.php?f=12t=1776
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bugs with the collada loader: cannot share arrays

2010-10-21 Thread Robert Osfield
Hi Sébastien,

Which version of the OSG are you using?

Robert.

2010/10/21 Sébastien Barthélemy barthel...@crans.org:
 Hello,

 I'm generating collada 1.4 animations from a simulator. In order avoid
 redundant information and generate smaller files, I tried to share
 data between the animation channels. For instance, the timeline is
 common to all the animation channels and could be stored once.

 Are are two examples of such optimized files:

    http://gist.github.com/610049#file_factor_timeline.dae
    http://gist.github.com/610049#file_factor_output.dae

 osganimationviewer crashes when opening them.

 Here is another example, without any animation, where vertices are
 factorized between two meshes.

    http://gist.github.com/610049#file_factor_vertices.dae

 osgviewer fails to open it:

    $ osgviewerd factor_vertices.dae
    No float array found
    terminate called after throwing an instance of 'std::out_of_range'
      what():  vector::_M_range_check
    Abort trap

 I believe these example files are valid : they pass coherencytest, and
 I asked on the collada forum [1] for a confirmation. The dae plugins
 seems to make invalid assumptions about the structure of the XML.

 [1] https://collada.org/public_forum/viewtopic.php?f=12t=1776
 ___
 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] bugs with the collada loader: cannot share arrays

2010-10-21 Thread Sébastien Barthélemy
Hi Robert,

On Thu, Oct 21, 2010 at 11:25 AM, Robert Osfield
robert.osfi...@gmail.com wrote:
 Which version of the OSG are you using?

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


Re: [osg-users] changing the up direction of the SphericalManiuplator

2010-10-21 Thread Tom Pearce
I haven't tried it, but wouldn't changing the order of multiplication in the 
get(Inverse)Matrix methods do the trick:

return osg::Matrixd::translate(osg::Vec3d(0.0, 0.0, m_distance))*
osg::Matrixd::translate(m_center)*
osg::Matrixd::rotate(M_PI_2-m_elevation, 1.0, 0.0, 0.0)*
osg::Matrixd::rotate(M_PI_2+m_heading, 0.0, 0.0, 1.0)*
osg::Matrixd::rotate(M_PI_2, 0.0, 1.0, 0.0);//  NEW!

You essentially want the m_center point to rotate around the object in 
addition to the camera-offset vector (m_distance) rotating - that way you can 
still pan, but the object would stay at the same location on the screen when 
you're rotating.  So apply both translations before/after the rotations, 
instead of splitting them up.

Again, haven't tested this, just throwing the idea out.

Cheers,
Tom

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





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


Re: [osg-users] integrating tessellation shaders into osg

2010-10-21 Thread Tassilo Glander
Hi Waldemar,

I found the samples pack on g-truc very instructing for opengl 4 related stuff, 
including tessellation shaders:
http://www.g-truc.net/post-0333.html 

Cheers,
Tassilo

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





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


Re: [osg-users] Paged LOD expiration time issues in osg 2.8.3

2010-10-21 Thread Rafa Gaitan
Hi Robert,

We finally solved the problem!! First sorry for the noise! :)
PagedLOD, DatabasePager and the rest of the 2.8.3 is  working
perfectly.

The problem on our side was a Java object that kept references to an
osg::Texture2D after applied to the terrain. Java destruction policy
is .. well is Java, so the more tiles loaded the more references not
released (only when finalize called, and this only occurs from time to
time). Now we release resources on C++ after applied so it not depends
on Java.

We really fixed horrible bug here! :)

Thank you and sorry for the noise!.
Rafa.


2010/10/19 Rafa Gaitan rafa.gai...@gmail.com:
 Hi Robert,

 2010/10/19 Robert Osfield robert.osfi...@gmail.com:
 Hi Rafa,

 I think Paul merged improvements made to DatabasePager made to
 svn/trunk into 2.8.3.
 The improvements change the way that PagedLOD's are expired, changing
 it from time based expiry to a system where the number of PagedLOD are
 capped to a below a users specified maximum, if the number of PagedLOD
 is below value then it won't expiry any subgraphs, only when new
 subgraphs are loaded and the new number exceeds the max will the pager
 start expiring old PagedLOD's.  This scheme is far more reliable and
 controllable than the old time based scheme.

 Yes, we knew that and that's why we want to use the 2.8.3 version.


 In your case it could be that the default max value of 500 is too high
 for your application, in which case you can adjust it down via the
 OSG_MAX_PAGEDLOD env var or programmatically via the DatabasePager
 method:

        /** Set the target maximum number of PagedLOD to maintain in memory.
          * Note, if more than the target number are required for
 rendering of a frame then these active PagedLOD are excempt from being
 expiried.
          * But once the number of active drops back below the target
 the inactive PagedLOD will be trimmed back to the target number.*/
        void setTargetMaximumNumberOfPageLOD(unsigned int target) {
 _targetMaximumNumberOfPageLOD = target; }


 I forget to mention in my previous mail that we already have this
 variable to 2 (We knew that this is really a
 low value but in our application and using java we need to free as
 soon and as fast as possible).

 If you are still seeing problems then it could be that there is a bug,
 and there is chance that it might already be addressed in svn/trunk or
 one of the 2.9.x series.  I'm actually working of
 DatabasePager/IncrementalCompileOperation right now so it's not a bad
 time for me to look at a regression if you can provide guidance on how
 to reproduce the problem.

 We also took a look to the changes between 2.8.3 and trunk but lot of
 changes are made so not sure if the problem persists there.

 Our trunk version is working against osg trunk, so once we finish the
 build we can do a simple example to test if continues happening on
 trunk.

 Cheers,
 Rafa.



 Cheers,
 Robert.



 On Tue, Oct 19, 2010 at 11:52 AM, Rafa Gaitan rafa.gai...@gmail.com wrote:
 Hi,

 We are currently using osg 2.8.3, with osgVirtualPlanets in a GIS
 application (gvSIG-3D). Trying to get a new build we migrated from
 2.8.2 to 2.8.3.

 Testing the build we have realized that the memory doesn't free as
 fast as previous version, getting a big memory usage of the
 application.

 Getting deep on the issue we have compared differences between 2.8.2
 an 2.8.3 on DatabasePager and we have seen that some code:

     if (osgDB::Registry::instance()-getSharedStateManager())
         osgDB::Registry::instance()-getSharedStateManager()-prune();

     // update the Registry object cache.
     
 osgDB::Registry::instance()-updateTimeStampOfObjectsInCacheWithExternalReferences(frameStamp.getReferenceTime());
     osgDB::Registry::instance()-removeExpiredObjectsInCache(expiryTime);

 has been removed from the next methods:

   void DatabasePager::capped_removeExpiredSubgraphs(const
 osg::FrameStamp frameStamp)
   void DatabasePager::expiry_removeExpiredSubgraphs(const
 osg::FrameStamp frameStamp)

 I'm not sure if the changes are intentionally or maybe a bug was
 introduced in this part of code.

 What do you think?

 Thanks!
 Rafa.


 --
 Rafael Gaitán Linares
 Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
 http://gvsig3d.blogspot.com
 Ciudad Politécnica de la Innovación
 Universidad Politécnica de Valencia
 ___
 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




 --
 Rafael Gaitán Linares
 Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
 http://gvsig3d.blogspot.com
 Ciudad Politécnica de la Innovación
 Universidad Politécnica de Valencia




-- 
Rafael Gaitán Linares
Instituto de 

Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
Hi,

yes, it should use texture 0, but how do I specify this ? The 1 in this code 
line :
stateSet - addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , 
stTexture , 1 ) ) ; 

does not choos a texture, but sets the number of elemets in the uniform ( one 
sampler2D ).

The texture unit association happens ( to my understanding ) with this :
stateSet - setTextureAttributeAndModes( 1 , projectionTexture , 
osg::StateAttribute::ON ) ;

But I can't do this for texture 0 ( stTexture ) as it is defined inside the 
.osg file.

So basically the question is, how to assotiate a sampler2D uniform with a 
certain texture Unit ( from an .osg file ) ?



Thank you!

Cheers,
Peter

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





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


[osg-users] [osgPlugins] ffmpeg synchronisation and frame dropping

2010-10-21 Thread Patrice Defond
Hello,
I search to understand how the ffmpeg plugin works. I use a video without sound.

If the thread is too fast for the video, there is a synchronisation before 
publish frame : FFmpegDecoderVideo apply a delay with an internal timer.
But if the thread is late, is there frame dropping ? or maybe, the plugin up 
the video framerate ... ?


Cheers,
Patrice

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





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


Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Frederic Bouvier
Hi Peter,

try 

stateSet - addUniform( new osg::Uniform( stTexture , 0 ) ) ;
instead;

Regards,
-Fred

- Peter Wrobrl particlepe...@gmx.de a écrit :

 Hi,
 
 yes, it should use texture 0, but how do I specify this ? The 1 in
 this code line :
 stateSet - addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D ,
 stTexture , 1 ) ) ; 
 
 does not choos a texture, but sets the number of elemets in the
 uniform ( one sampler2D ).
 
 The texture unit association happens ( to my understanding ) with this
 :
 stateSet - setTextureAttributeAndModes( 1 , projectionTexture ,
 osg::StateAttribute::ON ) ;
 
 But I can't do this for texture 0 ( stTexture ) as it is defined
 inside the .osg file.
 
 So basically the question is, how to assotiate a sampler2D uniform
 with a certain texture Unit ( from an .osg file ) ?
 
 
 
 Thank you!
 
 Cheers,
 Peter
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32941#32941
 
 
 
 
 
 ___
 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] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
Figured it out finally.

Need to use :
stateSet - addUniform( new osg::Uniform( stTexture , 0 ) ) ;
stateSet - setTextureAttributeAndModes( 1 , projTexture , 
osg::StateAttribute::ON ) ;
stateSet - addUniform( new osg::Uniform( projectionTexture , 1 ) ) ;

Instead of :
stateSet - addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , 
stTexture , 1 ) ) ;
stateSet - setTextureAttributeAndModes( 1 , projTexture , 
osg::StateAttribute::ON ) ;
stateSet - addUniform( new osg::Uniform( osg::Uniform::SAMPLER_2D , 
projectionTexture , 1 ) ) ;


Thank you!

Cheers, searching for the Pivot of my Soul, PP !!!

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





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


Re: [osg-users] Multitexture Issue in GLSL Fragment Shader

2010-10-21 Thread Peter Wrobrl
Hi,

that was classic, thx Fredric :-)

Thank you!

Cheers, searching for the Pivot of my Soul, PP !!!

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





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


Re: [osg-users] Drawing complex labels of 3D points in screen space

2010-10-21 Thread Yurii Monakov
Hi All

After some googling I've discovered an AutoTransform node )) When
setting it's auto-rotate mode to ROTATE_TO_SCREEN and
setAutoScaleToScreen(true) it gives me exactly what I want. The only
problem is that after looking at AutoTransform node I noticed that it
does a lot of computation inside. The only thing I need is to push
root's MVPW matrix to some part of the graph (Transform nodes, which
are children of the screen-spaced node) to update their positions
properly. Is there any other way to do this?

Thank you!

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


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-21 Thread John Kelso

Hi,

Just a recap:

We aren't using CompositeViewer- just a Viewer with 4 slave cameras each in
its own window.  Each window is opened on a separate graphics card.  We're
running X11 which has no issues with graphics card affinity.  We aren't
using mosaic mode, twinview, xinerama or anything else fancy- just a simple
mapping of one X display to one graphics card.

We can run four copies of our program at the same time, each displaying to a
separate card and all four can run as fast as a single copy.

If I try running one copy of the program displaying to multiple windows the
frame rate drops as the number of windows increases.  If the frame rate for
one window is N, then opening 2 windows gives roughly N/2 FPS, three windows
gives N/3 and so forth.  I also get the same results if I open multiple
windows on just one card.  I can see N draw threads by running top.

This is true if I use just one copy of the scenegraph, set in the viewer, or
four separate copies of the scenegraph, each loaded in a single slave
camera.

I get similar results for setting serial draw to on or off.  (Actually
setting it to on, the default is a bit faster.)  I'm using the
culldrawthreadpercontext threading model.

At this point I've run out of OSG things to try, but am open to suggestions.
At this point I'm assuming it's either an Nvidia driver bug or an OSG bug.
(Latest Nvidia driver, OSG 2.8.3)

Thanks,

John

On Wed, 20 Oct 2010, Paul Martz wrote:


On 10/20/2010 1:44 AM, Serge Lages wrote:

Hi,

Here we had a setup with 2 NVidia cards and 4 screens on Linux (2 twinviews), on
the application side we used a CompositeViewer with 2 views and 4 cameras (2
contexts), and we had a solid 60fps without problems :


I think John can also hit 60fps, if he uses a small enough data set, so the
framerate itself is irrelevant. The question is: Do the draw traversals occur
simultaneously, and do they take the same time in the multi-window case as they
do in the single-window case?

In other words, if your data set running single windowed has a combined cull and
draw that just barely fits in 16ms and therefore runs at 60hz, how does that
software perform in the multi-window case? For John, that case drops to 30fps or
15fps, because the combined cull-draw for each window quadruples.



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


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-21 Thread Robert Osfield
Hi John,

On Thu, Oct 21, 2010 at 5:35 PM, John Kelso ke...@nist.gov wrote:
 At this point I've run out of OSG things to try, but am open to suggestions.
 At this point I'm assuming it's either an Nvidia driver bug or an OSG bug.
 (Latest Nvidia driver, OSG 2.8.3)

From the sound of the setup of hardware and software you have you
should get the scaling that one expect from one such set up.  Clearly
the hardware is capable of doing it - running the separate apps shows
this.  This does leave the OSG or the NVidia driver.

The OSG has scaled just fine in the past on other multi-graphics card
systems, and the design and implementation should lead to good
scaling.  Personally I'd suspect the NVidia driver is the problem, but
we can't rule out the OSG have some bottleneck that we've introduced
inadvertently.

One way to investigate whether the OSG being a problem would be to run
the OSG against a dummy graphics contexts that just eats all the
OpenGL calls.  Is it possible to use Mesa in this way?  Or perhaps
just write a non GL library that implements all the function entry
points but then does a non op or just logs the timings.

Another route to take is to drop in some ATI cards and see how things
scale.  Others on this thread have indicated they have seen better
scaling with ATI cards.   Doing benchmarks of ATI vs NVidia showing
that the NVidia drivers suck really badly for mult-context,
multi-threaded apps should get their attention.

Another approach might be to look to NVidia for an OpenGL example that
claims to scale well, then go test it.  Perhaps a tool like Equalizer
has multi-threaded, multi-context support that could serve as testbed.

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


[osg-users] VPB problem with large database...

2010-10-21 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
All,

 

I'm seeing some issues with VPB when attempting to build a very large
database. My command is the following:

 

vpbmaster -TERRAIN -PagedLOD -geocentric -whole-globe -t wholeearthtexture
-t detailtexture -d dted -l 24 -o database.ive

 

What I'm seeing is that vpbmaster creates the tasks and logs directories
followed by the scheduling of tasks. During the scheduling of tasks, I see
the threads osgdem. created on the machine and then die a few seconds
later. vpbmaster then just waits for something to happen and eventually goes
to sleep. I'm guessing that this is happening because the threads died for
some reason and vpbmaster just sits there waiting for them to come back. 

 

I understand the VPB is able to handle the building of very large databases
but it seems to be choking in our particular case. If I run the same command
above on a smaller set of data, things run just fine.

 

Our system has 16 processors with ample disk and memory space to handle what
is needed. It also runs Fadora core 13.

 

Has anyone else seen this issue? Is there a flag or setting that I need to
use to build a large database?

 

Any input would be appreciated.

 

-Shayne



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-21 Thread Paul Martz

On 10/21/2010 10:35 AM, John Kelso wrote:

I get similar results for setting serial draw to on or off.


Can you double check this, John? My understanding is that when you have 
serialize set to on (the default), then you get a draw thread per window and the 
per-thread draw time (from stats display) is X. But they run sequentially, so 
the total draw time is X*N, where N is the total number of draw threads. When 
you turn serialize off, the per-thread draw time increases to X*N, but the 
threads run concurrently so the total draw time doesn't change and is still on 
the order of X*N.


So the results for serialize on or off are actually quite different. Am I 
understanding things correctly?


--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-21 Thread Steve Satterfield

On Thu, 21 Oct 2010, Paul Martz wrote:


On 10/21/2010 10:35 AM, John Kelso wrote:

I get similar results for setting serial draw to on or off.


Can you double check this, John? My understanding is that when you have
serialize set to on (the default), then you get a draw thread per window and the
per-thread draw time (from stats display) is X. But they run sequentially, so
the total draw time is X*N, where N is the total number of draw threads. When
you turn serialize off, the per-thread draw time increases to X*N, but the
threads run concurrently so the total draw time doesn't change and is still on
the order of X*N.

So the results for serialize on or off are actually quite different. Am I
understanding things correctly?

--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/


John is away this afternoon, so I'll reply.

John's statement is correct, where similar is total time(frame rate) is
only slightly different regardless of serial draw on or off. Below is what I
observe when we run the test program. This behavior is true in both the
original program with a single scene graph and the modified test with a
complete scene graph per screen.

OSG_SERIALIZE_DRAW_DISPATCH=ON

With the stats displayed, the draw bar graphs for N threads are nicely
stair stepped as you would expect for serialized draw with a total of X*N
time.

OSG_SERIALIZE_DRAW_DISPATCH=OFF

With the stats displayed, the draw bar graphs for N threads are clearly
parallel and all the same length. The total time is actually X*N+A where A
is some additional time.


So like Robert originally noticed when he implemented
OSG_SERIALIZE_DRAW_DISPATCH, serial draw is faster than parallel draw for a
particular hardware configuration. However, the problem remains - the more
screens (GPUs), the slower the frame rate.

-Steve Satterfield





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


Re: [osg-users] OSG seems to have a problem scaling to multiple windows on multiple graphics cards

2010-10-21 Thread John Kelso

Hi,

I will try to build 2.9.9 with both mesa and the debugger- I've never done
either, so it'll be a learning experience.

I will be at Viz next week, and have a side panic project to work on too, so
I might not get this done until early November.

Thanks,

John

On Thu, 21 Oct 2010, Robert Osfield wrote:


Hi John,

On Thu, Oct 21, 2010 at 5:35 PM, John Kelso ke...@nist.gov wrote:

At this point I've run out of OSG things to try, but am open to suggestions.
At this point I'm assuming it's either an Nvidia driver bug or an OSG bug.
(Latest Nvidia driver, OSG 2.8.3)



From the sound of the setup of hardware and software you have you

should get the scaling that one expect from one such set up.  Clearly
the hardware is capable of doing it - running the separate apps shows
this.  This does leave the OSG or the NVidia driver.

The OSG has scaled just fine in the past on other multi-graphics card
systems, and the design and implementation should lead to good
scaling.  Personally I'd suspect the NVidia driver is the problem, but
we can't rule out the OSG have some bottleneck that we've introduced
inadvertently.

One way to investigate whether the OSG being a problem would be to run
the OSG against a dummy graphics contexts that just eats all the
OpenGL calls.  Is it possible to use Mesa in this way?  Or perhaps
just write a non GL library that implements all the function entry
points but then does a non op or just logs the timings.

Another route to take is to drop in some ATI cards and see how things
scale.  Others on this thread have indicated they have seen better
scaling with ATI cards.   Doing benchmarks of ATI vs NVidia showing
that the NVidia drivers suck really badly for mult-context,
multi-threaded apps should get their attention.

Another approach might be to look to NVidia for an OpenGL example that
claims to scale well, then go test it.  Perhaps a tool like Equalizer
has multi-threaded, multi-context support that could serve as testbed.

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


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


[osg-users] Upside down smoke trail

2010-10-21 Thread Kevin Bentley
Hi,

I want to have a particle effect that looks like falling dust/dirt. I was 
thinking of using something like a smoketrail effect (with a different 
texture), but I can't figure out how to make the particles go down instead of 
up. 

Amy I on the wrong track here? Any ideas how to best accomplish a falling 
dust/dirt effect?

Thanks,

Kevin

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





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


[osg-users] rotating osgParticle::FireEffect

2010-10-21 Thread Brian Tomko
What is the best way to rotate an osgParticle::FireEffect?  It defaults to 
spraying particles down the +Z axis, but I want the effect to spray down the +Y 
axis.  I tried modifying the class so that the emitter was added to a 
positionattitudetransform but that does not seem to change anything.

Any suggestions?  I am using OSG 2.8.3 on windows.

Thanks

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





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


Re: [osg-users] Terrain geometry

2010-10-21 Thread Robert Gosztyla
Hi,

I'm back again with my terrain editing question :). I was serching forum for 
some solution, but i didn't find any. If i have found at least terraintile 
geometry and drawable associated with that how i could change this geometry? 
I've tried to use dirtyDisplayList() method, but it doesn't work as expected, i 
found also in some post that for terrain rendering this method won't work. 
There is also project called osgTDS, which modifies terrain geometry during 
loading from file and there is used method replaceDrawable() for geode. Is it 
the only solution for it? Or i can do is in some other way too? I rather don't 
want to modify height file, because probably i need some additional adjustment 
than only height on my terrain. 

Thank you!

Cheers,
Robert

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





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


[osg-users] Problem Setting the TranslateAxisDragger Matrix

2010-10-21 Thread Scott Shaw
I'm writing a Qt applicaiton that uses the TranslateAxisDragger to move the 
origin of my world and I've run into a problem.  I draw a point, attach the 
dragger to it and on the mouseReleaseEvent I emit a signal that is caught by 
another class and that class post multiplies the inverse of the dragger's 
matrix to the MatrixTransform over my geometry.  Also, in the same function, I 
explicitly set the matrix of the dragger back to the scaled identity.  This 
works most of the time, but if you drag the dragger and while your releasing 
the mouse button, you move the mouse quickly (I assume the pixel on the 
mouseReleaseEvent is different than the last pixel on the mouseMoveEvent), the 
geometry get's translated, but the dragger doesn't move back to the origin.   
I've tried setting the data variance to dynamic and using a visitor, but 
neither have worked.  Any insites on this problem would be appreciated!

Thank you!
Scott

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





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


[osg-users] previous post: Implementing a corner window within a single main osgviewer canvas

2010-10-21 Thread Ted Morris
Hi,

snip
Posted: Sun Oct 17, 2010 9:20 pmPost subject: Implementing a corner 
window within a single main osgviewer canvas. I see two replies but for some 
reason, I can't see the responses (I'm ahead of the game?). Sorry for the 
trouble.:-* 
snip

I would like to add a corner window within the main window, rendering 
part of my scenegraph. I've been thinking about using osghud to accomplish this 
task. But, before I delve into this any further, I would like to ask the group 
if another approach would be better. The osgviewer canvas is resizable, but I 
think I would keep the corner window the same size. 
Also, I'm only going to have the camera follow the object; I don't think 
handling mouse/keyboard events will be desired. 

I use wxWindows 2.9.x for developing the app. 

thanks in advance- 

Cheers, 
Ted
... 

Thank you!

Cheers,
Ted

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





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


Re: [osg-users] OSG on IPhone

2010-10-21 Thread Ulrich Hertlein
Hi guys,

On 27/07/10 18:23 , Stephan Huber wrote:
 Am 23.07.10 18:25, schrieb Florian Kolbe:
 Hi,
 I am very delighted to see that the porting is making progress, and I would 
 like to
 contribute. Here are my experiences so far:

 I did the following to get the code:

 Code:
 git clone http://github.com/stmh/osg.git
 cd osg
 git branch -a
 git checkout remotes/origin/iphone
 
 i am by no means a git expert, I used the tutorial at
 http://www.openscenegraph.org/projects/osg/wiki/Downloads/GIT to get the
 source.
 
 This should work, too:
 git clone git://github.com/stmh/osg.git
 git pull origin iphone

This is giving me a heap of conflicts (on a clean checkout/clone) along the 
lines of
From git://github.com/stmh/osg
 * branchiphone - FETCH_HEAD
CONFLICT (rename/delete): Rename
IPhone_Project/osgPlugins/imageio/ReaderWriterImageIO.cpp-src/osgPlugins/imageio/ReaderWriterImageIO_IPhone.cpp
in b79883a69545f82a573ec8aaa350262b3dedf4b1 and deleted in HEAD
CONFLICT (delete/modify): IPhone_Project/OSGIPhone.xcodeproj/hogbox.mode1v3 
deleted in
HEAD and modified in b79883a69545f82a573ec8aaa350262b3dedf4b1. Version
b79883a69545f82a573ec8aaa350262b3dedf4b1 of
IPhone_Project/OSGIPhone.xcodeproj/hogbox.mode1v3 left in tree.
CONFLICT (delete/modify): IPhone_Project/OSGIPhone.xcodeproj/hogbox.pbxuser 
deleted in
HEAD and modified in b79883a69545f82a573ec8aaa350262b3dedf4b1. Version
b79883a69545f82a573ec8aaa350262b3dedf4b1 of
IPhone_Project/OSGIPhone.xcodeproj/hogbox.pbxuser left in tree.
...

The 'git clone, git branch, git checkout' that Florian described above works 
however...

(I absolutely haven't got my head around git at all yet, so this might be a 
case of user
error.)

Or am I using the wrong repository?

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


Re: [osg-users] Render to texture for IPhone

2010-10-21 Thread Thomas Hogarth
Hi Stephan

perhaps all you have to do is this:
replace #define LOAD_FBO_EXT .. in FrameBufferObject.cpp (around line
42) with
#if defined(OSG_GLES1_AVAILABLE)
  #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string(OES) ).c_str() )
#else
   #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string(EXT) ).c_str() )
#endif
Do you have a simple demo cpp to test this issue?

I got round to trying FBOs with the modification you suggested. Here's what
I ended up using as GLES2 doesn't use the OES suffix.

   #if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)

#if defined(OSG_GLES1_AVAILABLE)

 #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string(OES) ).c_str() )

#else

 #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name),
std::string(#name).c_str() )

#endif

#else

#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string(EXT) ).c_str() )
#endif

I've got no Idea if the whole OES thing is iOs specific or not.

Any how, it hasn't worked but I'm only getting one complaint

Error: glDrawBuffers not supported by OpenGL driver

I've made a simple example that is attached and I've also attached the full
log with debug_fp set. Bear in mind i'm using GLES2 so there's some shader
gen stuff that shouldn't be relevant.

I'm gonna continue digging but would really appreciate if you could lend a
hand. Once this is working I think we have the full set of features I
commonly use in OSG all working for IPhone. Yippee

Tom
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
Adding parent0x6075c0
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
DatabasePager::addDatabaseThread() HANDLE_NON_HTTP
DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP
Render::Render() 0x652cd0
CullSettings::readEnvironmentalVariables()
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
ShaderComposer::ShaderComposer() 0x651b00
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
ShaderComposer::ShaderComposer() 0x6546d0
Adding parent0x6075c0
_availableQueue.size()=2
View::setSceneData() Reusing exisitng scene0x651c30
ShaderComposer::ShaderComposer() 0x655810
ShaderComposer::~ShaderComposer() 0x655810
 CameraManipulator::computeHomePosition(0, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
 CameraManipulator::computeHomePosition(0x833a00, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
Viewer::realize() - No valid contexts found, setting up view across all screens.
GraphicsContext::getWindowingSystemInterface() 0x608cd0 0x236494
GraphicsContext::registerGraphicsContext 0x655a30
ShaderComposer::ShaderComposer() 0x655d00
GraphicsContext::createNewContextID() creating contextID=0
Updating the MaxNumberOfGraphicsContexts to 1
  GraphicsWindow has been created successfully.
Adding parent0x6075c0
 CameraManipulator::computeHomePosition(0, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
 CameraManipulator::computeHomePosition(0x833a00, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
osg::State::_maxTexturePoolSize=0
osg::State::_maxBufferObjectPoolSize=0
GraphicsContext::getWindowingSystemInterface() 0x608cd0 0x236494
GraphicsWindowIPhone::realizeImplementation / ownsWindow: 1
GraphicsWindowIPhone::realizeImplementation: INFO: Created UIWindow with bounds 
'320, 480' (points).
GraphicsWindowIPhone::realizeImplementation: INFO: Created OpenGLES1 Context.
GraphicsWindowIPhone::realizeImplementation / view: 0x658d40
shouldAutorotateToInterfaceOrientation for 1: YES
shouldAutorotateToInterfaceOrientation for 1: YES
GraphicsWindowIPhone :: grabFocusIfPointerInWindow not implemented yet 
View::init()
OpenGL extensions supported by installed OpenGL drivers are:
GL_APPLE_framebuffer_multisample
GL_APPLE_rgb_422
GL_APPLE_texture_format_BGRA
GL_APPLE_texture_max_level
GL_EXT_blend_minmax
GL_EXT_discard_framebuffer
GL_EXT_read_format_bgra
GL_EXT_shader_texture_lod
GL_EXT_texture_filter_anisotropic
GL_IMG_read_format
GL_IMG_texture_compression_pvrtc
GL_OES_depth24
GL_OES_depth_texture
GL_OES_fbo_render_mipmap
GL_OES_mapbuffer
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_float
GL_OES_texture_half_float
GL_OES_vertex_array_object
OpenGL extension 'GL_ARB_vertex_shader' is not supported.
ShaderComposer::~ShaderComposer() 0x651b00
Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile

Re: [osg-users] Render to texture for IPhone

2010-10-21 Thread Thomas Hogarth
Bit more info

I've tracked it down to lines 541-553 of FrameBufferObject.cpp

Texture::TextureObject *tobj = 0;

if (_ximpl-textureTarget.valid())

{

tobj = _ximpl-textureTarget-getTextureObject(contextID);

if (!tobj || tobj-id() == 0)

{

_ximpl-textureTarget-compileGLObjects(state);

tobj = _ximpl-textureTarget-getTextureObject(contextID);


}

if (!tobj || tobj-id() == 0)

return;

}


It comes in tries the compileGLObjects then the next call to getTextureObject
still returns NULL so it returns.


Interesting, could that be a problem with my setup rather then the FBOs
themselves?


Tom




On 22 October 2010 04:47, Thomas Hogarth thomas.hoga...@googlemail.comwrote:

 Hi Stephan

 perhaps all you have to do is this:
 replace #define LOAD_FBO_EXT .. in FrameBufferObject.cpp (around line
 42) with
 #if defined(OSG_GLES1_AVAILABLE)
   #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
 std::string(#name)+std::string(OES) ).c_str() )
 #else
#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
 std::string(#name)+std::string(EXT) ).c_str() )
 #endif
 Do you have a simple demo cpp to test this issue?

 I got round to trying FBOs with the modification you suggested. Here's what
 I ended up using as GLES2 doesn't use the OES suffix.

 #if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)

 #if defined(OSG_GLES1_AVAILABLE)

  #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
 std::string(#name)+std::string(OES) ).c_str() )

 #else

  #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name),
 std::string(#name).c_str() )

 #endif

 #else

 #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
 std::string(#name)+std::string(EXT) ).c_str() )
 #endif

 I've got no Idea if the whole OES thing is iOs specific or not.

 Any how, it hasn't worked but I'm only getting one complaint

 Error: glDrawBuffers not supported by OpenGL driver

 I've made a simple example that is attached and I've also attached the full
 log with debug_fp set. Bear in mind i'm using GLES2 so there's some shader
 gen stuff that shouldn't be relevant.

 I'm gonna continue digging but would really appreciate if you could lend a
 hand. Once this is working I think we have the full set of features I
 commonly use in OSG all working for IPhone. Yippee

 Tom


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