Re: [osg-users] opengl es 2.0
Hi Alok, I can't help you with your problem, but please tell me that your're doing an Android port of OSG ! :) Cheers, On Wed, Dec 2, 2009 at 7:29 AM, Alok Priyadarshi alo...@gmail.com wrote: Hi Robert, I am a software engineer at Google. We are evaluating using osg with OpenGL ES 2.0 backend in an internal project. Thanks for adding the support for ES. My first task is to compile and run the examples on ES 2.0 emulator (imagination technologies on windows). I have been able to compile all core libraries by tweaking cmake options: 1. OPENGL_egl_LIBRARY: libEGL 2. OPENGL_gl_LIBRARY: libGLESv2 3. OPENGL_glu_LIBRARY: 4. Check OSG_GLES2_AVAILABLE; uncheck everything else Is this the recommended way to customize build for ES? I am getting link errors in osgViewer because it includes wgl functions. Has anyone tried implementing osgViewer using EGL? Is that the preferred long-term solution? Is there any short-term trick to make it work? Thanks in advance, -Alok ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Serge Lages http://www.tharsis-software.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] How to compile osgOcean
On 1/12/09 7:13 PM, Dominic Stalder wrote: When I want to start the application the following error occurs: dyld: Library not loaded: osgOcean Referenced from: xxx Reason: image not found This usually means that the respective library can't be found via the DYLD_LIBRARY_PATH. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLod advices and tips
Vincent Bourdier a écrit : Hi all, Currently working on a huge model, I'm looking at PagedLod to run the whole model on a normal computer. The model can be divided into 5 big parts. My first idea was to make 2 model for each part, and set PagedLOD on it. The models are too big to have an acceptable loading time, and because there are only 5 models of each level of details, no one is unloaded so the memory explodes... So now i'll try to set PagedLOD on geodes on the whole model. Before making some code, I'd like to know how to set the pagedLods to keep memory (release models when they are not rendered). The difficulty is that each PagedLod node will have only two child, so even if I don't know when the PLod will unload one child, I think no children will be unloaded (because they are only two) so the whole datas will be loaded... The question is : How can I optimize my PagedLods to run on this huge model, considering there will be only 2 (maybe 3 ) levels of details ? Is there any way to high the loading thread priority to get the LOD more quickly ? How to manage memory and the number of loaded models ? Thanks a lot. Regards, Vincent. Hi, I just add two more questions : What does the priority offset and scale are for ? how to use them ? Thanks a lot. Regards, Vincent __ Information from ESET NOD32 Antivirus, version of virus signature database 4651 (20091201) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description into ageneralized property mechanism?
Hi guys, On 1/12/09 7:20 PM, Chris 'Xenon' Hanson wrote: Thrall, Bryan wrote: This seems overly complicated to me; couldn't we just rely on users knowing the type they want for a given key, like we rely on them knowing what subclass of UserData they want now? That way, UserPropertyContainer is simply an std::mapstring,ref_ptrReferenced . The UserData API would store its Referenced pointer, and the Description API could store a vector of strings: I agree with Bryan that we should rely on users knowing what they stored and what they want. This works pretty well for objects that are Referenced, but I was looking for a good way to store basic integer and floating-point values in the properties. There would need to be a little more fleshing out to accomplish that, but I imagine one could make a class derived from Referenced that contained a float or an int. Agreed, maybe for basic data types we could use a simple Variant class: class Variant : Referenced { public: Variant() : Referenced() { ::memset(_variant, 0, sizeof(_variant)); } inline void set(int i) { _variant.i = i; } inline void set(long long ll) { _variant.ll = ll; } inline void set(float f) { _variant.f = f; } inline void set(double d) { _variant.d = d; } inline void set(void* vp) { _variant.vp = vp; } inline int geti() const { return _variant.i; } inline long long getll() const { return _variant.ll; } inline float getf() const { return _variant.f; } inline double getd() const { return _variant.d; } inline void* getv() const { return _variant.vp; } private: union VariantData { int i; long long ll; float f; double d; void* vp; }; VariantData _variant; }; Usage would be something like this: UserProps props = node-getUserProps(); props.get(earth.g)-set(-9.81f); float g = props.get(earth.g)-getf(); If we wanted this could be shortened to something like: props.set(earth.g, -9.81f); float g = props.getf(earth.g); Thoughts? Cheers, /ulrich PS: boost has a variant class but I'm not sure if that's overkill. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] How to compile osgOcean
Yes but osgOcean is correctly installed in /Library/Frameworks. Strange is, that with otool -L the following output is given: osgOcean (compatibility version 0.0.0, current version 0.0.0) all other osg frameworks are linked with {name}.framework? Dominic Ulrich Hertlein schrieb: On 1/12/09 7:13 PM, Dominic Stalder wrote: When I want to start the application the following error occurs: dyld: Library not loaded: osgOcean Referenced from: xxx Reason: image not found This usually means that the respective library can't be found via the DYLD_LIBRARY_PATH. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to name the viewer window???
Hi Ankita, Have you tried GraphicsWindow::setWindowName(My First Scene) on the viewers GraphicsWindows, or pass in the window name via GraphicsContext::Traits::windowName if you are creating the windows yourself. To get the viewers graphics windows you can use viewer.getWindows(..) method that is defined in include/osgViewer/ViewerBase. Robert. On Wed, Dec 2, 2009 at 7:33 AM, Ankita Chauhan chauhan.ank...@gmail.com wrote: Hi all, I have rendered a scene using osgViewer in Windows XP... I want to name this viewer window (e.g. I want to give this window the name of the file which is being rendered in this viewer or simply any text like MY First Scene). Can anybody please help me in this regard.. Thank you in advance! Cheers, Ankita -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20725#20725 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to do trimming using Mouse???
Hi Amkita, The OSG doesn't provide any support for this type of user interaction so you'll have to add it yourself. The OSG primarily focus is rendering rather than model editing building, to do the later you'll have to add extra functionality on top. There is chance that members of the OSG community have code there own solutions so hopefully they'll chime in with suggestions. Robert. On Wed, Dec 2, 2009 at 7:27 AM, Ankita Chauhan chauhan.ank...@gmail.com wrote: Hi, I 'm new to OpenSceneGraph I have rendered a scene in osg using viewer now i want to select an area in scene using mouse drag operation. And then I want to display that trimmed area.. Can anybody please help me?? ... Thank you! Cheers, Ankita -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20724#20724 ___ 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] [osgOcean] How to compile osgOcean
Hi Dominic, I'm afraid I have no idea what is going on here, looks like a mac specific issue. Ulrich seems to be the resident mac ninja maybe he knows..? I'll have a dig around at lunchtime. K. 2009/12/2 Dominic Stalder dominic.stal...@bluewin.ch: Yes but osgOcean is correctly installed in /Library/Frameworks. Strange is, that with otool -L the following output is given: osgOcean (compatibility version 0.0.0, current version 0.0.0) all other osg frameworks are linked with {name}.framework? Dominic Ulrich Hertlein schrieb: On 1/12/09 7:13 PM, Dominic Stalder wrote: When I want to start the application the following error occurs: dyld: Library not loaded: osgOcean Referenced from: xxx Reason: image not found This usually means that the respective library can't be found via the DYLD_LIBRARY_PATH. /ulrich ___ 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] [osgOcean] Wake effects?
Hi Tian, There's no file attached... Kim. 2009/12/2 Tian Ma tianxiao...@foxmail.com: Hi Kim: Does the information above help ? My graphic card is a little old, rihgt? :) Regards, Tian Kim Bale wrote: Hi Tian, Could you download and run this program for me: http://www.geeks3d.com/20090414/gpu-caps-viewer-170-available-with-cuda-support/ And then use the Full XML Export tool under the Tools tab and then send me the xml file please. I need to know exactly what your card supports and I can't seem to find out from my searches. Cheers. Kim. 2009/11/27 Tian Ma : Hi Kim: Thank you! By now, I am using the olde version. And I will try more. Regards, Tian Kim Bale wrote: Hi Tian, It did highlight some useful stuff. Unfortunately I won't get round to fixing this immediately. However, if you want to use the version in the trunk you can probably get round it by replacing the uniform booleans one by one with hard coded values in the water shader for the options you want to enable until it stop complaining. Obviously this is a temporary fix until I get round to investigating further. K. 2009/11/26 Tian Ma : Hi Kim: Thanks for your helpful work! Does the information inf file ocean_output.txt help? Regards, Tian Kim Bale wrote: Hi Peter, Well this is really what the many weird and wonderful configurable options are for in OceanScene, nearly every effect can be turned off an on to suit the graphics card configuration. I think it's probably better to do it this way, rather than grouping them together to give the low,medium and high settings, as you can fine tune the rendering to suit the available hardware. The core water shader itself isn't so expensive, it's largely the pre render passes that bring down the frame rate and all of these can be turned off and on as desired. (I think) the problem with Tians card at the moment is that the water shader in the trunk has used up all the maximum number of uniforms permitted on nvidia 7 series card which use a version of glsl that I'm not 100% sure of. But I think this can be worked around, I just haven't got round to it yet (plus it's quite hard to test without a suitable card) K. 2009/11/26 Peter Bear : Would it be possible to implement sort of a config option with 2 or more shaders for multiple quality levels? This would allow for the use of one shader if you have a more powerful card, or another shader for an older card. Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20395#20395 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20410#20410 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20461#20461 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20716#20716 ___ 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] opengl es 2.0
Hi Alok, On Wed, Dec 2, 2009 at 6:29 AM, Alok Priyadarshi alo...@gmail.com wrote: I am a software engineer at Google. We are evaluating using osg with OpenGL ES 2.0 backend in an internal project. Thanks for adding the support for ES. Welcome to the OSG :-) My first task is to compile and run the examples on ES 2.0 emulator (imagination technologies on windows). I have been able to compile all core libraries by tweaking cmake options: 1. OPENGL_egl_LIBRARY: libEGL 2. OPENGL_gl_LIBRARY: libGLESv2 3. OPENGL_glu_LIBRARY: 4. Check OSG_GLES2_AVAILABLE; uncheck everything else Is this the recommended way to customize build for ES? A present it is, my plan is to use Cmake to automatically set the appropriate options ON/OFF for each OpenGL/OpenGL ES target so it'll make the process a bit more straight forward. OpenGL ES support in the OSG is still very much bleeding edge so you'll need to jump through a few hoops till we settle everything down :-) I am getting link errors in osgViewer because it includes wgl functions. Has anyone tried implementing osgViewer using EGL? Is that the preferred long-term solution? Is there any short-term trick to make it work? I've only written EGL support for GraphicsWindowX11.cpp, and don't have any access to a Windows or OSX system so can't directly help there. Members of the community will have to dive in and add EGL support to src/osgViewer/GraphicsWindowWin32.cpp to enable OpenGL ES under Windows. If you want to get started right away then you can just boot into 32bit Linux as the ImgTech GLES emulator drivers work pretty well - if fact I've had feedback that the Linux drivers are actually working better. Another option is to just work against OpenGL and just disable the fixed function pipeline features via the OSG_*_AVAILABLE Cmake options. This gives you the same GL features that you'll see with GLES 1.1 or 2.0 (depending upon the options you choose.) When I did the initial groundwork for the GLES port I did it all against standard OpenGL using Cmake to give me a first pass approximation at GLES support, and it certainly helped make the port go smoothly as I was able to change one thing at a time and gradually shift across rather than be faced with a massive porting effort all at once. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description into ageneralized property mechanism?
Hi Ulrich et. al, Comments at bottom of mail... but first some context for my comments :-) On Wed, Dec 2, 2009 at 9:36 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote: Agreed, maybe for basic data types we could use a simple Variant class: class Variant : Referenced { public: Variant() : Referenced() { ::memset(_variant, 0, sizeof(_variant)); } inline void set(int i) { _variant.i = i; } inline void set(long long ll) { _variant.ll = ll; } inline void set(float f) { _variant.f = f; } inline void set(double d) { _variant.d = d; } inline void set(void* vp) { _variant.vp = vp; } inline int geti() const { return _variant.i; } inline long long getll() const { return _variant.ll; } inline float getf() const { return _variant.f; } inline double getd() const { return _variant.d; } inline void* getv() const { return _variant.vp; } private: union VariantData { int i; long long ll; float f; double d; void* vp; }; VariantData _variant; }; Usage would be something like this: UserProps props = node-getUserProps(); props.get(earth.g)-set(-9.81f); float g = props.get(earth.g)-getf(); If we wanted this could be shortened to something like: props.set(earth.g, -9.81f); float g = props.getf(earth.g); Thoughts? I've done something similar to this in the OSG in the osg::ArgumnetParser::Parameter class - this one uses a union internally like the Variant class above, with the twist that it's for passing in data to be set so it uses a pointer to each datatype rather than the actual data. The Parameter class is used to avoid the need for many different read(..) methods for each type. I've also adopted this technique in the osgDB::Input class to enable the same type of functionality with providing read(Parameter,...) that are really convenient to use. One could use that osg::ArgumnetParser::Parameter approach in the new scheme being discussed for getting data out of the container object in convenient and type-safe way. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] Getting familiar with VPB sourcode
Hi, To chech wich proceedure/command line options are required to resume a canceled/failed vpbmaster run, I try to get familiar wih the VPB code. In the Head revisions vpbmaster.cpp, line 136, an option --build is possible, to activate the variable buildWithoutSlaves. What does this parameter activate? what is the meaning of slaves in VPB's context? I discovered in TaskManager::run() that taskfiles are skipped if there status is set to completed. How can I start VPB master to use the existing task files instead of generating new one? Is it enough to start with the parameter -s? In VPB 0.9.10 this does not work, because all taskfiles are set to pending. Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20740#20740 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer creation and frame() from different threads
Hi Robert and all, I played a bit more with the Qt application and threads, and I've succeeded in running: - osg in the main application thread - QApplication and WebBrowser in a background thread The only limitation is that everything related to the Qt world must be executed in that same thread. So, the QApp and QWebViewImage must be created in the same thread, and direct calls to Qt classes as well (I've added a sample call to change the url at runtime). I still have a weird message when exiting the Qt thread, couldn't get rid of it. It's probably not the cleanest solution ever, but it allows to add the Qt Web module in a separate thread and to existing application. Attached you find the modified osgQtBrowser example with an added option. Could you give it a try and see if it works under other systems? I'm on WinXP. Also, have you got any suggestions or cleanup? Thanks, Ricky On Tue, Dec 1, 2009 at 9:04 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Riccardo, As far as I could tell Qt is designed to only allow you to drive it's event and rendering loop from the applications main thread. I tried lots of different combinations of threading to get round this but didn't succeed. Perhaps separate process might be able to do it. Robert. On Tue, Dec 1, 2009 at 4:46 PM, Riccardo Corsi riccardo.co...@vrmmp.it wrote: Hi Robert and All, I'm revamping this thread 'cause my question is related to it. Simon knows much more than I do about windows event handling, but I have tried to run the osgQtBrowser example under WinXP, and it works fine (with active navigation) both in threaded and single thread mode. But on my side, I'd like to go the opposite way, which is having the control of the main thread and spawn a new one for the Qt browser. So far I've successfully isolated the Qt code in a component, not to pollute the main application code. This way it's easier to plug this component into any existing application. But with this single-threaded approach, the application hiccups when the page is loading (i.e. when the qtBrowser is retrieving network data), same as when osgQtBrowser run in single thread. Do you think it's possible to spawn this qt data loading in a separate thread, and then still connect to the change signal to update the image on the osg side? This new thread should also forward events to the WebView though, otherwise navigation is no more possible... I've checked the Qt documentation, but could not find a clean way to handle this case. Thank you, Ricky On Tue, Oct 20, 2009 at 1:11 PM, Simon Hammett s.d.hamm...@googlemail.com wrote: 2009/10/20 J.P. Delport jpdelp...@csir.co.za: Hi Simon, Simon Hammett wrote: I will try osgqtbrowser on Windows and see what happens. Anyone else have reports on osgqtbrowser on Windows? thanks jp Windozes is same as Mac, only the owner thread can retrieve events for windows. can you expand on what you mean by owner. If a thread other than main creates the viewer and that same thread calls frame(), will that work on Windows? jp Sort of. When a thread first creates a window, windows also creates the message queue for the thread. Windows messages are per thread, so only the thread which owns the window will see the messages for the window in it's event loop, so you can't have another thread process mouse events, etc. The pure gl stuff does work though, so you can draw from another thread. With windows you should really make sure only one thread actually creates windows as if you have multiple windows in different threads the only safe synchronisation primitive is MsgWaitForMultipleObjects which is a huge pain in the butt. I've had a go at doing a properly separately threaded viewer window before and even being extra careful I couldn't stop it dead locking. -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- http://www.ssTk.co.uk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Riccardo Corsi (t) +39 011 56 97 227 (f) +39 011 56 97 219 Virtual Reality Multi Media Park SpA C.so Lombardia, 194 10149 Torino (It) C.F./P.I. 07844090014
Re: [osg-users] [osgOcean] How to compile osgOcean
On 2/12/09 10:51 AM, Kim Bale wrote: I'm afraid I have no idea what is going on here, looks like a mac specific issue. Ulrich seems to be the resident mac ninja maybe he knows..? Sorry, far, far from it :-} /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] with is the way to clean up about everything?
Hi, I am trying to clean up everything, release all gl objects, textures .. etc. I found osg::Node::releaseGLObjects, osg::Texture::deleteAllTextureObjects and I wrote visitors so before recreating new scenegraph I am calling it. Still have issues with missing textures though. It works when you dynamically create/destroy viewers but looks like it should be called in some proper time - can not do that so my intension is to programatically clean and release about everything. will setSceneData(0) reset just about everything? Nick http://www.linkedin.com/in/tnikolov ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking bug?
robertosfield wrote: Hi Fred, I would be inclined to think this is more of an issue of expectation rather than a bug in computeIntersections/LineSegmentIntersector. The code is such that save for numerical precision issues it will work exactly the same for all triangles, so if it works once then it's likely to work all the time, and if it fails once it'll fail all the time. The code has been in place for quite a while so I would expect it to be working OK otherwise we'd have heard lots of more reports of problems. Most likely answer is simply that the winding of the triangles you are intersecting resulting in the normals that it's reporting. Please not face normals derived from the triangles themselves can be and usually are different than vertex normals at the corners of the triangles - they can even be pointing in different directions as vertex normals are specified at geometry creation time and needn't bare any connection to the faces. Thanks. I figured out how picking works with respect to the vertex ordering. However I do see unexpected behavior with some of our larger models, whereby the first intersection is not returned. I double checked and the vertex ordering is fine. Problems show up within the same triangle. I can consistently repro this bug with very large models I can't give away for analysis unfortunately. I can however try to find a small repro with a file in the examples folder or, as suggested by J.P., I can try changing the picking precision in the source code. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20744#20744 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] after deleteAllTextureObjects getNumberActiveTextureObjects still reports number of active objects
Here is the code snippet osg::ref_ptrosg::Texture::TextureObjectManager tom = osg::Texture::getTextureObjectManager(0); unsigned int n1 = tom-getNumberActiveTextureObjects(); unsigned int n2 = tom-getNumberOrphanedTextureObjects(); tom-deleteAllTextureObjects(); n1 = tom-getNumberActiveTextureObjects(); n2 = tom-getNumberOrphanedTextureObjects(); n1 hasnt changed. Any clue ? Nick http://www.linkedin.com/in/tnikolov Sent from Devlet, Ankara, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] with is the way to clean up about everything?
Hi Nick, For normal OSG usage you shouldn't need to worry about explicitly trying to call releaseGLObjects(). The only case where this might be needed is you detact a scene graph from viewer then destroy the viewer, but retain the scene graph so it doesn't get cleaned, but then you go an apply that scene graph to a new viewer. If you do such a releaseGLOObjects() after the context has been destructed then you should call osg::discardAllGLObjects(contextID) to discard any GL object handles that are cached for that context. Robert. On Wed, Dec 2, 2009 at 1:03 PM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Hi, I am trying to clean up everything, release all gl objects, textures .. etc. I found osg::Node::releaseGLObjects, osg::Texture::deleteAllTextureObjects and I wrote visitors so before recreating new scenegraph I am calling it. Still have issues with missing textures though. It works when you dynamically create/destroy viewers but looks like it should be called in some proper time - can not do that so my intension is to programatically clean and release about everything. will setSceneData(0) reset just about everything? Nick http://www.linkedin.com/in/tnikolov ___ 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] [osgOcean] Wake effects?
here it is. Kim Bale wrote: Hi Tian, There's no file attached... Kim. 2009/12/2 Tian Ma : Hi Kim: Does the information above help ? My graphic card is a little old, rihgt? :) Regards, Tian Kim Bale wrote: Hi Tian, Could you download and run this program for me: http://www.geeks3d.com/20090414/gpu-caps-viewer-170-available-with-cuda-support/ And then use the Full XML Export tool under the Tools tab and then send me the xml file please. I need to know exactly what your card supports and I can't seem to find out from my searches. Cheers. Kim. 2009/11/27 Tian Ma : Hi Kim: Thank you! By now, I am using the olde version. And I will try more. Regards, Tian Kim Bale wrote: Hi Tian, It did highlight some useful stuff. Unfortunately I won't get round to fixing this immediately. However, if you want to use the version in the trunk you can probably get round it by replacing the uniform booleans one by one with hard coded values in the water shader for the options you want to enable until it stop complaining. Obviously this is a temporary fix until I get round to investigating further. K. 2009/11/26 Tian Ma : Hi Kim: Thanks for your helpful work! Does the information inf file ocean_output.txt help? Regards, Tian Kim Bale wrote: Hi Peter, Well this is really what the many weird and wonderful configurable options are for in OceanScene, nearly every effect can be turned off an on to suit the graphics card configuration. I think it's probably better to do it this way, rather than grouping them together to give the low,medium and high settings, as you can fine tune the rendering to suit the available hardware. The core water shader itself isn't so expensive, it's largely the pre render passes that bring down the frame rate and all of these can be turned off and on as desired. (I think) the problem with Tians card at the moment is that the water shader in the trunk has used up all the maximum number of uniforms permitted on nvidia 7 series card which use a version of glsl that I'm not 100% sure of. But I think this can be worked around, I just haven't got round to it yet (plus it's quite hard to test without a suitable card) K. 2009/11/26 Peter Bear : Would it be possible to implement sort of a config option with 2 or more shaders for multiple quality levels? This would allow for the use of one shader if you have a more powerful card, or another shader for an older card. Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20395#20395 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20410#20410 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20461#20461 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here:
Re: [osg-users] with is the way to clean up about everything?
Thanks Robert. Here is my scenario: Load a viewer Load a model do something Unload the model Unload the viewer and this all over again. On the second try, I am getting: Warning: detected OPenGL error 'invalid enumerant' at after RenderBin::draw(...) what can cause this? Nick http://www.linkedin.com/in/tnikolov Sent from Devlet, Ankara, Turkey On Wed, Dec 2, 2009 at 5:19 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Nick, For normal OSG usage you shouldn't need to worry about explicitly trying to call releaseGLObjects(). The only case where this might be needed is you detact a scene graph from viewer then destroy the viewer, but retain the scene graph so it doesn't get cleaned, but then you go an apply that scene graph to a new viewer. If you do such a releaseGLOObjects() after the context has been destructed then you should call osg::discardAllGLObjects(contextID) to discard any GL object handles that are cached for that context. Robert. On Wed, Dec 2, 2009 at 1:03 PM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Hi, I am trying to clean up everything, release all gl objects, textures .. etc. I found osg::Node::releaseGLObjects, osg::Texture::deleteAllTextureObjects and I wrote visitors so before recreating new scenegraph I am calling it. Still have issues with missing textures though. It works when you dynamically create/destroy viewers but looks like it should be called in some proper time - can not do that so my intension is to programatically clean and release about everything. will setSceneData(0) reset just about everything? Nick http://www.linkedin.com/in/tnikolov ___ 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] with is the way to clean up about everything?
Hi Nick, On Wed, Dec 2, 2009 at 1:39 PM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Thanks Robert. Here is my scenario: Load a viewer Load a model do something Unload the model Unload the viewer and this all over again. On the second try, I am getting: Warning: detected OPenGL error 'invalid enumerant' at after RenderBin::draw(...) what can cause this? I don't know the cause of the error. Try enabling fine grained checking of errors by setting the env var OSG_GL_ERROR_CHECKING to ON (or ONCE_PER_ATTRIBUTE which currently is the same settings as ON). Could you also explain what you mean by Unload the model and Unload the viewer. Do you mean destruct it? Are there any references kept around beyond when you think it's been Unloaded ? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] after deleteAllTextureObjects getNumberActiveTextureObjects still reports number of active objects
On Wed, Dec 2, 2009 at 1:17 PM, Trajce Nikolov nikolov.tra...@gmail.com wrote: Here is the code snippet osg::ref_ptrosg::Texture::TextureObjectManager tom = osg::Texture::getTextureObjectManager(0); unsigned int n1 = tom-getNumberActiveTextureObjects(); unsigned int n2 = tom-getNumberOrphanedTextureObjects(); tom-deleteAllTextureObjects(); n1 = tom-getNumberActiveTextureObjects(); n2 = tom-getNumberOrphanedTextureObjects(); n1 hasnt changed. Any clue ? A bug :-) It looks like the discard of the texture objects isn't updating the texture object manager's counts correctly. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Node::Description into ageneralized propertymechanism?
Robert Osfield wrote on Wednesday, December 02, 2009 4:11 AM: I've done something similar to this in the OSG in the osg::ArgumnetParser::Parameter class - this one uses a union internally like the Variant class above, with the twist that it's for passing in data to be set so it uses a pointer to each datatype rather than the actual data. The Parameter class is used to avoid the need for many different read(..) methods for each type. I've also adopted this technique in the osgDB::Input class to enable the same type of functionality with providing read(Parameter,...) that are really convenient to use. One could use that osg::ArgumnetParser::Parameter approach in the new scheme being discussed for getting data out of the container object in convenient and type-safe way. I agree, if we go with Variants, it would be best to store a type to be type-safe. -- Bryan Thrall 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] display terrainTile
Hi, i got this little piece of code, with which i wanna display a heightfield. I read that for performance reasons one should use terrainTile and add the heightfield to it, but i dont get it to display in the viewer? i know the osgTerrain example, but i find it is too big for starting. i hope someone could help me? Here is the small code: int main() { osg::ref_ptrosgTerrain::TerrainTile terrainTile; osg::ref_ptrosg::HeightField hf; osg::ref_ptrosgTerrain::HeightFieldLayer hfl; osg::ref_ptrosg::Group group; osg::ref_ptrosgViewer::Viewer viewer; group = new osg::Group(); terrainTile = new osgTerrain::TerrainTile(); hf = new osg::HeightField(); hfl = new osgTerrain::HeightFieldLayer(); viewer = new osgViewer::Viewer(); hf.get()-allocate(100, 100); hf.get()-setXInterval(10.0); hf.get()-setYInterval(10.0); for(unsigned int r=0;r100;++r) { for(unsigned int c=0;c100;++c) { hf.get()-setHeight(c,r,400); } } hfl.get()-setHeightField(hf.get()); terrainTile.get()-setElevationLayer(hfl.get()); group.get()-addChild(terrainTile.get()); viewer.get()-setSceneData(group.get()); viewer.get()-realize(); viewer.get()-run(); } Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20758#20758 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] display terrainTile
Hi Thomas, You'll need to attach a TerrainTechnique to the TerrainTile, for instance just add an osgTerrrain::GeometryTechnique to the TerrainTile - this will be responsible to generating the subgraph that does actual rendering of the tile. One of the features of osgTerrain is that it allows decouples the data representation from the rendering implementation, which enables you to easily change the data or change the rendering technique used. Robert. On Wed, Dec 2, 2009 at 3:07 PM, Thomas Maier in...@web.de wrote: Hi, i got this little piece of code, with which i wanna display a heightfield. I read that for performance reasons one should use terrainTile and add the heightfield to it, but i dont get it to display in the viewer? i know the osgTerrain example, but i find it is too big for starting. i hope someone could help me? Here is the small code: int main() { osg::ref_ptrosgTerrain::TerrainTile terrainTile; osg::ref_ptrosg::HeightField hf; osg::ref_ptrosgTerrain::HeightFieldLayer hfl; osg::ref_ptrosg::Group group; osg::ref_ptrosgViewer::Viewer viewer; group = new osg::Group(); terrainTile = new osgTerrain::TerrainTile(); hf = new osg::HeightField(); hfl = new osgTerrain::HeightFieldLayer(); viewer = new osgViewer::Viewer(); hf.get()-allocate(100, 100); hf.get()-setXInterval(10.0); hf.get()-setYInterval(10.0); for(unsigned int r=0;r100;++r) { for(unsigned int c=0;c100;++c) { hf.get()-setHeight(c,r,400); } } hfl.get()-setHeightField(hf.get()); terrainTile.get()-setElevationLayer(hfl.get()); group.get()-addChild(terrainTile.get()); viewer.get()-setSceneData(group.get()); viewer.get()-realize(); viewer.get()-run(); } Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20758#20758 ___ 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] Refactoring DatabasePagerNeedToRemovestringflaggingtechnique
hi all, I'd like to jump in on this conversation. We are currently in the camp of doing intersection testing against a non-rendered, high-resolution, non-paged terrain model, and then using a PagedLOD terrain model for viz. From all the comments, it seems like trying to combine the IntersectionVisitor and the database pager is a bad idea if you are also wanting to visualize the same scene graph. Our application is similar to Wojciech's, in that we don't want to pay the overhead of reloading the highest level LOD every time we do an intersection test. We are extracting regular gridded height fields off the terrain data, and then doing line lots of sight checks between the height field points and some other point in the scene. I have two questions relevant to this thread: 1) Does the task of combining the database pager with the IntersectionVisitor (while ideally caching the highest LOD tile) get easier if you're not actually rendering the scenegraph? 2) Again with respect to a non-rendered, PagedLOD terrain, do you see any problems with running multiple threads where IntersectionVisitor is executed in those threads? We currently do this against our own static BSP tree representation of the scenegraph, and it works fine. We would very much like to do these analyses on very large terrains, but even at 64 bits we will very easily run out of RAM when we try to load them. This makes using an OSGDEM/PagedLOD terrain for the intersection testing the next logical step. Thanks, Dan On Tue, Nov 24, 2009 at 6:54 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Wojtek, On Tue, Nov 24, 2009 at 1:33 PM, Wojciech Lewandowski lewandow...@ai.com.pl wrote: When I get on to reviewing the multiple viewpoint issue with DatabasePager I'll have a think about the consequences of users caching subgraphs. Thank You. Does it mean I should try to prepare the proposed submission or not ? You can submit changes, I can always just use these as another point of information when doing my investigation even if the code doesn't make it into svn/trunk. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] display terrainTile
Hi, thanks alot, after inserting the technique it complained about a missing locator, now it works. thanks alot Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20764#20764 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] opengl es 2.0
Hi Serge, Sorry to disappoint you but this is not for Android. I am working on chrome browser. What I am doing right now is not very interesting to the community. I am just trying to exercise chrome's gpu process that supports gles2 for testing and debugging. But one project I am interested in doing and useful for the community would be porting osg to work on native client (http://code.google.com/p/nativeclient). Native client will support gles2 api. OSG should be useful for 3D web apps using nacl. -Alok On Wed, Dec 2, 2009 at 12:10 AM, Serge Lages serge.la...@gmail.com wrote: Hi Alok, I can't help you with your problem, but please tell me that your're doing an Android port of OSG ! :) Cheers, On Wed, Dec 2, 2009 at 7:29 AM, Alok Priyadarshi alo...@gmail.com wrote: Hi Robert, I am a software engineer at Google. We are evaluating using osg with OpenGL ES 2.0 backend in an internal project. Thanks for adding the support for ES. My first task is to compile and run the examples on ES 2.0 emulator (imagination technologies on windows). I have been able to compile all core libraries by tweaking cmake options: 1. OPENGL_egl_LIBRARY: libEGL 2. OPENGL_gl_LIBRARY: libGLESv2 3. OPENGL_glu_LIBRARY: 4. Check OSG_GLES2_AVAILABLE; uncheck everything else Is this the recommended way to customize build for ES? I am getting link errors in osgViewer because it includes wgl functions. Has anyone tried implementing osgViewer using EGL? Is that the preferred long-term solution? Is there any short-term trick to make it work? Thanks in advance, -Alok ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Serge Lages http://www.tharsis-software.com ___ 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] opengl es 2.0
Hi Robert, Welcome to the OSG :-) Thanks. I am not new to OSG, just coming back to it. I used it in my previous life as a grad student at UMCP. In fact I also met you and Don at one of the Washington DC chapter dinners. A present it is, my plan is to use Cmake to automatically set the appropriate options ON/OFF for each OpenGL/OpenGL ES target so it'll make the process a bit more straight forward. That would be awesome. I've only written EGL support for GraphicsWindowX11.cpp, and don't have any access to a Windows or OSX system so can't directly help there. Members of the community will have to dive in and add EGL support to src/osgViewer/GraphicsWindowWin32.cpp to enable OpenGL ES under Windows. Depending on how I end up using the examples, I might implement it. In that case, I will send you a patch. Another option is to just work against OpenGL and just disable the fixed function pipeline features via the OSG_*_AVAILABLE Cmake options. This gives you the same GL features that you'll see with GLES 1.1 or 2.0 (depending upon the options you choose.) When I did the initial groundwork for the GLES port I did it all against standard OpenGL using Cmake to give me a first pass approximation at GLES support, and it certainly helped make the port go smoothly as I was able to change one thing at a time and gradually shift across rather than be faced with a massive porting effort all at once. I think this is the best short-term solution. Thanks Robert. -Alok ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] opengl es 2.0
Hi Alok, On Wed, Dec 2, 2009 at 4:54 PM, Alok Priyadarshi alo...@gmail.com wrote: Welcome to the OSG :-) Thanks. I am not new to OSG, just coming back to it. I used it in my previous life as a grad student at UMCP. In fact I also met you and Don at one of the Washington DC chapter dinners. A warm welcome back then :-) I've only written EGL support for GraphicsWindowX11.cpp, and don't have any access to a Windows or OSX system so can't directly help there. Members of the community will have to dive in and add EGL support to src/osgViewer/GraphicsWindowWin32.cpp to enable OpenGL ES under Windows. Depending on how I end up using the examples, I might implement it. In that case, I will send you a patch. This will be useful. My hope is now that the core scene graph is ported and working under GLES 1.1 and GLES 2.0 the door will be open for engineers across platforms to pitch in an complete the support for their platform. Another option is to just work against OpenGL and just disable the fixed function pipeline features via the OSG_*_AVAILABLE Cmake options. This gives you the same GL features that you'll see with GLES 1.1 or 2.0 (depending upon the options you choose.) When I did the initial groundwork for the GLES port I did it all against standard OpenGL using Cmake to give me a first pass approximation at GLES support, and it certainly helped make the port go smoothly as I was able to change one thing at a time and gradually shift across rather than be faced with a massive porting effort all at once. I think this is the best short-term solution. Thanks Robert. Please note that most OSG examples won't work as is under OpenGLES 2.0 thanks to the lack of the fixed function pipeline. This means you need to code up vertex and fragment shaders to replace the fixed function pipeline. You can use the osgUtil::ShaderGen to help do some automatic conversions of fixed function pipeline scene graphs to shader based ones but it's far from a perfect mapping. My plan is to provide a fallback and shader composition scheme that will enable a smoother mapping between the fixed function pipeline state attributes and equivalent shaders/uniforms. This work is pretty speculative though - I still don't have a concrete design down for how to tackle this, let alone any code to do it. -- BTW, it's good news to see that Native client will be supporting GLES2.0. OpenGL and OpenCL would also be good additions :-) Another route I'd love to see would be for native GLES2.0 drivers to make their way out onto the desktop OS's. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Distance Per Pixel Calculation
Thanks Paul, I understand how to go through the OpenGL pipe to convert from World to Screen coordinates and back eye_coordinate = world_coordinate * view_matrix; clipspace_coordinate = eye_coordinate * projection_matrix; screen_coordindates = clipspace_coordinate * viewport_matrix; But I'm unclear how to do it to get distance subtended by a single pixel. Can you point me to an example or an article? Best Regards -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz Sent: Tuesday, December 01, 2009 6:26 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Distance Per Pixel Calculation Hi Nelson -- Given a world/eye coordinate distance from the eye, a viewport, and a projection matrix, you can determine the world/eye coordinate distance subtended by a single pixel by back-transforming through the OpenGL transformation pipe. At a former employer, I used such a technique to control the LOD of our rendered terrain. Paul Martz Skew Matrix Software LLC _http://www.skew-matrix.com_ http://www.skew-matrix.com/ +1 303 859 9466 Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote: I'm trying to determine the given distance per pixel (or group of pixels) on my scene. I'm using an Intersection to get the World XYZ coordinates at a given Screen XY point, then getting a second set of World XYZ coordinates after incrementing the Screen point. Then Calculating the distance between the two World XYZ coordinates. Is there a better way of doing this? Thanks -- -- ___ 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.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Distance Per Pixel Calculation
The code I wrote to do this, and my notes, stayed with my former employer, so I know of no published sources. It is not any kind of secret patented technology, it is just a linear algebra equation that you need to solve. (I'm not trying to be a jerk by declaring it easy, then withholding the information on how to do it. I just have too many other commitments right now to spend time solving this equation for you. It really is not too complicated, and if you know the OpenGL pipe and linear algebra, you can probably work it out on a white board in an hour or two.) Paul Martz Skew Matrix Software LLC _http://www.skew-matrix.com_ http://www.skew-matrix.com/ +1 303 859 9466 Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote: Thanks Paul, I understand how to go through the OpenGL pipe to convert from World to Screen coordinates and back eye_coordinate = world_coordinate * view_matrix; clipspace_coordinate = eye_coordinate * projection_matrix; screen_coordindates = clipspace_coordinate * viewport_matrix; But I'm unclear how to do it to get distance subtended by a single pixel. Can you point me to an example or an article? Best Regards -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz Sent: Tuesday, December 01, 2009 6:26 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Distance Per Pixel Calculation Hi Nelson -- Given a world/eye coordinate distance from the eye, a viewport, and a projection matrix, you can determine the world/eye coordinate distance subtended by a single pixel by back-transforming through the OpenGL transformation pipe. At a former employer, I used such a technique to control the LOD of our rendered terrain. Paul Martz Skew Matrix Software LLC _http://www.skew-matrix.com_ http://www.skew-matrix.com/ +1 303 859 9466 Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote: I'm trying to determine the given distance per pixel (or group of pixels) on my scene. I'm using an Intersection to get the World XYZ coordinates at a given Screen XY point, then getting a second set of World XYZ coordinates after incrementing the Screen point. Then Calculating the distance between the two World XYZ coordinates. Is there a better way of doing this? Thanks -- -- ___ 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.or g ___ 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] extracting the current image and depth information
Hi, After enough repetitions of using my head as a blunt instrument, I am seeing the results I was looking for. I thought I would post back here a simplified version of the code I'm now using, in case somebody else comes along with the same question I was asking at a very beginner level. Sorry the code looks so jacked up... I can't figure out how to get it to display the ref_ptr syntax correctly. Code: //Within my Win32 dialog app, the following essential OSG // calls get the job done. It looks so simple now that it's working... void CVLS2Dlg::operateSim(osgViewer::Viewer *a_osgView) { osg::ref_ptrosg::Camera osgCam = a_osgView-getCamera(); osg::ref_ptrosg::Image visImage = new osg::Image; osg::ref_ptrosg::Image zImage = new osg::Image; visImage-allocateImage(1024, 768, 1, GL_BGR, GL_UNSIGNED_BYTE); //pixelFormat is GL_BGR to match Win32 DIB zImage-allocateImage(1024, 768, 1, GL_DEPTH_COMPONENT, GL_FLOAT); osgCam-attach(osg::Camera::COLOR_BUFFER, visImage, 0, 0); osgCam-attach(osg::Camera::DEPTH_BUFFER, zImage, 0, 0); /* */ //some code here sets up the initial scene a_osgView-frame(); while(simRun) { //At this point make a couple of calls to a class that I lifted // from another project internally, // that renders the info as Win32 DIBs on my dialog. // It's the particular allocateImage() and attach() arguments above // that create the osg::Image in a DIB-ready format. //If the objective was only to *see* the depth info, I could have put the // zImage back into my osgViewer as a 'picture in picture', HUD type of thing. // However, my application requires that I mess with the pixels (sensor // modeling) and reformat the range information before passing it on to another // system for processing. //Next I have some code here to update mytranlsation rotation matrices osgCam-setViewMatrix( rot * trans ); a_osgView-frame(); // You may have noticed that I update my osg frame *after* I extract my data // for external processing. So I'm processing one frame behind what OSG is // thinking ... which is a non-issue for my application and simplifies the code. // If this mattered I would move my functionality into a PostDrawCallback() like // is done in the osgprerender example app. } } Thank you to JP and some off-list answers from Chris Hansen that got me pointed in the right direction! Cheers, Eric[/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20776#20776 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadows on Windows XP
Hi, i just want to add some pictures to see my problem and say i have a nvidia quadro fx 570 on windows xp(32 bits) with the last driver ... Thank you! Cheers, mauricio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20777#20777 Attachments: http://forum.openscenegraph.org//files/summer_151.jpg http://forum.openscenegraph.org//files/spring_711.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] glsl shader preview
Hi comunity, anyone aware of some tool for viewing glsl shaders? Nick http://www.linkedin.com/in/tnikolov Sent from Ünalan, İstanbul, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] lots of failed tasks: Resuming vpbmaster run
Hi, Well, 64 bit is besser, it fails after 31000 tasks - but it fails.. But fortunately resuming in VPB is now possible. I Posted it to the VPB wiki unser usage exampes http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/Resume @Mod: Please close this Thread.. Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20779#20779 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadows on Windows XP
Hi Mauricio, On linux everything works very well, but on Windows XP the shadows move with mr.makeRotate(latitud, osg::Y_AXIS); but don't move with mt.makeTranslate(x, 0.0, 0.0); Are you sure your light source is not just a directional light? Directional lights change lighting (and shadows) when their direction changes (i.e. rotation) but not when their position changes. It's probably not even related to platform. We've been using shadows in OSG for a while now, on Windows XP, Windows Vista, Windows 7 and Linux, and have not had this kind of problems. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OT: DARPA Network Challenge
So, while it would be very cool to make a 3D model of this in OSG, I can't really see how it would help. Other than look cool. But, this is the sort of thing that I think many of the folks here would dig: DARPA, the folks that originally inverted the Internet, are having a wacky spatially-related contest this weekend involving GPS: http://networkchallenge.darpa.mil/ There has already been much speculation about using GIS or remote sensing to located the balloons, but much of it is hindered by the fact that there is no good/fast/widely available imagery one could search. One could probably eliminate much of the US by buffering the road network, since the rules state the targets will be visible from a road, but it still leaves a huge unknown area. One team claims to have even predicted where 1-5 of the balloons will be based (thanks to help from Mekow334 and HotJazz, our expert balloon sleuths, who know their way around a satellite and a GPS log like nobody else!) I'm somewhat skeptical, since their site's countdown clock isn't even counting down to the right time. I’ve established a team of my own, called Team DeciNena. We will win because we have the wittiest name. ;) No, seriously, whomever wins will be using a mixture of all sorts of tactics from team recruiting to passive data mining. I'm sure there will be a lot of disinformation out there, and it will be important to combat it. We are using a mashup of GIS/GoogleMaps technologies in a Drupal-based Content Management System to coordinate our team. If we get a report, we can spatially query our member database to find other nearby team members who can confirm the report. We're also experimenting with Google Wave to see if it has anything interesting to offer. Join us, it's free, and you could actually win something. We're even sharing some reward money with those team participants who DON'T themselves find a balloon. http://decinena.com -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ 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
Re: [osg-users] Distance Per Pixel Calculation
Geez, Nelson, you started me obsessing over this, and then I couldn't focus until I'd worked it out. :-) Here we go. Use a fixed-width font. First, let's look at the projection matrix. Using something like gluPerspective, we have a matrix as follows: With these values (for brevity): f = cotangent( fovy/2 ) A = ( zNear+zFar )/( zNear-zFar ) B = ( 2*zNear*zFar )/( zNear-zFar ) The generated matrix is f/aspect 0 0 0 0 f 0 0 0 0 A B 0 0 -1 0 (Please note that's column major, even though I'll use row-major vectors below.) OK, given an eye coordinate at the center of the view with a known z value: ec = ( 0, 0, z, 1 ) The transformed clip coordinate is (vector-matrix multiply): cc = ( 0, 0, z*A+B, -z ) and the normalized device coordinate (divide by cc w) is: ndc = ( 0, 0, (z*A+B) / -z ) Next we need the viewport. To make things easy, let's assume a default depth range of 0.0 to 1.0, and let's also assume 0, 0 for the viewport xy values. That way we only have to deal with the with and height, which is the typical case anyway. The window coordinate is: wc = ( 0.5*w, 0.5*h, ( 0.5*(z*A+B) / -z ) ) Looks ugly, but remember, those are all given values, so you can just take your known z distance, your viewport, and your projection matrix and compute that window coordinate with a pencil and a napkin. Now we know the window coordinate distance subtended by one pixel. That distance is 1.0 by definition. It's the same for x and y, so let's ignore y and just add 1 to x to get this new delta window coordinate: wcD = ( 0.5*w+1, 0.5*h, ( 0.5*(z*A+B) / -z ) ) If we back-transform this into eye space, the resulting eye space x value is the distance subtended by one pixel. That's what we're after! We can do this... (I think...) The delta normalized device coordinate is: ndcD = ( ((0.5*w+1) / w * 2) - 1, 0, (z*A+B) / -z ) (Tricky: The multiply by 2 and subtract 1 is needed to put us back into the range -1 to 1.) The delta clip coordinate is: ccD = ( (((0.5*w+1) / w * 2) - 1) * -z, 0, z*A+B, -z ) (Multiply by -z, the inverse of dividing by -z.) And finally the delta eye coordinate is: ecD = ( (((0.5*w+1) / w * 2) - 1) * -z * (aspect/f), 0, z, 1 ) (Multiply by aspect/f, which is the inverse of multiplying by f/aspect, which is what we would've had to do at the top of this email to compute the cc x value.) In summary, the ec x distance subtended by one pixel in the center of your window at a given z distance is: (((0.5*w+1) / w * 2) - 1) * -z * (aspect/f) To solve, you just need these four values: * The viewport width * The given z distance * The aspect ration in your projection matrix * And the f value, which is cotangent( fovy/2 ), and fovy also comes from the projection matrix. There might be some math errors there, so please check over my work. Then run some test values through it to verify. One thing to keep in mind is that eye space z distance is not the same as world coordinate range. I've created an equation to solve for x distance at the center of the window, and accuracy will degrade if you use this same solution for pixels near the edge of the window. But hopefully you get the idea and you can adapt this to your project. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Quad buffered stereo?
Hello osg-appreciating fellows, so my boss had this awesome idea to use 3D shutter goggles with our OpenSceneGraph application - and unfortunately I am the clueless implementer ;) So I looked into hardware support and found that the professional nVidia Quadro range would support this gimmick for OpenGL applications (whereas the consumer cards only allow this in DirectX games on Vista and Seven). So great news about the hardware support - but the application does need to use a quad buffered stero frame buffer. Now the question is how I would enable an OpenSceneGraph application to use a quad buffered stereo view mode - and if possible in windowed mode (our app isn't currently full screen). Is this even possible? Is there any osg sample that uses a quad buffered framebuffer already? If anyone could shed some light on this issue, I would be eternally grateful. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quad buffered stereo?
Christian Buchner wrote: Now the question is how I would enable an OpenSceneGraph application to use a quad buffered stereo view mode - and if possible in windowed mode (our app isn't currently full screen). Is this even possible? Is there any osg sample that uses a quad buffered framebuffer already? If anyone could shed some light on this issue, I would be eternally grateful. Yes, this is possible, and you do need a Quadro card to do it. The GraphicsContext::Traits structure (used when setting up a Viewer) contains a quadBufferStereo setting that lets you request a stereo-enabled framebuffer. You'll also probably need to look at the osg::DisplaySettings class for the various stereo display controls. Not a complete answer, I know, but hopefully it sheds the kind of light you requested. If you have any specific questions, ask away. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glsl shader preview
Hi, what would you like to see? Maybe rendermonkey/lumina http://lumina.sourceforge.net/Home.html jp Trajce Nikolov wrote: Hi comunity, anyone aware of some tool for viewing glsl shaders? Nick http://www.linkedin.com/in/tnikolov Sent from Ünalan, İstanbul, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] lots of failed tasks: Resuming vpbmaster run
Hi Torben, thanks for taking the time to put a page on the wiki. rgds jp Torben Dannhauer wrote: Hi, Well, 64 bit is besser, it fails after 31000 tasks - but it fails.. But fortunately resuming in VPB is now possible. I Posted it to the VPB wiki unser usage exampes http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/Resume @Mod: Please close this Thread.. Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20779#20779 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Distance Per Pixel Calculation
Hi, you could also maybe have a look at the PagedLOD code that gets called when the mode is pixel_size_on_screen. See PagedLOD.cpp line: required_range = cullStack-clampedPixelSize(getBound()) / cullStack-getLODScale(); I think this does the inverse of what you want, but you might encounter some osg calls you could use. jp Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote: Wow Paul, Thank you. :) -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz Sent: Wednesday, December 02, 2009 2:30 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Distance Per Pixel Calculation Geez, Nelson, you started me obsessing over this, and then I couldn't focus until I'd worked it out. :-) Here we go. Use a fixed-width font. First, let's look at the projection matrix. Using something like gluPerspective, we have a matrix as follows: With these values (for brevity): f = cotangent( fovy/2 ) A = ( zNear+zFar )/( zNear-zFar ) B = ( 2*zNear*zFar )/( zNear-zFar ) The generated matrix is f/aspect 0 0 0 0 f 0 0 0 0 A B 0 0 -1 0 (Please note that's column major, even though I'll use row-major vectors below.) OK, given an eye coordinate at the center of the view with a known z value: ec = ( 0, 0, z, 1 ) The transformed clip coordinate is (vector-matrix multiply): cc = ( 0, 0, z*A+B, -z ) and the normalized device coordinate (divide by cc w) is: ndc = ( 0, 0, (z*A+B) / -z ) Next we need the viewport. To make things easy, let's assume a default depth range of 0.0 to 1.0, and let's also assume 0, 0 for the viewport xy values. That way we only have to deal with the with and height, which is the typical case anyway. The window coordinate is: wc = ( 0.5*w, 0.5*h, ( 0.5*(z*A+B) / -z ) ) Looks ugly, but remember, those are all given values, so you can just take your known z distance, your viewport, and your projection matrix and compute that window coordinate with a pencil and a napkin. Now we know the window coordinate distance subtended by one pixel. That distance is 1.0 by definition. It's the same for x and y, so let's ignore y and just add 1 to x to get this new delta window coordinate: wcD = ( 0.5*w+1, 0.5*h, ( 0.5*(z*A+B) / -z ) ) If we back-transform this into eye space, the resulting eye space x value is the distance subtended by one pixel. That's what we're after! We can do this... (I think...) The delta normalized device coordinate is: ndcD = ( ((0.5*w+1) / w * 2) - 1, 0, (z*A+B) / -z ) (Tricky: The multiply by 2 and subtract 1 is needed to put us back into the range -1 to 1.) The delta clip coordinate is: ccD = ( (((0.5*w+1) / w * 2) - 1) * -z, 0, z*A+B, -z ) (Multiply by -z, the inverse of dividing by -z.) And finally the delta eye coordinate is: ecD = ( (((0.5*w+1) / w * 2) - 1) * -z * (aspect/f), 0, z, 1 ) (Multiply by aspect/f, which is the inverse of multiplying by f/aspect, which is what we would've had to do at the top of this email to compute the cc x value.) In summary, the ec x distance subtended by one pixel in the center of your window at a given z distance is: (((0.5*w+1) / w * 2) - 1) * -z * (aspect/f) To solve, you just need these four values: * The viewport width * The given z distance * The aspect ration in your projection matrix * And the f value, which is cotangent( fovy/2 ), and fovy also comes from the projection matrix. There might be some math errors there, so please check over my work. Then run some test values through it to verify. One thing to keep in mind is that eye space z distance is not the same as world coordinate range. I've created an equation to solve for x distance at the center of the window, and accuracy will degrade if you use this same solution for pixels near the edge of the window. But hopefully you get the idea and you can adapt this to your project. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] How to compile osgOcean
Hi everyone I changed the id of the osgOcean library with the otool from osgOcean to @executable_path/../Frameworks/osgOcean.framework/Versions/A/osgOcean and now it works. Thanks everybody for the help. Regards Dominic Ulrich Hertlein schrieb: On 1/12/09 7:13 PM, Dominic Stalder wrote: When I want to start the application the following error occurs: dyld: Library not loaded: osgOcean Referenced from: xxx Reason: image not found This usually means that the respective library can't be found via the DYLD_LIBRARY_PATH. /ulrich ___ 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] osgShadow - Application crash
Hi, Im trying to add shadows to my scene, code taken from osgshadow example but my application crash If I dont set the setShadowTechnique then my application does not crash, but i obviously don't get shadows either. Ive tried each of the shadow techniques but only Shadow volumes technique . Why my application crash while using other shadow technique ? How can I solve this problem ? Thank you! Cheers, manish -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20790#20790 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glsl shader preview
yea Lumina seems to be good Nick http://www.linkedin.com/in/tnikolov On Wed, Dec 2, 2009 at 10:28 PM, J.P. Delport jpdelp...@csir.co.za wrote: Hi, what would you like to see? Maybe rendermonkey/lumina http://lumina.sourceforge.net/Home.html jp Trajce Nikolov wrote: Hi comunity, anyone aware of some tool for viewing glsl shaders? Nick http://www.linkedin.com/in/tnikolov Sent from Ünalan, İstanbul, Turkey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org 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