Re: [osg-users] Building JNI wrapper for OSGdem
Hi Sean, The first I spotted watching your stacktrace is that your are mixing debug with release libraries. AFAIK on windows mixing debug and release always gives problems, so the best you can do if you want to debug your code is build osg in debug or build your code in release with debug symbols. Cheers, Rafa. 2012/5/9 Sean K sk92...@gmail.com: Hi, I took a look at your code. It looks good. Since the *.h headers from OSG and VPB DLLs are not intended for java JNI invocation, I see that your code has built is own DLL which in turn uses the OSG runtimes. I am taking this similar approach -- as follow... Since I want to do what osgdem.exe does but want to make that accessible from a java application, I wrote a C DLL on Windows that is invoked by my java class. When that DLL has all the includes and DLL lib imported linked to it (same build dependency as osgdem.exe -- but it is a DLL instead of a EXE), the java class can invoke that function in that DLL -- i put some test code in that DLL. Then I copied most of the code from osgdem.cpp into the main function of my DLL. I re-initialize the arguments etc from my entry point so that it mimics osgdem.cpp as much as possible -- at least at this version. Now, when I invoke my DLL which should do the same essential thing that osgdem.exe does, it encounters a java hotspot exception access violation. here is the content of that log file it is generated by jvm. (i hide the name of the company and myself to protect the privacy) # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x5ca957aa, pid=2036, tid=5660 # # JRE version: 6.0_32-b05 # Java VM: Java HotSpot(TM) Client VM (20.7-b02 mixed mode windows-x86 ) # Problematic frame: # C [MSVCR100D.dll+0x1157aa] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --- T H R E A D --- Current thread (0x0211a800): JavaThread main [_thread_in_native, id=5660, stack(0x0022,0x0027)] siginfo: ExceptionCode=0xc005, reading address 0xccc0 Registers: EAX=0xccac, EBX=0x44b618c8, ECX=0xccac, EDX=0x0004 ESP=0x0026e788, EBP=0x0026e7b4, ESI=0x0026ea8c, EDI=0x0026e898 EIP=0x5ca957aa, EFLAGS=0x00010286 Top of Stack: (sp=0x0026e788) 0x0026e788: 4fc8e4ec 0026e898 0026ea8c 44b618c8 0x0026e798: ccac fffe 0026e33c 0026ea78 0x0026e7a8: 5ca99320 13430fa0 0026e898 0x0026e7b8: 5e7d271c 0026e98c 0026ea8c 0x0026e7c8: 44b618c8 0x0026e7d8: 0x0026e7e8: 0x0026e7f8: Instructions: (pc=0x5ca957aa) 0x5ca9578a: 00 00 00 6a 04 e8 5c 3f f3 ff 83 c4 04 c7 45 fc 0x5ca9579a: 00 00 00 00 8b 45 08 83 e8 20 89 45 e4 8b 4d e4 0x5ca957aa: 8b 51 14 81 e2 ff ff 00 00 83 fa 04 74 41 8b 45 0x5ca957ba: e4 83 78 14 01 74 38 8b 4d e4 8b 51 14 81 e2 ff Register to memory mapping: EAX=0xccac is an unknown value EBX=0x44b618c8 is an oop {method} - klass: {other class} ECX=0xccac is an unknown value EDX=0x0004 is an unknown value ESP=0x0026e788 is pointing into the stack for thread: 0x0211a800 EBP=0x0026e7b4 is pointing into the stack for thread: 0x0211a800 ESI=0x0026ea8c is pointing into the stack for thread: 0x0211a800 EDI=0x0026e898 is pointing into the stack for thread: 0x0211a800 Stack: [0x0022,0x0027], sp=0x0026e788, free space=313k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [MSVCR100D.dll+0x1157aa] operator delete+0x5a C [libosggen.dll+0x2271c] std::allocatorchar::deallocate+0x2c C [libosggen.dll+0x208f5] std::basic_stringchar,std::char_traitschar,std::allocatorchar ::_Tidy+0x75 C [libosggen.dll+0x197d5] std::basic_stringchar,std::char_traitschar,std::allocatorchar ::~basic_stringchar,std::char_traitschar,std::allocatorchar +0x55 C [libosggen.dll+0x173a9] StartOsgDem+0x1ec9 C [libosggen.dll+0x29244] Java_foo_osgjni_core_GeneratorOSGImpl_startOsgDem+0xe4 j com.foo.osgjni.core.GeneratorOSGImpl.startOsgDem(DDLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z+0 j com.foo.osgjni.core.GeneratorOSGImpl.start(Ljava/io/File;Ljava/io/File;Ljava/io/File;Lcom/foo/osgjni/core/IOSGHandler;)Z+24 j com.foo.osgjni.core.GeneratorOSGImplTest.main([Ljava/lang/String;)V+67 v ~StubRoutines::call_stub V [jvm.dll+0xfad4b] V [jvm.dll+0x18c421] V [jvm.dll+0xfadcd] V [jvm.dll+0x95836] V [jvm.dll+0x9d778] V [jvm.dll+0xaf22b] C [javaw.exe+0x2155] C [javaw.exe+0x8614] C [kernel32.dll+0x1339a] BaseThreadInitThunk+0x12 C [ntdll.dll+0x39ed2] RtlInitializeExceptionChain+0x63 C [ntdll.dll+0x39ea5]
[osg-users] OSG and Qt fullscreen problem
Hi, I am trying to integrate an osg viewer into a Qt user interface. To do this I am using the osg viewer widget from the OpenSceneGraph 3.0 Cookbook. If I set the widget to fullscreen with the Qt method showFullScreen(). If I do this I have a gray border around my viewport. To eliminate the border I try to set the margin of the layout which includes the osgviewer to 0. But if I do this the Qt widget with viewer is not shown anymore. If I set the margin value to 1 then it works but I have again a small gray border. I know that this is working with OpenSG. Is there maybe a problem with osg?? Does someone has a solution for this problem?? Here is my code (Sorry I don'T know why the tabs are shown like this): viewerwidget.h Code: #ifndef VIEWERWIDGET_H #define VIEWERWIDGET_H // C++ includes #include iostream // Qt includes #include QtCore/QtCore #include QtGui/QtGui // OSG includes #include osgDB/ReadFile #include osgGA/TrackballManipulator #include osgViewer/ViewerEventHandlers #include osgViewer/Viewer #include osgQt/GraphicsWindowQt class ViewerWidget : public QWidget { public: ViewerWidget( QWidget *parent = 0, Qt::WFlags flags = 0 ) : QWidget(parent, flags) { osg::Camera* camera = createCamera( 0, 0, 640, 480 ); osg::Node* scene = osgDB::readNodeFile(cow.osg); m_viewer.setCamera( camera ); m_viewer.setSceneData( scene ); m_viewer.addEventHandler( new osgViewer::StatsHandler ); m_viewer.setCameraManipulator( new osgGA::TrackballManipulator ); // Use single thread here to avoid known issues under Linux m_viewer.setThreadingModel( osgViewer::Viewer::SingleThreaded ); osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*( camera-getGraphicsContext() ); if ( gw ) { QVBoxLayout* layout = new QVBoxLayout; /// layout-setMargin(0); /// layout-addWidget( gw-getGLWidget() ); setLayout( layout ); } connect( m_timer, SIGNAL(timeout()), this, SLOT(update()) ); m_timer.start( 40 ); } ~ViewerWidget() {} osg::Camera* createCamera( int x, int y, int w, int h ) { osg::DisplaySettings* ds = osg::DisplaySettings::instance().get(); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-windowDecoration = false; traits-x = x; traits-y = y; traits-width = w; traits-height = h; traits-doubleBuffer = true; osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setGraphicsContext( new osgQt::GraphicsWindowQt(traits.get()) ); camera-setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) ); camera-setViewport( new osg::Viewport( 0, 0, traits-width, traits-height) ); camera-setProjectionMatrixAsPerspective( 30.0f, static_castdouble(traits-width)/static_castdouble(traits-height), 1.0f, 1.0f ); return camera.release(); } protected: virtual void paintEvent( QPaintEvent* event ) { m_viewer.frame(); } osgViewer::Viewer m_viewer; QTimer m_timer; }; #endif // VIEWERWIDGET_H main.cpp Code: #include QtGui/QApplication #include viewerwidget.h int main(int argc, char *argv[]) { QApplication app( argc, argv ); ViewerWidget* widget = new ViewerWidget(0,Qt::WindowStaysOnTopHint | Qt::SplashScreen); widget-setGeometry( 0, 0, 800, 600 ); widget-showFullScreen(); widget-show(); return app.exec(); } Thank you! Cheers, Markus -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47603#47603 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Manipulator and selection
Hi, I started to work with OSG last week and I have some issues. For my project, I need to navigate in a scene and select three types of objects : points, lines and surfaces. I created 3 class : surface, point and line with this kind of tree: Surface /\ Line Line ... / \ /\ Point PointPoint ... The points also have references to its different parents (lines and segments) to make the update of the shapes easier after the modification of a point. Points can be shared by several lines ans surfaces and lines can also be shared by several surfaces. These three class inherit from Group and have a Geode and a geometry (a polygon, a line or a point). To navigate in the scene, I made my own manipulator. It works well with translations, but I have some issues with rotations. Basically, it is very similar to the orbit manipulator (same way to handle events) except that I do not compute the position from the distance and the center of the sphere (I set the position and simply update the position). Moreover I had the same problem with the orbit manipulator so I don't think it might come from here. The problem is that when I rotate, the camera is not really stable. It's shaking. If I'm far enough or if I go fast enough, I don't notice it. And I can't figure out where it comes from. Here is the setup of my camera : Code: osg::DisplaySettings* ds = osg::DisplaySettings::instance().get(); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-windowName = ; traits-windowDecoration = false; traits-x = 100; traits-y = 100; traits-width = 100; traits-height = 100; traits-doubleBuffer = true; traits-alpha = ds-getMinimumNumAlphaBits(); traits-stencil = ds-getMinimumNumStencilBits(); traits-sampleBuffers = ds-getMultiSamples(); traits-samples = ds-getNumMultiSamples(); setGraphicsContext( new osgQt::GraphicsWindowQt(traits.get()) ); setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) ); setViewport( new osg::Viewport(0, 0, traits-width, traits-height) ); //setProjectionMatrixAsOrtho(-static_castdouble(traits-width)/2.0, static_castdouble(traits-width)/2.0, -static_castdouble(traits-height)/2.0, static_castdouble(traits-height)/2.0, 1.0f, 1.0f); setProjectionMatrixAsPerspective(30.0f, static_castdouble(traits-width)/static_castdouble(traits-height), 1.0f, 1.0f ); I have the same problem with the orthographic mode. And here is My Qt widget : Code: SRE_OSGWidget::SRE_OSGWidget(QWidget* parent, SRE_Manipulator* m) : QWidget(parent) { manipulator= m; viewer = new osgViewer::Viewer; viewer-setThreadingModel(osgViewer::Viewer::ThreadPerCamera); osg::ref_ptrSRE_Camera camera = SRE::get()-getScene()-getCamera(); osg::ref_ptrosg::Group root = SRE::get()-getScene()-getRoot(); viewer-setCamera(camera.get()); viewer-setSceneData(root.get()); viewer-setCameraManipulator(manipulator.get()); osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*( camera-getGraphicsContext() ); if(gw==NULL){ //TODO print error exit(1); } QWidget* viewWidget = gw-getGLWidget(); QVBoxLayout* layout = new QVBoxLayout(this); layout-addWidget(viewWidget); connect( timer, SIGNAL(timeout()), this, SLOT(update()) ); timer.start(10); } void SRE_OSGWidget::paintEvent(QPaintEvent* e){ viewer-frame(); } Does anyone has any idea where it could come from? If you need more info or code, tell me. The following image illustrates my two other problems: The first one is the one in the red circle. I would like to make the point appear in front of the lines (and the lines in front of the polygon) when they have the same coordinates but I don't know how to do it. For example, in the image, we can see that the lines are over the point even though the coordinates used to define the lines are the same as the one used for the point. Is ther a state or a mode that would enable me to do it ? And finally, the last problem is about the selection of objects. When I click on a point or a line, it doesn't work. And sometimes, for some position of the cursor, when I click on a polygon it doesn't work either (for example at the position of the cursor in the image). Most of the time, I can correctly select surfaces, but sometimes, the ray seems not to hit the first surface (but it can hit the one behind). Here is the code that I used : Code: bool SRE_Controller::handleMousePush(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter us){ addMouseEvent(ea); unsigned int buttonMask = ea.getButtonMask(); if(buttonMask == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON){
[osg-users] OpenSceneGraph - voxel/terrain rendering
Hi, I have been working on a minecraft world viewer for a while, and most of my work has been done in Ogre3D, as this library is what I am most familiar with. However, it is pretty clear that Ogre just can't go fast enough with my specific use case - it sets so much redundant state per batch that a large number of terrain tiles/chunks slow it to a crawl, and it has no straightforward way to create/update a smaller number of terrain chunks that can be run from a separate thread, which means a small number of large batches introduce long rendering stalls. I am considering simply writing a renderer in raw openGL, but i do like the convenience of a slightly higher-level interface, especially when it comes to integrating features like adanced lighting/shadows, physics and animated characters on top of my terrain. How suitable will OpenSceneGraph be for this kind of task? - i would have up to 5 million triangles visible at once (though a large number of these will be overdrawn) , and this dataset could be split into arbitrary-sized chunks, to optimise batch size. The triangles are textured with a single 'atlas' texture, and the vertices are specified in their final global coordinate locations, so no transforms are needed for each chunk. I pretty much have CPU to burn for state-sorting and culling. Basically, does OSG have features for: a) updating OpenGL buffers/arrays in a separate thread b) optimised rendering by eliminating unnecessary state changes, compared to something like Ogre3d Thank you! Cheers, Pete -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47573#47573 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with semi-transparent textures
Hi, I encounter the following issue with semi-transparent texture images: After loading a textured model from a file, I want to change the texture image into an image sequence. My code looks similar to the one of the 'osgimagesequence' example program. The texture replacement works fine and the image sequence shows up as expected, except of the following issue: The original image loaded from the file has different transparency values for every pixel. The image sequence replacing the single image also has different transparency values for every pixel and every frame. While the image content (rgb-values) is showing up correctly the transparency values are not updated and stay constant for the whole image sequence. In particular, the transparency values shown for the image sequence are still the same as the ones from the original image. In short, replacing the texture image seems to update the rgb-values but not the transparency values. Here is a code snipped : Code: osg::StateAttribute* attr = stateSet-getTextureAttribute(textureNum,osg::StateAttribute::TEXTURE); if (attr) { texture2D = dynamic_castosg::Texture2D*(attr); if (texture2D) { texture2D-setDataVariance(osg::Object::DYNAMIC); texture2D-setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR); texture2D-setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR); texture2D-setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT); texture2D-setResizeNonPowerOfTwoHint(false); texture2D-setImage(imageSequence.get()); } } I have tried changing/updating the osg::Material node and/or adding osg::BlendFunc to change the transparency properties but without the desired result. I would highly appreciate if someone could give me a hint on how to fix this issue. Thanks a lot. Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47566#47566 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB build errors
Hi, I'm having the same issue in linux using CMAKE. Can you perhaps advise on a fix? Here is the compile output. Code: /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp: In function ‘bool writeResources(osgDB::OutputStream, const osgCuda::Program)’: /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:66:18: error: ‘BEGIN_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:87:8: error: ‘END_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp: In function ‘bool readResources(osgDB::InputStream, osgCuda::Program)’: /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:95:18: error: ‘BEGIN_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:116:8: error: ‘END_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp: In function ‘bool writeComputations(osgDB::OutputStream, const osgCuda::Program)’: /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:141:19: error: ‘BEGIN_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:152:8: error: ‘END_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp: In function ‘bool readComputations(osgDB::InputStream, osgCuda::Program)’: /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:160:19: error: ‘BEGIN_BRACKET’ is not a member of ‘osgDB’ /home/fino/working_dir/osgCompute/src/osgCudaSerializer/Program.cpp:184:8: error: ‘END_BRACKET’ is not a member of ‘osgDB’ make[2]: *** [src/osgCudaSerializer/CMakeFiles/osgdb_serializers_osgCuda.dir/Program.cpp.o] Error 1 make[1]: *** [src/osgCudaSerializer/CMakeFiles/osgdb_serializers_osgCuda.dir/all] Error 2 make: *** [all] Error 2 ... Thank you! Cheers, Fintan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47547#47547 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Identifying Unique Nodes Help
Hi, I am trying to load a scene with various ac3d models and I need to identify them when clicked on. I have two issues. 1) Lets say that I need to load model1.ac and model2.ac. How do I set up my scene? How do I read these files into a Node? How do I assign each node a unique identifier/ unique name? 2) When I try picking one of these objects similarly to how its shown in the osgpick example, how do I retrieve this unique identifier/ unique name? i.e., for each hit in the intersections, how do I retrieve the unique identifier/ unique name of the model that has been hit? Code: for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = intersections.begin(); hitr != intersections.end(); ++hitr) Thank you! Cheers, Joseph -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47542#47542 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG with Qt fullscreen problem
Hi, I am using the code example from the book OpenSceneGraph 3 Cookbook to implement an OSG application with a Qt gui. If I set the widget which contains the viewerwideget to showFullscreen() I get a gray border around my osg scene widget. I found a solution to set the margin of the layout to 0 to eliminate the border. I tried to set it to 0 but the windows is not shown anymore. Otherwise if I set the margin to 1 then is the window shown, but I have again a small border. Does someone has a solution for this problem?? Thank you! Cheers, Markus -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47475#47475 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ProxyNodes
Hi, I want to load my scene from multiple files. There should be one main.osgt file that should include or reference other files. I was expecting that osg::ProxyNode should serve for this purpose. Or is there another friendly approach? ProxyNode difficultly: - it does not support immediate loading of referenced files, e.g. ProxyNode is loaded on the next cull traversal only. Not immediately. As a result, I can not make pure geometry processing (without scene visualization) as all geometries of ProxyNodes just remains on disk. Or, is there an convenient approach to force ProxyNodes to be loaded? The best approach for me would be to indicate in osgDB::readNode() call that I want to read specified file including all ProxyNodes within it. Thanks, John ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Uniform arrays.
Well, adding [0] actually did the trick! Mismatch of the array sizes did not matter in the end(I want to pass arrays of variable length to glsl with sizes up to 20 elements, so that's fine with me). Not sure why my drivers don't work here, I'm on Linux with NVIDIA card and fairly up to date drivers. Thanks for helping me out! Cheers, Eldar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47609#47609 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Am 09.05.12 09:31, schrieb Ulrich Hertlein: When running this on OS X I'm seeing some odd behaviour as well: - roughly every 7s there is a jump in the draw time (see attached screenshot) - this happens even when *not* switching between the two groups (no update callback installed; both are visible at the same time) I see dramatic performance degression, when rotating the cube to a specific angle, performcance goes down from 60fps to 3fps. (MacPro with an ATI Radeon HD 5770 1024 MB) Rotating the cube a bit more the performance goes back to normal. Maybe Mac OS X internal multithreaded-rendering is the culuprit here, (which is enabled by default i think). I've seen this jump every 7s too, but when running the app for a longer time, the jump goes away. cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Manipulator and selection
I finally figured out what was the problem with the camera. It was just that I had really large coordinates (for example : 510, 510, 100). So I finally subtsracted an offset (510, 510, 0) to all my points and the manipulator now works just fine. It also solved part of the selection problem. And now that I use a PolytopeIntersector instead of a line segment intersector, I can select what I want. The last problem that I have now is to figured out how to make the point appear in front of the lines and the lines in front of the surfaces. Does anyone have a clue of how to do that ? Thanks, bob. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47611#47611 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Do you see the original problem as well? Does it act the same at .5 FPS and no switching, and degrade at 1 FPS? Thanks, John On Wed, 9 May 2012, Ulrich Hertlein wrote: When running this on OS X I'm seeing some odd behaviour as well: - roughly every 7s there is a jump in the draw time (see attached screenshot) - this happens even when *not* switching between the two groups (no update callback installed; both are visible at the same time) Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ProxyNodes
PCJohn wrote on 2012-05-09: Hi, I want to load my scene from multiple files. There should be one main.osgt file that should include or reference other files. I was expecting that osg::ProxyNode should serve for this purpose. Or is there another friendly approach? ProxyNode difficultly: - it does not support immediate loading of referenced files, e.g. ProxyNode is loaded on the next cull traversal only. Not immediately. As a result, I can not make pure geometry processing (without scene visualization) as all geometries of ProxyNodes just remains on disk. Or, is there an convenient approach to force ProxyNodes to be loaded? The best approach for me would be to indicate in osgDB::readNode() call that I want to read specified file including all ProxyNodes within it. Probably the easiest thing to do would be to create a DatabaseRequestHandler subclass that loads the file immediately and attach it to a NodeVisitor that you have traverse your model as soon as it is loaded. Hope this helps, -- Bryan Thrall Principal Software Engineer FlightSafety International bryan.thr...@flightsafety.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Qt
Hi, I use multiple Qt windows for rendering, that can be created and destroyed while program is running. My problem occurs when I destroy and than create new view. New view has incorrect scenegraph (other views has correct one). Any idea why ? ... Thank you! Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47614#47614 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Polygon budget estimate for OSG ?
Hi, I'd like to know if there is a way to estimate the polygon budget supported by OSG ? I understand that it would depend on the hardware, the models, etc. Thank you! Cheers, Maia -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47615#47615 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Am 09.05.12 15:26, schrieb John Kelso: Do you see the original problem as well? Does it act the same at .5 FPS and no switching, and degrade at 1 FPS? I don't see the original problem, the draw time is constant for both FPS, no peaks, nada. Only if i rotate the cube about 180° performance decrease to 3-5fps, regardless of the specified switch-timing. cheers, Stepahn ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph - voxel/terrain rendering
Are you using DrawInstanced? -- 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] Qt - multiple views
Hi, ok this doesnt have anything with view, I think the problem are Display Lists, it will call bad list, I dont know why (I think it's problem with sharing display lists to new context), T have switched to vertexarrays and it works Thank you! Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47618#47618 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Many thanks. This problem sure is beginning to smell like driver and/or card to me. I'd love to hear from other Linux users too. John On Wed, 9 May 2012, Stephan Maximilian Huber wrote: Am 09.05.12 15:26, schrieb John Kelso: Do you see the original problem as well? Does it act the same at .5 FPS and no switching, and degrade at 1 FPS? I don't see the original problem, the draw time is constant for both FPS, no peaks, nada. Only if i rotate the cube about 180° performance decrease to 3-5fps, regardless of the specified switch-timing. cheers, Stepahn ___ 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] OpenSceneGraph - voxel/terrain rendering
On 05/06/2012 02:38 AM, Pete Black wrote: How suitable will OpenSceneGraph be for this kind of task? - i would have up to 5 million triangles visible at once (though a large number of these will be overdrawn) , and this dataset could be split into arbitrary-sized chunks, to optimise batch size. The triangles are textured with a single 'atlas' texture, and the vertices are specified in their final global coordinate locations, so no transforms are needed for each chunk. I pretty much have CPU to burn for state-sorting and culling. I'd say it would at least be worth a look. If you organize your scene into an octree, you could minimize the section of the scene hierarchy that would change from frame to frame, which would keep update and cull traversals manageable. Basically, does OSG have features for: a) updating OpenGL buffers/arrays in a separate thread Yes, although I'm not sure how well your particular use case will work here. OSG requires you to specify which sections of the scene are dynamic and which are static. The Update/Cull thread(s) then traverse the dynamic objects in the scene while the Draw thread waits. Once all the dynamic objects have been traversed, the Draw thread begins doing its work. In your case, you'll probably be marking almost all of the scene dynamic, so I'm not sure how much speedup you'll get from the multithreading. b) optimised rendering by eliminating unnecessary state changes, compared to something like Ogre3d Yes. This is historically where OSG gets most of its speedup. OSG employs state sorting and lazy state updating in the draw dispatch. I'm guessing that with something like MineCraft, you'll have a lot of geometry, but a relatively small number of state sets. OSG would be perfect for this. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Uniform arrays.
On 05/09/2012 05:37 AM, Eldar Insafutdinov wrote: Well, adding [0] actually did the trick! Mismatch of the array sizes did not matter in the end(I want to pass arrays of variable length to glsl with sizes up to 20 elements, so that's fine with me). Not sure why my drivers don't work here, I'm on Linux with NVIDIA card and fairly up to date drivers. Thanks for helping me out! Hi, Eldar, The problem actually only occurs with recent NVIDIA drivers (older versions didn't have this issue). As David mentioned, the latest SVN and the most recent developer releases also include this workaround, so you won't need to add the [0] yourself if you use one of those. Obviously, it'll be in the next public OSG release, too. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Manipulator and selection
On 05/09/2012 07:34 AM, Bob Slobodan wrote: I finally figured out what was the problem with the camera. It was just that I had really large coordinates (for example : 510, 510, 100). So I finally subtsracted an offset (510, 510, 0) to all my points and the manipulator now works just fine. It also solved part of the selection problem. And now that I use a PolytopeIntersector instead of a line segment intersector, I can select what I want. The last problem that I have now is to figured out how to make the point appear in front of the lines and the lines in front of the surfaces. Does anyone have a clue of how to do that ? Hi, Bob, Take a look at the osgscribe example. It shows how to use osg::PolygonOffset to show lines on top of surfaces. You can probably extend that to handle the points as well. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Building JNI wrapper for OSGdem
Hi Rafa Thank you so much for looking at the problem -- having a second set of eyes look at a problem is so valuable. You were right -- The OSG and VPB -- I was using release builds. But my own DLL -- I had it in the DEBUG build. After I changed to RELEASE build, the crash did not happen anymore -- and my DLL was able to successfully build the output OSG file. Thank you for helping. Just curious though -- what is the issue behind mixing debug and release binaries that causes something like this to crash? I noticed in the original crash that it was involved in the c++ deconstructor for strings or some other C++ POJO. I am thinking about what could have been implemented in those destructors or runtime libraries that is confused with either debug or release binaries. Maybe the function signatures are switched between debug or release mode? That seems very dangerous. Maybe the size of the heap objects used for strings are different between the release and debug? Just curious why the mix up for non-debug and debug libraries causes this kind of crash. On Wed, May 9, 2012 at 12:38 AM, Rafa Gaitan rafa.gai...@gmail.com wrote: Hi Sean, The first I spotted watching your stacktrace is that your are mixing debug with release libraries. AFAIK on windows mixing debug and release always gives problems, so the best you can do if you want to debug your code is build osg in debug or build your code in release with debug symbols. Cheers, Rafa. 2012/5/9 Sean K sk92...@gmail.com: Hi, I took a look at your code. It looks good. Since the *.h headers from OSG and VPB DLLs are not intended for java JNI invocation, I see that your code has built is own DLL which in turn uses the OSG runtimes. I am taking this similar approach -- as follow... Since I want to do what osgdem.exe does but want to make that accessible from a java application, I wrote a C DLL on Windows that is invoked by my java class. When that DLL has all the includes and DLL lib imported linked to it (same build dependency as osgdem.exe -- but it is a DLL instead of a EXE), the java class can invoke that function in that DLL -- i put some test code in that DLL. Then I copied most of the code from osgdem.cpp into the main function of my DLL. I re-initialize the arguments etc from my entry point so that it mimics osgdem.cpp as much as possible -- at least at this version. Now, when I invoke my DLL which should do the same essential thing that osgdem.exe does, it encounters a java hotspot exception access violation. here is the content of that log file it is generated by jvm. (i hide the name of the company and myself to protect the privacy) # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x5ca957aa, pid=2036, tid=5660 # # JRE version: 6.0_32-b05 # Java VM: Java HotSpot(TM) Client VM (20.7-b02 mixed mode windows-x86 ) # Problematic frame: # C [MSVCR100D.dll+0x1157aa] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --- T H R E A D --- Current thread (0x0211a800): JavaThread main [_thread_in_native, id=5660, stack(0x0022,0x0027)] siginfo: ExceptionCode=0xc005, reading address 0xccc0 Registers: EAX=0xccac, EBX=0x44b618c8, ECX=0xccac, EDX=0x0004 ESP=0x0026e788, EBP=0x0026e7b4, ESI=0x0026ea8c, EDI=0x0026e898 EIP=0x5ca957aa, EFLAGS=0x00010286 Top of Stack: (sp=0x0026e788) 0x0026e788: 4fc8e4ec 0026e898 0026ea8c 44b618c8 0x0026e798: ccac fffe 0026e33c 0026ea78 0x0026e7a8: 5ca99320 13430fa0 0026e898 0x0026e7b8: 5e7d271c 0026e98c 0026ea8c 0x0026e7c8: 44b618c8 0x0026e7d8: 0x0026e7e8: 0x0026e7f8: Instructions: (pc=0x5ca957aa) 0x5ca9578a: 00 00 00 6a 04 e8 5c 3f f3 ff 83 c4 04 c7 45 fc 0x5ca9579a: 00 00 00 00 8b 45 08 83 e8 20 89 45 e4 8b 4d e4 0x5ca957aa: 8b 51 14 81 e2 ff ff 00 00 83 fa 04 74 41 8b 45 0x5ca957ba: e4 83 78 14 01 74 38 8b 4d e4 8b 51 14 81 e2 ff Register to memory mapping: EAX=0xccac is an unknown value EBX=0x44b618c8 is an oop {method} - klass: {other class} ECX=0xccac is an unknown value EDX=0x0004 is an unknown value ESP=0x0026e788 is pointing into the stack for thread: 0x0211a800 EBP=0x0026e7b4 is pointing into the stack for thread: 0x0211a800 ESI=0x0026ea8c is pointing into the stack for thread: 0x0211a800 EDI=0x0026e898 is pointing into the stack for thread: 0x0211a800 Stack: [0x0022,0x0027], sp=0x0026e788, free space=313k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C
Re: [osg-users] Building JNI wrapper for OSGdem
On 05/09/2012 12:39 PM, Sean K wrote: Hi Rafa Thank you so much for looking at the problem -- having a second set of eyes look at a problem is so valuable. You were right -- The OSG and VPB -- I was using release builds. But my own DLL -- I had it in the DEBUG build. After I changed to RELEASE build, the crash did not happen anymore -- and my DLL was able to successfully build the output OSG file. Thank you for helping. Just curious though -- what is the issue behind mixing debug and release binaries that causes something like this to crash? I noticed in the original crash that it was involved in the c++ deconstructor for strings or some other C++ POJO. I am thinking about what could have been implemented in those destructors or runtime libraries that is confused with either debug or release binaries. Maybe the function signatures are switched between debug or release mode? That seems very dangerous. Maybe the size of the heap objects used for strings are different between the release and debug? Just curious why the mix up for non-debug and debug libraries causes this kind of crash. The main source of the issue is the Microsoft C runtime library. The debug version of the CRT and the release version are two separate DLLs and they occupy different areas in memory when loaded. The heap managers are also very different (the debug heap includes a lot of extra data to help debug memory allocation/initialization issues), so if you create an object on the debug heap and later free it from the release heap, you'll have heap corruption. Details about the issue are here: http://msdn.microsoft.com/en-us/library/ms235460%28v=vs.80%29.aspx There are also likely to be countless differences in the code itself (ever seen #ifdef _DEBUG in the header files?) The topic has been discussed many, many times on this list, too. You can skim through the archives for more info. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Building new website, assistance appreciated!
Hi Robert et al, I have been populating the new webpage, migrating contents from the older one. As robert suggested I have gone for Downloads and Support sections. Downloads In the case of dowloads I am going now for Data resources and Tools (suggestions of J-S). @Robert: do you want me to do a downloads hierarchy folder (somethink like in the old server) by FTP and upload latest stable and developer versions? @J-S I feel the category tools may overlap the category community projects, thoughts? @Thomas I have set the page Code Repositories (maybe more appropiated that get the trunk) you can now link to it. Support Some links on the FAQ section are not up to date, we need to migrate the Documentation-knowledge base before. I want to know your opinion about how to address profesional support, Is it worth to have a single article with all the professionals/companies, or to have an article for each professional/company and show them in a blog layout/ list layout? I think it would be better if each professional/company edit its own page. If you any suggestions or doubts don't hesitate to talk about them. Cheers. 2012/5/2 Robert Osfield robert.osfi...@gmail.com Hi Jordi, On 2 May 2012 19:03, Jordi Torres jtorresfa...@gmail.com wrote: About the migration status I have setup a new migration tasks page in the website. The idea is that authors are able to modify this page and autoasign tasks. Then a publisher review the changes and apply them if appropiated. Publishers and admins should have set the priority of each item before, and remove those items which won't be migrated. Migration page looks good. I'll have a deeper look at the list tomorrow. I'm guessing I should tackle the support and downloads pages as priority. Unfortunately I'll be away next week in Montreal so won't be able to work on the website, in the evening's if I'm able I'll try to keep up with emails. The rest of this week I'll be wrapping up my prep for the trip so won't have too much time either, but I'll be around able to put some time in. Robert. ___ 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] Building new website, assistance appreciated!
I missed to say that I tried to respect the authory of the articles migrated from the old webpage, or for example de Debbuging tips (from Paul Martz). But there are some cases where I didnt know who was the author. Cheers 2012/5/9 Jordi Torres jtorresfa...@gmail.com Hi Robert et al, I have been populating the new webpage, migrating contents from the older one. As robert suggested I have gone for Downloads and Support sections. Downloads In the case of dowloads I am going now for Data resources and Tools (suggestions of J-S). @Robert: do you want me to do a downloads hierarchy folder (somethink like in the old server) by FTP and upload latest stable and developer versions? @J-S I feel the category tools may overlap the category community projects, thoughts? @Thomas I have set the page Code Repositories (maybe more appropiated that get the trunk) you can now link to it. Support Some links on the FAQ section are not up to date, we need to migrate the Documentation-knowledge base before. I want to know your opinion about how to address profesional support, Is it worth to have a single article with all the professionals/companies, or to have an article for each professional/company and show them in a blog layout/ list layout? I think it would be better if each professional/company edit its own page. If you any suggestions or doubts don't hesitate to talk about them. Cheers. 2012/5/2 Robert Osfield robert.osfi...@gmail.com Hi Jordi, On 2 May 2012 19:03, Jordi Torres jtorresfa...@gmail.com wrote: About the migration status I have setup a new migration tasks page in the website. The idea is that authors are able to modify this page and autoasign tasks. Then a publisher review the changes and apply them if appropiated. Publishers and admins should have set the priority of each item before, and remove those items which won't be migrated. Migration page looks good. I'll have a deeper look at the list tomorrow. I'm guessing I should tackle the support and downloads pages as priority. Unfortunately I'll be away next week in Montreal so won't be able to work on the website, in the evening's if I'm able I'll try to keep up with emails. The rest of this week I'll be wrapping up my prep for the trip so won't have too much time either, but I'll be around able to put some time in. Robert. ___ 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 -- 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] Building JNI wrapper for OSGdem
Thank you for the background information. There is different JNI issue that I am encountering. I was invoking a static function member from the native code. At this point, I dont mind using a static function member, but for thread safety in subsequent release, I need to switch it to use an instance function member. I saw the documentation about using non-static function members. And I think I updated the code to use it correctly. But it encounters a runtime crash in the jvm. the crash and java and native code fragments follows: static callback invoked from native: 7870.00 static callback passing integer invoked. 333 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (jni.cpp:947), pid=1852, tid=5864 # Error: ShouldNotReachHere() # # JRE version: 6.0_32-b05 # Java VM: Java HotSpot(TM) Client VM (20.7-b02 mixed mode, sharing windows-x86 ) # An error report file with more information is saved as: # C:\Users\sk\workspace\osg\osgnativelib\hs_err_pid1852.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (jni.cpp:947), pid=1852, tid=5864 # Error: ShouldNotReachHere() # # JRE version: 6.0_32-b05 # Java VM: Java HotSpot(TM) Client VM (20.7-b02 mixed mode, sharing windows-x86 ) # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --- T H R E A D --- Current thread (0x0264a800): JavaThread main [_thread_in_vm, id=5864, stack(0x0055,0x005a)] Stack: [0x0055,0x005a], sp=0x0059f878, free space=318k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [jvm.dll+0x13373a] V [jvm.dll+0x12e6db] V [jvm.dll+0x9529c] V [jvm.dll+0x95a27] V [jvm.dll+0x9890c] C [HelloWorldWin32Library.dll+0x116d3] JNIEnv_::CallVoidMethod+0x43 C [HelloWorldWin32Library.dll+0x14274] Java_com_foo_osgjni_core_MathFuncTest_Multiple+0x114 j com.foo.osgjni.core.MathFuncTest.Multiple(DD)D+0 j com.foo.osgjni.core.MathFuncTest.main([Ljava/lang/String;)V+15 v ~StubRoutines::call_stub V [jvm.dll+0xfad4b] V [jvm.dll+0x18c421] V [jvm.dll+0xfadcd] V [jvm.dll+0x95836] V [jvm.dll+0x9d673] C [javaw.exe+0x2155] C [javaw.exe+0x8614] C [kernel32.dll+0x1339a] BaseThreadInitThunk+0x12 C [ntdll.dll+0x39ed2] RtlInitializeExceptionChain+0x63 C [ntdll.dll+0x39ea5] RtlInitializeExceptionChain+0x36 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j com.foo.osgjni.core.MathFuncTest.Multiple(DD)D+0 j com.foo.osgjni.core.MathFuncTest.main([Ljava/lang/String;)V+15 v ~StubRoutines::call_stub #define STATICMETHODFUNCTIONNAME callback #define FUNCTION_SIGNATURE (Ljava/lang/String;)V #define STATICCALLNUMBERFUNCTIONNAME callnumber #define STATICCALLNUMBERFUNCTION_SIGNATURE (I)V #define INSTANCEMETHODFUNCTIONNAME callbackInstance #define INSTANCE_FUNCTION_SIGNATURE (I)V JNIEXPORT jdouble JNICALL Java_osgjni_core_MathFuncTest_Multiple (JNIEnv *penv, jobject obj, jdouble left, jdouble right) { jdouble product = left * right; jclass cls = penv-GetObjectClass(obj); jmethodID midStatic = penv-GetStaticMethodID(cls, STATICMETHODFUNCTIONNAME, FUNCTION_SIGNATURE); jmethodID midStaticNumber = penv-GetStaticMethodID(cls, STATICCALLNUMBERFUNCTIONNAME, STATICCALLNUMBERFUNCTION_SIGNATURE); jmethodID midInstance = penv-GetMethodID(cls, INSTANCEMETHODFUNCTIONNAME, INSTANCE_FUNCTION_SIGNATURE); char buffer[20]; sprintf(buffer, %5.2f, product); jstring jstr = penv-NewStringUTF(buffer); if (midStatic != 0) { penv-CallStaticVoidMethod(cls, midStatic, jstr); } if (midStaticNumber != 0) { penv-CallStaticVoidMethod(cls, midStaticNumber, 333); } if (midInstance != 0) { penv-CallVoidMethod(cls, midInstance, 10); } return product; } public class MathFuncTest { native double Multiple (double left, double right); static { System.load(c:\\DEV\\src\\test\\Debug\\HelloWorldWin32Library.dll); } /** * this is used for the static function member test. * @param msg */ public static void callnumber (int number) { System.out.println(static callback passing integer invoked.); System.out.println(number); } /** * this is used for the static function member test. * @param msg * * */ public static void callback(String msg) { //System.out.println(msg); if (msg != null){ System.out.println(static callback invoked from native: + msg); } }
Re: [osg-users] OSG and Qt fullscreen problem
Hi, The paint event is never called if you have zero size margin in a layout. If you only have a single view then there's no point in having a layout anyway instead you can use a GLWidget widget directly Code: GraphicsWindowQt::getGLWidget() Cheers, jamie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47629#47629 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgSim::OverlayNode and Point Clouds
Hello All, I have a setup where I need to project an overlay node's sub graph onto a point cloud. We already have it setup to overlay onto geometry created with VPB and I was hoping it would just work(tm) for the clouds. Unfortunately it seems to have no effect at all on cloud despite it having been inserted into the graph in the same manner that the vpb geometry was. The point cloud is being rendered with a custom shader setup but I didn't come across anything saying that that would be an issue. Is there anything I need to do to the point cloud's graph to make it so it will accept the overlay or is this a limitation of the overlay system? Thanks in advance, - Loren ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgSim::OverlayNode and Point Clouds
Loren, If your point cloud has a custom shader, make sure that shader is rendering the projected texture used by OverlayNode. Glenn Waldron / @glennwaldron On Wed, May 9, 2012 at 2:05 PM, Loren Hoffman lhoff...@zebraimaging.comwrote: Hello All, ** ** I have a setup where I need to project an overlay node’s sub graph onto a point cloud. We already have it setup to overlay onto geometry created with VPB and I was hoping it would “just work”™ for the clouds. Unfortunately it seems to have no effect at all on cloud despite it having been inserted into the graph in the same manner that the vpb geometry was. The point cloud is being rendered with a custom shader setup but I didn’t come across anything saying that that would be an issue. Is there anything I need to do to the point cloud’s graph to make it so it will accept the overlay or is this a limitation of the overlay system? Thanks in advance, ** ** - Loren ___ 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] osgSim::OverlayNode and Point Clouds
Glenn, Thanks for the response. I got the texture showing up in a test scenario but am having a problem computing the texture coordinates. I looked through the overlaynode's header file and didn't see anything which I could use to compute the texture coordinates but did find that the implementation file has some code for creating a matrix which can (I think) convert the gl_Vertex into a valid coordinate but then I couldn't find anything specifying where it would be bound to. I randomly tried the first few gl_TextureMatrices but either they don't contain the matrix or I am using it wrong. Currently I am attempting: vec4 col = texture2D(overlay, (gl_TextureMatrix[1] * gl_Vertex).xy); where using index 1 is just one of the tests. Any help would again be appreciated. Thanks, - Loren From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Glenn Waldron Sent: Wednesday, May 09, 2012 1:17 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osgSim::OverlayNode and Point Clouds Loren, If your point cloud has a custom shader, make sure that shader is rendering the projected texture used by OverlayNode. Glenn Waldron / @glennwaldron On Wed, May 9, 2012 at 2:05 PM, Loren Hoffman lhoff...@zebraimaging.commailto:lhoff...@zebraimaging.com wrote: Hello All, I have a setup where I need to project an overlay node's sub graph onto a point cloud. We already have it setup to overlay onto geometry created with VPB and I was hoping it would just work(tm) for the clouds. Unfortunately it seems to have no effect at all on cloud despite it having been inserted into the graph in the same manner that the vpb geometry was. The point cloud is being rendered with a custom shader setup but I didn't come across anything saying that that would be an issue. Is there anything I need to do to the point cloud's graph to make it so it will accept the overlay or is this a limitation of the overlay system? Thanks in advance, - Loren ___ osg-users mailing list osg-users@lists.openscenegraph.orgmailto: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] osgSim::OverlayNode and Point Clouds
OverlayNode.cpp has some shader code in it you might look at. In osgEarth we pass in a texgen matrix in a uniform, then in the vertex shader say: gl_TexCoord[1] = texGenMatrix * osg_ViewMatrixInverse * gl_ModelViewMatrix * gl_Vertex; Then in the frag shader: vec2 tc = gl_TexCoord[1].xy / gl_TexCoord[1].q; vec4 texel = texture2D( texture_1, tc ); Or, I I believe you could also call: vec4 texel = texture2Dproj( projTex, gl_TexCoord[1] ); ..but I've never tried it. HTH. Glenn Waldron / @glennwaldron On Wed, May 9, 2012 at 3:12 PM, Loren Hoffman lhoff...@zebraimaging.comwrote: Glenn, ** ** Thanks for the response. I got the texture showing up in a test scenario but am having a problem computing the texture coordinates. I looked through the overlaynode’s header file and didn’t see anything which I could use to compute the texture coordinates but did find that the implementation file has some code for creating a matrix which can (I think) convert the gl_Vertex into a valid coordinate but then I couldn’t find anything specifying where it would be bound to. I randomly tried the first few gl_TextureMatrices but either they don’t contain the matrix or I am using it wrong. Currently I am attempting: ** ** vec4 col = texture2D(overlay, (gl_TextureMatrix[1] * gl_Vertex).xy); ** ** where using index 1 is just one of the tests. Any help would again be appreciated. ** ** Thanks, - Loren ** ** *From:* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Glenn Waldron *Sent:* Wednesday, May 09, 2012 1:17 PM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] osgSim::OverlayNode and Point Clouds ** ** Loren, ** ** If your point cloud has a custom shader, make sure that shader is rendering the projected texture used by OverlayNode. Glenn Waldron / @glennwaldron On Wed, May 9, 2012 at 2:05 PM, Loren Hoffman lhoff...@zebraimaging.com wrote: Hello All, I have a setup where I need to project an overlay node’s sub graph onto a point cloud. We already have it setup to overlay onto geometry created with VPB and I was hoping it would “just work”™ for the clouds. Unfortunately it seems to have no effect at all on cloud despite it having been inserted into the graph in the same manner that the vpb geometry was. The point cloud is being rendered with a custom shader setup but I didn’t come across anything saying that that would be an issue. Is there anything I need to do to the point cloud’s graph to make it so it will accept the overlay or is this a limitation of the overlay system? Thanks in advance, - Loren ___ 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] Building new website, assistance appreciated!
Hi Jordi Thanks for setting up the Code Repositries stuff, I really like the added Git and Mercurial links, I've been away away on a stag do (well more recovering), but should get back at it this weekend. Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org