Re: [osg-users] Change render order of Geodes without custom RenderBin
Hi, Sean. If you specify renderbin without sorting, then all geometry rendered in traversal order. You can use graph structure like: group for each unique font character used with matrix transforms inside (containing same geometry) to position individual instances of characters properly, so in this case rendering in traversal order might be ok. so it'll be like .. -> mt (some "a" char) -> geometry for char "a" -> mt (some other "a" char) -> same geometry for char "a" -> group("a" chars) group(all text) -> group("b" chars) .. Cheers 20.01.2012, 02:10, "Sean Sullivan" : > Hey guys, > > I'm trying to render some text using a special method which requires 2 - 3 > draw calls per character. > > I'm adding all of the text to a Group node one character at a time in the > order that they appear in the text. What I want to do is sort the drawing of > the characters so that characters that are repeated are drawn consecutively > to minimize state changes. I tried doing this with a custom RenderBin but I > couldn't come up with a sorting algorithm that was good enough to sort a > couple of thousand draw calls every frame. > > Ideally I'd like to do this sorting only whenever the text changes. I've been > trying to sort the _children in my Group node using its traverse function and > using a CullCallback but that doesn't seem to have any effect, the RenderBin > still gets all the Geodes in traversal order even though I use a custom > RenderBin with no sorting. > > Is there a way I can do this sorting before the everything gets to the > RenderBins? > > Thank you! > > Cheers, > Sean > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=44922#44922 > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.0.1 examples not working correctly?
Hi, Sean Check if you compiled osg with opengl fixed function support (and options for gl3 and gles disabled) 18.01.2012, 21:17, "Sean O'Connell" : > Hi, > > I downloaded OSG 3.0.1, compiled the examples, but none of them seem to run > correctly. I can't get the camera mouse controls to work at all; the camera > simply stays stationary. In other demos no content is displayed. In my own, > extremely simple demo (that worked with OSG 2.8), the camera doesn't work and > the colors are look like a rainbow. > > Has anybody had similar issues? I'm working under Windows. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=44896#44896 > > ___ > 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] [osgOcean] how to set path to "other" resources folder?
Howdy folks, Is there a way to tell osgOcean to look elsewhere for its "resources" folder? My applications are looking for the "resources" folder directly in the directory of its executable, but I have many different applications, and I would like to share just the one "resources" folder among them. I am using Windows 7 and Microsoft Visual Studio 2008. Any suggestions? Thank you! Cheers, bart -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44923#44923 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Change render order of Geodes without custom RenderBin
Hey guys, I'm trying to render some text using a special method which requires 2 - 3 draw calls per character. I'm adding all of the text to a Group node one character at a time in the order that they appear in the text. What I want to do is sort the drawing of the characters so that characters that are repeated are drawn consecutively to minimize state changes. I tried doing this with a custom RenderBin but I couldn't come up with a sorting algorithm that was good enough to sort a couple of thousand draw calls every frame. Ideally I'd like to do this sorting only whenever the text changes. I've been trying to sort the _children in my Group node using its traverse function and using a CullCallback but that doesn't seem to have any effect, the RenderBin still gets all the Geodes in traversal order even though I use a custom RenderBin with no sorting. Is there a way I can do this sorting before the everything gets to the RenderBins? Thank you! Cheers, Sean -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44922#44922 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] vertex attributes with integer types
Hi, I've discovered that I can't define an integer vertex array using OSG although it appears to be supported by GL and GLSL. I've found a post from last May about it but I can't share the link due to this forum's 2-post requirement. The post title is: "Integer vertex attribute issue. Repro included." The problem is just that GL requires a different call when defining an integer type array than when defining a floating point type of array. float types:glVertexAttribPointer integer types: glVertexAttribIPointer This means a little bit of extra code is needed in State.cpp in the setVertexAttribPointer method to call the correct method based upon the type parameter. I've seen no more recent mentions of the issue and I can't see any changes related to it in the most recent released code or in the repository. Just wondering if anyone else has worked on this or maybe found a workaround. If not, I'll look into fixing it and submitting a patch. Thank you! Cheers, Joel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44921#44921 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osg-submissions] FOV
Shaheed Khan wrote on 2012-01-19: > Hi, > > I am new to OSG ... Hi Shaheed, and welcome! The best place to send your questions is the osg-users list instead of the osg-submissions list (which is for code change submissions). I've forwarded your email to osg-users and copied you on it in case you aren't subscribed to that list. Good luck with your question, I'm sorry I don't know the answer! > I want to control my camera horizon and vertical movement in Flightgear > using Osg functions .. > > > i tried using setCameraParameters (float vfov, float aspectRatio) but > couldn't :( ... > > i am sing OSG 2.8.0 and FG 1.9.0 > > any suggestion plz .. > > Thank you! > > Cheers, > shaheed -- 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
Re: [osg-users] Frame syncing over multiple contexts
OK then! This is getting good! I tried setting setEndBarrierPosition(BeforeSwapBuffers), setting setThreadingModel(CullDrawThreadPerContext), and running with four windows, each with a single camera, on a desktop system with a single graphics card, and the problem didn't go away. But should the problem go away in this environment? We'll get a chance to test the same fix in our immersive environemnt soon and I'll report back. Many thanks, John On Thu, 19 Jan 2012, Robert Osfield wrote: Hi Paul, On 19 January 2012 18:48, Paul Martz wrote: Hi Robert -- The default value for ViewerBase::_endBarrierPosition appears to be AfterSwapBuffers. Does John need to change this to BeforeSwapBuffers in order to get the behavior you describe above? Man I'm impressed, I'd forgotten implementing the EndBarrierPosition and the default. I presume I set the default to AfterSwapBuffers to avoid the possible performance drop in waiting for syncing the swap buffers dispatch. John should indeed change EndBarrierPosition to BeforeSwapBuffers using: viewer.setEndBarrierPosition(osgViewer::Viewer::BeforeSwapBuffers); ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.0.1 examples not working correctly?
On 1/18/2012 10:17 AM, Sean O'Connell wrote: > I downloaded OSG 3.0.1, compiled the examples, but none of them seem to run > correctly. I can't get the camera mouse controls to work at all; the camera > simply stays stationary. In other demos no content is displayed. In my own, > extremely simple demo (that worked with OSG 2.8), the camera doesn't work and > the colors are look like a rainbow. Have you tested the 3.0.1 binaries from AlphaPixel? http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads If they work, you know it's a build error compiling OSG on your end. You could also try compiling your app against them and see if it works. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Mac OSX Lion Installation
Hi, I'm really really new to OSG, I need to use it for my Virtual Environments class. I have some experience with OpenGL in Mac with Xcode. I've been searching all over the internet how to install OpenSceneGraph in Mac OSX Lion and use it with Xcode (4). All I found was tutorials explaining how to install it from the 2.8 dmg and I tried installing the binaries to the Lion and Leopard SDK with no results. Anyone know how to install or compile OSG projects from scratch in Lion with Xcode, as I said, I'm new to the whole OSG. Thank you! Cheers, Erick -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44837#44837 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] OSG for Android on Windows : Problem with cmake
Hi, Trying to build OSG for Android on Windows, I've been struggling with cmake for a couple days... I followed the wiki's page "Building and using OpenSceneGraph in Android" but I'm still running into issues. Here's my log : > > C:\OpenSceneGraph-3.0.1>cmake -G "Unix Makefiles" > -DOSG_BUILD_PLATFORM_ANDROID=O > N -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF > -DOSG_GL_DISPLAYLISTS_A > VAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=ON > -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON - > DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON > -DO > SG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF > -DOSG_GL2_AVAILABLE=OFF > -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON -DOSG_GLES2_AVAILABLE=OFF > -- The C compiler identification is unknown > -- The CXX compiler identification is unknown > CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. > Pleas > e set CMAKE_C_COMPILER to a valid compiler path or name. > CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. > P > lease set CMAKE_CXX_COMPILER to a valid compiler path or name. > -- Android NDK found in: C:/android-ndk-r7 > -- Jpeg found C:/OpenSceneGraph-3.0.1/3rdparty/libjpeg > -- PNG found C:/OpenSceneGraph-3.0.1/3rdparty/libpng > -- GIF found C:/OpenSceneGraph-3.0.1/3rdparty/giflib > -- TIF found C:/OpenSceneGraph-3.0.1/3rdparty/libtiff > -- Curl found C:/OpenSceneGraph-3.0.1/3rdparty/curl > -- FREETYPE found C:/OpenSceneGraph-3.0.1/3rdparty/freetype > -- GDAL found C:/OpenSceneGraph-3.0.1/3rdparty/gdal/include > -- ##Creating Android Makefile# > -- name: OpenThreads > -- ##Creating Android Makefile# > -- name: osg > -- ##Creating Android Makefile# > -- name: osgDB > -- ##Creating Android Makefile# > -- name: osgUtil > -- ##Creating Android Makefile# > -- name: osgGA > -- ##Creating Android Makefile# > -- name: osgText > -- Windowing system not supported > -- ##Creating Android Makefile# > -- name: osgViewer > -- ##Creating Android Makefile# > -- name: osgAnimation > -- ##Creating Android Makefile# > -- name: osgFX > -- ##Creating Android Makefile# > -- name: osgManipulator > -- ##Creating Android Makefile# > -- name: osgParticle > -- ##Creating Android Makefile# > -- name: osgPresentation > -- ##Creating Android Makefile# > -- name: osgShadow > -- ##Creating Android Makefile# > -- name: osgSim > -- ##Creating Android Makefile# > -- name: osgTerrain > -- ##Creating Android Makefile# > -- name: osgWidget > -- ##Creating Android Makefile# > -- name: osgVolume > CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. > Pleas > e set CMAKE_C_COMPILER to a valid compiler path or name. > CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. > P > lease set CMAKE_CXX_COMPILER to a valid compiler path or name. > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osg > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osganimation > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgfx > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgmanipulator > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgparticle > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgsim > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgshadow > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgterrain > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgtext > -- ##Creating Android Makefile# > -- name: osgdb_serializers_osgvolume > CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. > Pleas > e set CMAKE_C_COMPILER to a valid compiler path or name. > CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. > P > lease set CMAKE_CXX_COMPILER to a valid compiler path or name. > -- ##Creating Android Makefile# > -- name: osgdb_deprecated_osg > -- ##Creating Android Makefile# > -- name: osgdb_deprecated_osgparticle > -- ##Creating Android Makefile# > -- name: osgdb_deprecated_osganimation > -- ##Creating Android Makefile# > -- name: osgdb_depr
Re: [osg-users] [build] examle_osgVieweriPhoneExample curious linker error!!
Hi, I have the same problem when trying to compile the iPhone-example with the latest osg trunk version, iOS-SDK 5.0 and Xcode4. Code: Ld build/bin/osgViewerIPhone.app/osgViewerIPhone normal i386 cd /projects/osg setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/projects/osg/build/bin -F/projects/osg/build/bin -filelist /projects/osg/build/examples/osgviewerIPhone/OpenSceneGraph.build/Release-iphonesimulator/example_osgViewerIPhone.build/Objects-normal/i386/osgViewerIPhone.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -Wl,-search_paths_first -Wl,-headerpad_max_install_names /projects/osg/build/lib/libOpenThreads.a /projects/osg/build/lib/libosg.a /projects/osg/build/lib/libosgDB.a /projects/osg/build/lib/libosgUtil.a /projects/osg/build/lib/libosgGA.a /projects/osg/build/lib/libosgViewer.a /projects/osg/build/lib/libosgText.a /projects/osg/build/lib/libosgdb_osg.a /projects/osg/build/lib/libosgdb_freetype.a /projects/osg/build/lib/libosgdb_ima geio.a /projects/osg/build/lib/libosgGA.a /projects/osg/build/lib/libosgText.a /projects/of/libs/freetype/lib/iphone/freetype.a /projects/osg/build/lib/libosgDB.a /usr/lib/libz.dylib /projects/osg/build/lib/libosgUtil.a /projects/osg/build/lib/libosg.a /projects/osg/build/lib/libOpenThreads.a -lpthread /usr/lib/libm.dylib /usr/lib/libdl.dylib -framework CoreGraphics -framework Accelerate -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=5 -o /projects/osg/build/bin/osgViewerIPhone.app/osgViewerIPhone Undefined symbols for architecture i386: "_CGImageSourceCreateWithDataProvider", referenced from: CreateCGImageFromDataStream(std::istream&) in libosgdb_imageio.a(ReaderWriterImageIO_IOS.o) ReaderWriterImageIO::readImageStream(std::istream&) const in libosgdb_imageio.a(ReaderWriterImageIO_IOS.o) "_CGImageSourceCreateImageAtIndex", referenced from: CreateCGImageFromDataStream(std::istream&) in libosgdb_imageio.a(ReaderWriterImageIO_IOS.o) ReaderWriterImageIO::readImageStream(std::istream&) const in libosgdb_imageio.a(ReaderWriterImageIO_IOS.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Having followed the instructions in the readme.txt, building OSG against iOS 5.0 works fine, but building the example fails with the described linker error. I think the "CG" in the function names means "CoreGraphics", which is a framework bundled with the iOS-SDK. Adding "-framework CoreGraphics" to the Linker options doesn't solve the problem, though... How else can I resolve this linker error? Any suggestions? Thanks, Christoph -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44894#44894 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 3.0.1 examples not working correctly?
Hi, I downloaded OSG 3.0.1, compiled the examples, but none of them seem to run correctly. I can't get the camera mouse controls to work at all; the camera simply stays stationary. In other demos no content is displayed. In my own, extremely simple demo (that worked with OSG 2.8), the camera doesn't work and the colors are look like a rainbow. Has anybody had similar issues? I'm working under Windows. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44896#44896 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] examle_osgVieweriPhoneExample curious linker error!!
Problem solved! After also adding "-framework ImageIO" to the linker settings, the example builds fine. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44908#44908 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Frame syncing over multiple contexts
Hi Paul, On 19 January 2012 18:48, Paul Martz wrote: > Hi Robert -- The default value for ViewerBase::_endBarrierPosition appears > to be AfterSwapBuffers. Does John need to change this to BeforeSwapBuffers > in order to get the behavior you describe above? Man I'm impressed, I'd forgotten implementing the EndBarrierPosition and the default. I presume I set the default to AfterSwapBuffers to avoid the possible performance drop in waiting for syncing the swap buffers dispatch. John should indeed change EndBarrierPosition to BeforeSwapBuffers using: viewer.setEndBarrierPosition(osgViewer::Viewer::BeforeSwapBuffers); ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Frame syncing over multiple contexts
On 1/19/2012 9:57 AM, Robert Osfield wrote: As long as your run the viewer multithreaded the OSG will use a barrier so that each graphics thread waits at the end of draw dispatch, then once all the threads join this barrier then all move on together and then call swap buffers. Hi Robert -- The default value for ViewerBase::_endBarrierPosition appears to be AfterSwapBuffers. Does John need to change this to BeforeSwapBuffers in order to get the behavior you describe above? Thanks, -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Frame syncing over multiple contexts
Hi John, On 19 January 2012 16:32, John Kelso wrote: > I also tried setting the traits->swapGroupEnabled value to true but nothing > changed. swapGroupEnabled is only currently used under GraphicsWindowWin32 so won't effect linux systems in any way. > So as far as I can tell we are syncing swaps within a graphics context, but > not between graphic contexts. At least that's how I interpret what I'm > seeing. > > This may or may not be relevant, but we use one osgViewer::Viewer object > and all of the cameras we use are slave cameras of the master camera in the > viewer. Our graphics loop just calls osgViewer::Viewer::frame(). As long as your run the viewer multithreaded the OSG will use a barrier so that each graphics thread waits at the end of draw dispatch, then once all the threads join this barrier then all move on together and then call swap buffers. This is done to try and achieve synchronized swapping, however, it's not a full proof scheme as it doesn't use any low level driver and hardware synchronization. Extensions to some OpenGL drivers exist to enable the low level synchronisation, such as swap groups, swap ready and gen lock. GraphicsWindowX11 doesn't have support for these extension. One could potentially add this into an existing application via a custom osg::Camera::FinalDrawCallback. It would be nice to have support for these extensions in the core though so feel free to pitch in ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Frame syncing over multiple contexts
Hi all, We have seen the same behavior as Anna in our immersive system. It has four screens; each screen has a single graphics context and either one or two cameras (depends on if running in mono or stereo). The system is driven by an Nvidia quadroplex containing four FX5800 cards, one card per screen. We're running CentOS Linux. As a test I tried a configuration with one graphics context containing four cameras with non-overlapping viewports and in this case the graphics in all of the viewports appear to be updating at the same time. As a second test I tried a configuration with four graphics contexts on the same card, with each graphics context having a single camera. In this case I could see each window getting updated at a different time. I also tried setting the traits->swapGroupEnabled value to true but nothing changed. So as far as I can tell we are syncing swaps within a graphics context, but not between graphic contexts. At least that's how I interpret what I'm seeing. This may or may not be relevant, but we use one osgViewer::Viewer object and all of the cameras we use are slave cameras of the master camera in the viewer. Our graphics loop just calls osgViewer::Viewer::frame(). I see some methods in the osgViewer::ViewerBase class that might be relevant to the problem, but I'm unclear about which ones to set to what value. Any suggestions? Many thanks, John Hi Anna, Robbert, I think the bufferswaps on window are by default not synchronized, a call to wglJoinSwapGroupNV(HDC hdc, GLuint group) is needed to make different windows synchronize. the osg lib has the code to make the call, just set traits->swapGroupEnabled = true; before createGraphicsContext(traits); Output should look like: (set OSG_NOTIFY_LEVEL=INFO) GraphicsCostEstimator::calibrate(..) GraphicsWindowWin32::setSyncToVBlank on GraphicsWindowWin32::wglJoinSwapGroupNV (0) returned 1 GraphicsWindowWin32::wglBindSwapBarrierNV (0, 0) returned 0 the wglBindSwapBarrierNV fails if you don't have a gsync card (hardware connection card for multiple graphics cards) Still, as Robbert says, a single graphics window is likely to perform better, and is of course automatically in sync. But I suppose you don't want fullscreen with stereo mode VERTICAL_SPLIT. Laurens. On 1/16/2012 10:17 AM, Robert Osfield wrote: Hi Anna, This should work out of the box - the two windows should be rendering and synchronised. How are you setting up your viewer and graphics contexts? A a general note, if you are using a single graphics card for best performance one usually tries to use a single graphics window and have two cameras or more share this context. Is there a reason why you need two separate windows rather than a single window with two views? Robert. On 14 January 2012 21:21, Anna Sokol wrote: Hi, I am trying to figure out how to keep multiple graphics contexts in frame sync. My operating system is Windows XP SP3. My graphics is NVidia Quadro NVS 290 with the latest driver 276.42. I'm using OpenSceneGraph 3.0.1 compiled with Visual C++ 2005 for win32. I have vsync on in the driver and in Traits, also I am using a CullDrawThreadPerContext as the threading model. I have 2 graphics windows with separate contexts showing the same scene with a "left" and "right" view on one display. I have the scene moving across both windows so that I can see if its properly syncing. It sometimes visibly looks to be a number of frames out of sync (i.e. one of the rendered context is dragging behind). What could be causing this? In the threads? Or down in the graphics card? Is there any specific settings I should set to make the rendered contexts stay in frame sync? Regards, Anna Sokol ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Play audio files
On 1/19/2012 2:17 AM, Héctor Martínez wrote: > I am currently using SDLaudio for playing the sound of the videos I am using, > but when > trying to load 2 or more videos at the same time, it only plays one of them > (and not > always). I have read that SDL only allows one audio channel, so I think I > have to start > using something else. I want also to play other audio files (mp3, ogg, wav, > whatever). > > So, which is the best option right now? I have read about osgAL and openAL. I > don’t know > which one is better with the version I am using (OSG 3.0.1) or if there is a > better > solution to these two. Another thing to consider is that I would like to work > with LGPL > (or similar) licenses if possible. I think those libraries are LGPL, but as > they depend on > additional libraries I am not sure if I can use them as LGPL or not. As the creator of osgAudio, I can answer this. osgAudio is the literal and philosophical child of osgAL. We started osgAudio using the osgAL source, fixed a number of design and implementation issues, added compile-time selection of audio backend (openAL or FMOD) and polished it up. Thus, osgAudio. Even openAL's creator agrees that you should probably use osgAudio now, since it has newer fixes. OpenAL was LGPL, now proprietary (Creative Labs): http://en.wikipedia.org/wiki/OpenAL You'll have to interpret their licensing yourself. There is also OpenAL Soft: http://en.wikipedia.org/wiki/OpenAL#OpenAL_Soft "OpenAL Soft is an LGPL-licensed, cross-platform, software implementation" FMOD is proprietary but has a non-commercial license: http://en.wikipedia.org/wiki/FMOD "FMOD is available under multiple license schemes: FMOD Non-Commercial License, which allows software not intended for commercial distribution to use FMOD for free." You could fairly easily add support for other backends to osgAudio if you wished, but I'm not aware of too many other 3d spatial audio toolkits. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgautocapture not working
Hi all, I'd like to capture frames from an osg scene to create a video out of them. I'm using osgearth to build the scene. My plan was to modify the osgautocapture example, so that it can capture a sequence of images, instead of only a single image. However, osgautocapture does only captures an empty, black image. I tried with osg 2.8.4 and osg 3.0.1: ./osgautocaptured --screen 0 ~/soft/osgautocapture/cow.osg Load and Compile time = 1.9e-05 seconds Capture: size=1920x1080, format=GL_RGB Writing to: autocapture.jpg Rendring time = 0.112578 seconds When specifying --pbuffer, I get the same result: ./osgautocaptured --pbuffer --screen 0 ~/soft/osgautocapture/cow.osg Pixel buffer has been created successfully. Load and Compile time = 1.7e-05 seconds Capture: size=1920x1080, format=GL_RGB Writing to: autocapture.jpg Rendring time = 0.10445 seconds When I use --active, I get a display but no file. Any idea what is wrong with the example? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgexport for blender?
Yeah skinning animation work but the patch is not yet merged. The patch does not allow the exporter to be called from command line. After fixing this it should be merged soon in the trunk. it should be ok next week. Cedric Cedric Pinson Provide OpenGL, WebGL services +33 659 598 614 - http://cedricpinson.com - http://osgjs.org - http://showwebgl.com On Jan 19, 2012, at 01:34 , Maia Randria wrote: > Hi Cedric, > > I found on https://github.com/cedricpinson/osgexport/pull/4 > > a new commit. > > Is the animation included now and working ? > > Maia > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=44901#44901 > > > > > > ___ > 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] Help: wrong ouput from frag shader
Hi, great. OSG can maybe be more intelligent about these mappings, e.g. automatically creating a float texture, but I don't have time to look at it further. jp On 19/01/2012 11:30, wang shuiying wrote: Hi, J.P. Thank you very much, it works under your suggestion! Best regards Shuiying On 01/19/2012 07:39 AM, J.P. Delport wrote: Hi, On 18/01/2012 20:24, wang shuiying wrote: Hi, J.P. the camera isn't rendering to a texture. Yes it is. It is just made for you automatically. FBO renders to a texture and the image is read from this texture when you attach it to the camera. I suggest attaching a texture (to the same buffer component as the image), with the exact formats you require to the camera as well. E.g. _OutputTexture = new osg::TextureRectangle; _OutputTexture->setTextureSize(_TextureWidth, _TextureHeight); _OutputTexture->setInternalFormat(GL_RGBA32F_ARB); _OutputTexture->setSourceFormat(GL_RGBA); _OutputTexture->setSourceType(GL_FLOAT); camera->attach(osg::CameraNode::COLOR_BUFFER, _OutputTexture.get()); camera->attach(osg::CameraNode::COLOR_BUFFER, image); rgds jp In my programme, camera is set to be prerender, render target is FRAME_BUFFER_OBJECT, I attach the camera to an image, in order to get the bufferdata via image. the image data type is allocated as GL_FLOAT. Related setup details are listed below. // renderTarget osg::Camera::RenderTargetImplementation renderTargetImplementation; renderTargetImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; // shader program osg::Program * program = new osg::Program(); program->addShader(osg::Shader::readShaderFile(osg::Shader::FRAGMENT, fragmentShaderPath)); program->addShader(osg::Shader::readShaderFile(osg::Shader::VERTEX, vertexShaderPath)); // image osg::Image * image = new osg::Image(); image->allocateImage((int)XRes, (int)YRes, 1, GL_RGBA, GL_FLOAT); //camera osg::ref_ptr camera(new osg::CameraNode()); camera->setProjectionMatrixAsFrustum(-tan(YawView * math::D2R * 0.5), tan(YawView * math::D2R * 0.5), -tan(PitchView * math::D2R * 0.5), tan(PitchView * math::D2R * 0.5),zNear, zFar); camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); camera->setViewport(0, 0, XRes, YRes); camera->setClearColor(osg::Vec4(1000.0f, 1000.0f, 1000.0f, 1000.0f)); camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setViewMatrix(osg::Matrix::lookAt(osg::Vec3d(0, 0, 1.0f), osg::Vec3d(-10.0f, 0.0f, 0), osg::Vec3d(0, 0, 1))); camera->setRenderOrder(osg::CameraNode::PRE_RENDER); camera->setRenderTargetImplementation(renderTargetImplementation); camera->attach(osg::CameraNode::COLOR_BUFFER, image); //read out data osg::Vec4f * rgbaData = (osg::Vec4f *) (image->data()); for (int h = 0; h < yRes; h++) { for (int w = 0; w < xRes; w++) { osg::Vec4f cur = rgbaData[xRes * h + w]; cout<<"cur[0]="< To: OpenSceneGraph Users Subject: Re: [osg-users] Help: wrong ouput from frag shader. Message-ID:<4f167093.8090...@csir.co.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, what format is the texture you are rendering to? If it is UNSIGNED CHAR then your data would be discretised. e.g. 45/255 = 0.176471 jp On 17/01/2012 21:11, wang shuiying wrote: Hello, when I write gl_FragColor = vec4(0.174977,0,0,1) in Frag shader, then I get through a related image: float Vec4: (0.176471,0,0,1) so why 0.174977 changed into 0.176471? I think there should be no process there after per fragment operations that can change this element in the rendering pipeline. Blend, alphatest and so on are all disenabled. Thank you in advance! Shuiying ___ 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help: wrong ouput from frag shader
Hi, J.P. Thank you very much, it works under your suggestion! Best regards Shuiying On 01/19/2012 07:39 AM, J.P. Delport wrote: Hi, On 18/01/2012 20:24, wang shuiying wrote: Hi, J.P. the camera isn't rendering to a texture. Yes it is. It is just made for you automatically. FBO renders to a texture and the image is read from this texture when you attach it to the camera. I suggest attaching a texture (to the same buffer component as the image), with the exact formats you require to the camera as well. E.g. _OutputTexture = new osg::TextureRectangle; _OutputTexture->setTextureSize(_TextureWidth, _TextureHeight); _OutputTexture->setInternalFormat(GL_RGBA32F_ARB); _OutputTexture->setSourceFormat(GL_RGBA); _OutputTexture->setSourceType(GL_FLOAT); camera->attach(osg::CameraNode::COLOR_BUFFER, _OutputTexture.get()); camera->attach(osg::CameraNode::COLOR_BUFFER, image); rgds jp In my programme, camera is set to be prerender, render target is FRAME_BUFFER_OBJECT, I attach the camera to an image, in order to get the bufferdata via image. the image data type is allocated as GL_FLOAT. Related setup details are listed below. // renderTarget osg::Camera::RenderTargetImplementation renderTargetImplementation; renderTargetImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; // shader program osg::Program * program = new osg::Program(); program->addShader(osg::Shader::readShaderFile(osg::Shader::FRAGMENT, fragmentShaderPath)); program->addShader(osg::Shader::readShaderFile(osg::Shader::VERTEX, vertexShaderPath)); // image osg::Image * image = new osg::Image(); image->allocateImage((int)XRes, (int)YRes, 1, GL_RGBA, GL_FLOAT); //camera osg::ref_ptr camera(new osg::CameraNode()); camera->setProjectionMatrixAsFrustum(-tan(YawView * math::D2R * 0.5), tan(YawView * math::D2R * 0.5), -tan(PitchView * math::D2R * 0.5), tan(PitchView * math::D2R * 0.5),zNear, zFar); camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); camera->setViewport(0, 0, XRes, YRes); camera->setClearColor(osg::Vec4(1000.0f, 1000.0f, 1000.0f, 1000.0f)); camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setViewMatrix(osg::Matrix::lookAt(osg::Vec3d(0, 0, 1.0f), osg::Vec3d(-10.0f, 0.0f, 0), osg::Vec3d(0, 0, 1))); camera->setRenderOrder(osg::CameraNode::PRE_RENDER); camera->setRenderTargetImplementation(renderTargetImplementation); camera->attach(osg::CameraNode::COLOR_BUFFER, image); //read out data osg::Vec4f * rgbaData = (osg::Vec4f *) (image->data()); for (int h = 0; h < yRes; h++) { for (int w = 0; w < xRes; w++) { osg::Vec4f cur = rgbaData[xRes * h + w]; cout<<"cur[0]="< } } Thank you for any advice! Shuiying Message: 3 Date: Wed, 18 Jan 2012 09:11:15 +0200 From: "J.P. Delport" To: OpenSceneGraph Users Subject: Re: [osg-users] Help: wrong ouput from frag shader. Message-ID:<4f167093.8090...@csir.co.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, what format is the texture you are rendering to? If it is UNSIGNED CHAR then your data would be discretised. e.g. 45/255 = 0.176471 jp On 17/01/2012 21:11, wang shuiying wrote: Hello, when I write gl_FragColor = vec4(0.174977,0,0,1) in Frag shader, then I get through a related image: float Vec4: (0.176471,0,0,1) so why 0.174977 changed into 0.176471? I think there should be no process there after per fragment operations that can change this element in the rendering pipeline. Blend, alphatest and so on are all disenabled. Thank you in advance! Shuiying ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Play audio files
Hi, I am currently using SDLaudio for playing the sound of the videos I am using, but when trying to load 2 or more videos at the same time, it only plays one of them (and not always). I have read that SDL only allows one audio channel, so I think I have to start using something else. I want also to play other audio files (mp3, ogg, wav, whatever). So, which is the best option right now? I have read about osgAL and openAL. I dont know which one is better with the version I am using (OSG 3.0.1) or if there is a better solution to these two. Another thing to consider is that I would like to work with LGPL (or similar) licenses if possible. I think those libraries are LGPL, but as they depend on additional libraries I am not sure if I can use them as LGPL or not. Thank you in advance. Best regards ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume opacity settings
Hi Clement, On 18 January 2012 23:37, wrote: > osgImage->setImage(nx, ny, nz, GL_RGB16F_ARB, GL_RGBA, > GL_UNSIGNED_BYTE, (unsigned char*)data, osg::Image::NO_DELETE); > > > My question is about the 4th parameter GL_RGB16F_ARB. It is very > difficult to find out how this parameter affect the image. In this method, I > am sure rest of other parameters used correctly, so I would like to know more > about this parameter. Thanks again for your help. The fourth parameter is internalTextureformat which is the format that the OSG will tell OpenGL to use as it's internal format for the texture objects down on the GPU. The fifth and sixth parameters are pixelFormat and dataType of the source image data. It's kinda odd that you'd want to use a different internal format to the source image format. Could it be that the later two parameters don't match your source data? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org