Re: [osg-users] osgText::Text::GlyphQuads change in the recent versions
It was introduced in 3.3.4 .. just as an info if someone Nick On Thu, Apr 23, 2015 at 11:40 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Robert :-) On Thu, Apr 23, 2015 at 10:32 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 22 April 2015 at 22:38, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: I did port of my app from 3.3.1 to the latest 3.3.7. All went smooth only one line of code I want to #ifdef with OSG_VERSION due to the apps still depend on 3.3.1. And this is the usage of ref_ptrs in GlyphQuads coordiantes. Can you recall from which version they becomed ref_ptrs of Arrays? It will save me time to go across the code of each version from 3.3.1 I don't recall the timing of this change. Have a look at the svn log for the file and then compare that to the dates of the dev releases. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgText::Text::GlyphQuads change in the recent versions
Hi Robert, I did port of my app from 3.3.1 to the latest 3.3.7. All went smooth only one line of code I want to #ifdef with OSG_VERSION due to the apps still depend on 3.3.1. And this is the usage of ref_ptrs in GlyphQuads coordiantes. Can you recall from which version they becomed ref_ptrs of Arrays? It will save me time to go across the code of each version from 3.3.1 Thanks a lot as always Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] #pragmatic composition : setDefine
Thanks Sebastian, I thought it would be that easy Cheers, Nick On Tue, Apr 21, 2015 at 7:33 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, Hi Robert, all, I finally ported all my shaders to the this new thing. I have a question. Probably simple but will go anyway in my shader I have something like #define MYDEFINE .. do stuff here ... #endif at the root of the scene I have stateSet-setDefine(MYDEFINE); how can I fornid this define somewhere down the tree ? Simple removing it is not helping (as expected I guess). Do you mean unsetting? Then simply do setDefines(MYDEFINE, osg::StateAttribute::OFF) where you like it to have it disabled. The rules for the overriding / protecting apply to this as well. Any sample how the defines with Values set works? Simply by setDefine(MY_VALUE_DEFINE, 42, osg::StateAttribute::ON) or Roberts example defining a function: stateset-setDefine(VERTEX_FUNC(v) , vec4(v.x, v.y, v.z * sin(osg_SimulationTime), v.w)); Thanks a bunch ! Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] #pragmatic composition : setDefine
Hi Robert, all, I finally ported all my shaders to the this new thing. I have a question. Probably simple but will go anyway in my shader I have something like #define MYDEFINE .. do stuff here ... #endif at the root of the scene I have stateSet-setDefine(MYDEFINE); how can I fornid this define somewhere down the tree ? Simple removing it is not helping (as expected I guess). Any sample how the defines with Values set works? Thanks a bunch ! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] StatsHandler missing numbers
Hi Andreas, I have pretty new Intel board on my laptop and got into few problems with the StatsHandler - just accidentally I changed the threading model of the Viewer and I got it back to normal. This is a hint no clue why it is happening but maybe worth of try cheers, Nick On Fri, Apr 17, 2015 at 3:31 PM, Christian Buchner christian.buch...@gmail.com wrote: One major problem with the Intel drivers is that their products are typically EOL'ed (end-of-lifed) three years after first release - at which point they stop receiving driver updates (not even bug fixes). You can see the problem with the integrated graphics in Intel's Sandy Bridge chips (introduced Q1 2011). You cannot get any OpenGL drivers dated newer than April 2014 - and some OpenGL features we require simply aren't working with this driver release. And so we have to tell some of our customers that their laptops have use Ivy Bridge or later microarchitecture - or be equipped with a separate dedicated graphics chip. Christian 2015-04-17 15:23 GMT+02:00 Andreas Schreiber a...@online.de: Hi Émeric, thx for the respond and the idea ;) My driver version is: Intel(R) HD Graphics 4000 Driver Version: 10.18.10.3958 Operating System: Windows* 8.1 (6.3.9600) Installed DirectX* Version: 11.2 Supported DirectX* Version: 11.0 Shader Version: 5.0 OpenGL* Version: 4.0 OpenCL* Version: 1.2 Physical Memory: 8036 MB Processor: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz Processor Speed: 2594 MHz Vendor ID: 8086 Device ID: 0166 Device Revision: 09 * Processor Graphics Information * Processor Graphics in Use: Intel(R) HD Graphics 4000 Video BIOS: 0.151 Current Resolution: 1600 x 900 I could not update it, yet. But when I do and it helps I post it ;) ... Thank you! Cheers, Andreas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63453#63453 ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trouble with a simple shader program.
Hi Alexander, what does it says on the console? Any shader errors, obviously it reports if the shader is buggy Nick On Sun, Apr 12, 2015 at 1:23 AM, Alexander Wieser alexander.wie...@crystalbyte.de wrote: Hi, I managed to get one step closer, if I remove the vertex shader the color is properly displayed. The obvious conclusion is that the vertex shader is bullocks ... Is it possible that the attributes, such as osg_Vertex are no longer available ? Thank you! Cheers, Alexander -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=6#6 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] keyboard events not processed after osgviewer lose focus and get it back
Hi Community, In my cross-platform app I have processing of keybard input - simple terminal for writing commands in real-time. This is same on Windows and Linux (haven't tested it yet on Mac), but on Windows for example, you do Alt-TAB to get some other window and get it back again, the keyboard events are not processed anymore :-/. Seams like when osgViewer loses the focus it is not gaining it back from the system call. On windows I managed to do this - ( my background is Windows, on Linux I am new :-) ). Here is the snippet how I managed it to work on Windows. Anyone to share a snippet for Linux/Mac? As always, thanks a lot snip while (!viewer-done()) { #if defined(_WIN32) MSG msg; if (::PeekMessage(msg,NULL,0,0,PM_NOREMOVE)) { ::GetMessage(msg, NULL, 0, 0); osgViewer::CompositeViewer::Windows wins; viewer-getWindows(wins); if (wins.size()) { osgViewer::GraphicsHandleWin32 *hdl = dynamic_castosgViewer::GraphicsHandleWin32*(wins.at(0)); if(hdl) { WNDPROC fWndProc = (WNDPROC)::GetWindowLongPtr(hdl-getHWND(), GWLP_WNDPROC); fWndProc(hdl-getHWND(), msg.message, msg.wParam, msg.lParam); } } } #endif .. /snip Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] flash the DatabasePager on demmand
Hi community, is there a way to flush (discard) the currently pending PagedLODs with a call? I read the class and didn;t found anything Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] flash the DatabasePager on demmand
okay :-) .. maybe someone else will come up with a hint Thanks anyway Nick On Wed, Mar 25, 2015 at 6:51 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, I'm afraid I don't have any ideas off the top of my head. Too many other complex things on my table to handle pontificating on anything else complicated right now. Robert. On 25 March 2015 at 17:24, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Robert, here is my situation. My client has large UTM database. Their IOS software needs to offset the database for each mission, so I have a NodeVisitor that apply some positinal offset to Geometry/Matrices/LODs. And there is a ReadCallback that uses this offset too. This works great, I can offset tiles that are loaded and to be loaded dynamically. However, I dont have control on the PagedLODs that are loading in between changing the offset, so these new tiles do not catch the correct offset. Any hint/hack for this situation? This is what I think is going on, not 100% sure though Thanks a lot! Nick On Wed, Mar 25, 2015 at 5:24 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Nick, I don't recall a method call to explicitly discards all pending DatabaseRequests. The DatabasePager discards DatabaseRequest's automatically if they aren't been refreshed by PagedLOD's that need them - this is done by tracking the frame number that of when the cull traversal hits a PagedLOD and requests a child. Robert. On 25 March 2015 at 16:04, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi community, is there a way to flush (discard) the currently pending PagedLODs with a call? I read the class and didn;t found anything Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] flash the DatabasePager on demmand
Hi Robert, here is my situation. My client has large UTM database. Their IOS software needs to offset the database for each mission, so I have a NodeVisitor that apply some positinal offset to Geometry/Matrices/LODs. And there is a ReadCallback that uses this offset too. This works great, I can offset tiles that are loaded and to be loaded dynamically. However, I dont have control on the PagedLODs that are loading in between changing the offset, so these new tiles do not catch the correct offset. Any hint/hack for this situation? This is what I think is going on, not 100% sure though Thanks a lot! Nick On Wed, Mar 25, 2015 at 5:24 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Nick, I don't recall a method call to explicitly discards all pending DatabaseRequests. The DatabasePager discards DatabaseRequest's automatically if they aren't been refreshed by PagedLOD's that need them - this is done by tracking the frame number that of when the cull traversal hits a PagedLOD and requests a child. Robert. On 25 March 2015 at 16:04, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi community, is there a way to flush (discard) the currently pending PagedLODs with a call? I read the class and didn;t found anything Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Create texture from texture handle
Hi Steven, yes, you can wrap your GL texture handle with osg::Textire2D object. Here is some snippet that might help: snip GLuint handle = ...; osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; osg::ref_ptrosg::Texture::TextureObject textureObject = new osg::Texture::TextureObject(texture.get(),handle,GL_TEXTURE_2D); textureObject-setAllocated(); texture-setTextureObject(renderInfo.getContextID(),textureObject.get()); state.setActiveTextureUnit(textureStage); texture-apply( state ); // Tell state about our changes state.haveAppliedTextureAttribute(textureStage, texture.get()); On Mon, Mar 16, 2015 at 6:30 PM, Steven Powers stevenapow...@gmail.com wrote: HI! Currently I have this texture getting generated by a plugin that I'm using: glGenTextures(1, textureHandle); glBindTexture(GL_TEXTURE_2D, textureHandle); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, N, M, 0, GL_RGB, GL_FLOAT, NULL); Is there an easy way to create an osg::Texture2D to use the same texture handle? So far it looks like textures generate their own handles. I can't do away with the OpenGL code. Thank you! Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63113#63113 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture cache question
Thanks Robert. Sebastian, yes, that is the thing I am after. Thanks a lot! Nick On Wed, Mar 11, 2015 at 9:49 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, The osgDB::SharedStateManager might well be what you are looking for. It's not something I wrote or have used so can't provide lots of details on how best to use it, but I can say it's role is for sharing state between an already loaded scene graph and new loaded scene graph. Sebastian's suggestion about the using the Object Cache feature of osgDB::Registry is useful too for sharing osg::Image, which will help the SharedStateManager spot places where osg::Texture can be shared when they use the same osg::Image. Robert. On 10 March 2015 at 16:24, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, what was the way to have textures cached and reused on load? any hint? Thanks a bunch! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Texture cache question
Hi Community, what was the way to have textures cached and reused on load? any hint? Thanks a bunch! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL error line 2255: invalid operation
Thanks Bjorn Nick On Sat, Mar 7, 2015 at 10:29 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi, I haven't tried it myself, but gDebugger is available for Linux as well: http://developer.amd.com/tools-and-sdks/archive/amd-gdebugger/ Cheers Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62983#62983 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL error line 2255: invalid operation
Thanks Sebastian. I have to switch to my Windows machine :-) Cheers, Nick On Fri, Mar 6, 2015 at 8:47 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, Try geDebugger [1] etc.. Under visual studio they even integrate into the GUI, so you will be able to debug the offending line which causes the error. [1] http://developer.amd.com/tools-and-sdks/archive/amd-gdebugger/ Cheers Sebastian suddenly OSG_GL_ERROR_CHECKING=ON is not verbose at all for this error still the same :-/ Nick On Thu, Mar 5, 2015 at 11:16 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Bjorn. I will start debugging Nick On Thu, Mar 5, 2015 at 11:21 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi Nick, I got a couple of this while doing the Oculus integration (mostly due to Oculus driver injection). But the procedure I usually use is this: 1. Enabled OpenGL debugging in OpenSceneGraph by setting the environment variable: OSG_GL_ERROR_CHECKING=ON This will give you more information of which class that triggered the GL error. (Although this is not always true, there are some caveats). 2. Once I found which class that is the probable offender I usually add some debug printouts in that OSG class, printing out the name of the node, attribute or whatever classtype is triggering the error. The caveats: This process usually finds you the offending call. But you cannot trust it 100%. This is due to the fact that to clear the error flag you have to call glGetError(), and since OSG cannot have glGetError() calls after every single one of its OpenGL calls, sometimes the wrong class gets reported. So if you suspects that OSG is pointing the finger on the wrong class. Start by adding a glGetError() call as first OpenGL call in that class. Otherwise you might chase an error that actually exists in another class. Good luck on you bug hunting! Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62968#62968 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL error line 2255: invalid operation
suddenly OSG_GL_ERROR_CHECKING=ON is not verbose at all for this error still the same :-/ Nick On Thu, Mar 5, 2015 at 11:16 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Bjorn. I will start debugging Nick On Thu, Mar 5, 2015 at 11:21 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi Nick, I got a couple of this while doing the Oculus integration (mostly due to Oculus driver injection). But the procedure I usually use is this: 1. Enabled OpenGL debugging in OpenSceneGraph by setting the environment variable: OSG_GL_ERROR_CHECKING=ON This will give you more information of which class that triggered the GL error. (Although this is not always true, there are some caveats). 2. Once I found which class that is the probable offender I usually add some debug printouts in that OSG class, printing out the name of the node, attribute or whatever classtype is triggering the error. The caveats: This process usually finds you the offending call. But you cannot trust it 100%. This is due to the fact that to clear the error flag you have to call glGetError(), and since OSG cannot have glGetError() calls after every single one of its OpenGL calls, sometimes the wrong class gets reported. So if you suspects that OSG is pointing the finger on the wrong class. Start by adding a glGetError() call as first OpenGL call in that class. Otherwise you might chase an error that actually exists in another class. Good luck on you bug hunting! Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62968#62968 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL error line 2255: invalid operation
Thanks Bjorn. I will start debugging Nick On Thu, Mar 5, 2015 at 11:21 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi Nick, I got a couple of this while doing the Oculus integration (mostly due to Oculus driver injection). But the procedure I usually use is this: 1. Enabled OpenGL debugging in OpenSceneGraph by setting the environment variable: OSG_GL_ERROR_CHECKING=ON This will give you more information of which class that triggered the GL error. (Although this is not always true, there are some caveats). 2. Once I found which class that is the probable offender I usually add some debug printouts in that OSG class, printing out the name of the node, attribute or whatever classtype is triggering the error. The caveats: This process usually finds you the offending call. But you cannot trust it 100%. This is due to the fact that to clear the error flag you have to call glGetError(), and since OSG cannot have glGetError() calls after every single one of its OpenGL calls, sometimes the wrong class gets reported. So if you suspects that OSG is pointing the finger on the wrong class. Start by adding a glGetError() call as first OpenGL call in that class. Otherwise you might chase an error that actually exists in another class. Good luck on you bug hunting! Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62968#62968 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GL error line 2255: invalid operation
Hi All, have some of you experienced this error. it is annoying and I have not clue how to fix it. Any hint is appreciated Thanks a lot as always ! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] RenderStage getPositionalStateContainer matrices
okay... :-) .Thanks Robert Nick On Thu, Mar 5, 2015 at 2:39 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 5 March 2015 at 13:33, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: are these matrices local or world? Neither ;-) Anyone with a clue? There are the modelview matrices that takes the associated positional state (Light,TexGen) into eye coordinates. These modelview matrices are generated during the cull traversal and accumulates the view matrix and model matrices in the scene graph to the point where the positional state is attached to the scene graph. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] RenderStage getPositionalStateContainer matrices
Hi Community are these matrices local or world? Anyone with a clue? Thanks as always Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] referenced memory management across dlls/exe (Windows only)
Thanks Sergey. I found that too. The problem was that the a core lib was keeping a ref_ptr of an Object allocated by a plugin from a dll. Then on clean I got this problem. I solved it by changing the ref_ptr to observer_ptr in the core lib. So I am good now. But BIG thanks for helping me. Ulrich, thanks too. Nick p.s. I was Windows programmer for a decade and switched to Linux recently. What a difference :-). Very good dev experience on Linux On Sun, Mar 1, 2015 at 10:00 PM, Sergey Kurdakov sergey.fo...@gmail.com wrote: Hi Nick, after looking some more I found that newer versions of Mingw switch to dynamic linking of libstd++ by default. so libstdc++-6.dll is a right lib. but as you have the same problems then I have no answer. Regards Sergey On Sun, Mar 1, 2015 at 5:16 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Sergey, on my system with the latest from the Qt bundle I don't have the libstdc++_s ... only libstdc++.a and libstdc++-6.dll . And I added -lstdc++ and still getting the same issues. Any further hints? Thanks a lot Nick On Sun, Mar 1, 2015 at 1:07 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Ulrich. That is what is going on Sergey, where this flags go in the .pro file, in* QMAKE_CXXFLAGS* or *LIBS* ? Thanks a bunch Nick On Sun, Mar 1, 2015 at 12:49 PM, Sergey Kurdakov sergey.fo...@gmail.com wrote: Hi To link against shared libgcc, add -shared-libgcc to link against shared libstdc++ add -lstdc++_s Regards Sergey On Sun, Mar 1, 2015 at 1:58 PM, Ulrich Hertlein u.hertl...@sandbox.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Nick, On 28/02/2015 14:46, Trajce Nikolov NICK wrote: I am facing a problem with memory clean-up when mixing the place of allocation across dlls and the executable. Let say I have main executable that loads dlls (plugins) in which I allocate memory using referenced pointers. On exit, those pointers that were allocated in one of the dlls got stucked in ... If I clean these pointers from the originated dll, it works ok, otherwise not. Any clue? You end up with different instances of the runtime library, each with its own heap management. You allocate the object on the heap of one DLL and free it onto the heap of the other - bang. Sorry, I don't know what the corresponding flag might be on mingw. Cheers, /ulrich -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQEcBAEBCAAGBQJU8vDIAAoJEP8WARS52jMYq6gH/Axcl3evhaF8tdjUePeHb707 Et4rociiWaZdVu2Cq3x3TWr6MvOqqdcJMka1h7z0Nyy43FI0HI2s63NdPiXH5LcS BYC8j1w8BTzOisOUYyQJwGaqt4856ne2tHAjAU47Qp5bAsvbx7ZTZa0VU2ncLmJt A5P2TOtDRGBjtxoQc4Kmx33AWHFzX3iT+yaN5v6EUTVO3MReQTqWCXdJWr+/GC/0 DMWmO/ZhGLis2NONoDGeNtZtgABPhg91Z+tZt0jYyzEkJ9eC4WN+F7x++0NPfRaf BBAzFN8Ch9YA4mcMjQF2TkqEdMcBHnmUb49ObUbU6fHd9Ce946dwfrB1gtlne4M= =Q7H0 -END PGP SIGNATURE- ___ 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 -- trajce nikolov nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] referenced memory management across dlls/exe (Windows only)
Thanks Ulrich. That is what is going on Sergey, where this flags go in the .pro file, in* QMAKE_CXXFLAGS* or *LIBS* ? Thanks a bunch Nick On Sun, Mar 1, 2015 at 12:49 PM, Sergey Kurdakov sergey.fo...@gmail.com wrote: Hi To link against shared libgcc, add -shared-libgcc to link against shared libstdc++ add -lstdc++_s Regards Sergey On Sun, Mar 1, 2015 at 1:58 PM, Ulrich Hertlein u.hertl...@sandbox.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Nick, On 28/02/2015 14:46, Trajce Nikolov NICK wrote: I am facing a problem with memory clean-up when mixing the place of allocation across dlls and the executable. Let say I have main executable that loads dlls (plugins) in which I allocate memory using referenced pointers. On exit, those pointers that were allocated in one of the dlls got stucked in ... If I clean these pointers from the originated dll, it works ok, otherwise not. Any clue? You end up with different instances of the runtime library, each with its own heap management. You allocate the object on the heap of one DLL and free it onto the heap of the other - bang. Sorry, I don't know what the corresponding flag might be on mingw. Cheers, /ulrich -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQEcBAEBCAAGBQJU8vDIAAoJEP8WARS52jMYq6gH/Axcl3evhaF8tdjUePeHb707 Et4rociiWaZdVu2Cq3x3TWr6MvOqqdcJMka1h7z0Nyy43FI0HI2s63NdPiXH5LcS BYC8j1w8BTzOisOUYyQJwGaqt4856ne2tHAjAU47Qp5bAsvbx7ZTZa0VU2ncLmJt A5P2TOtDRGBjtxoQc4Kmx33AWHFzX3iT+yaN5v6EUTVO3MReQTqWCXdJWr+/GC/0 DMWmO/ZhGLis2NONoDGeNtZtgABPhg91Z+tZt0jYyzEkJ9eC4WN+F7x++0NPfRaf BBAzFN8Ch9YA4mcMjQF2TkqEdMcBHnmUb49ObUbU6fHd9Ce946dwfrB1gtlne4M= =Q7H0 -END PGP SIGNATURE- ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] referenced memory management across dlls/exe (Windows only)
Hi Sergey, on my system with the latest from the Qt bundle I don't have the libstdc++_s ... only libstdc++.a and libstdc++-6.dll . And I added -lstdc++ and still getting the same issues. Any further hints? Thanks a lot Nick On Sun, Mar 1, 2015 at 1:07 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Ulrich. That is what is going on Sergey, where this flags go in the .pro file, in* QMAKE_CXXFLAGS* or *LIBS* ? Thanks a bunch Nick On Sun, Mar 1, 2015 at 12:49 PM, Sergey Kurdakov sergey.fo...@gmail.com wrote: Hi To link against shared libgcc, add -shared-libgcc to link against shared libstdc++ add -lstdc++_s Regards Sergey On Sun, Mar 1, 2015 at 1:58 PM, Ulrich Hertlein u.hertl...@sandbox.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Nick, On 28/02/2015 14:46, Trajce Nikolov NICK wrote: I am facing a problem with memory clean-up when mixing the place of allocation across dlls and the executable. Let say I have main executable that loads dlls (plugins) in which I allocate memory using referenced pointers. On exit, those pointers that were allocated in one of the dlls got stucked in ... If I clean these pointers from the originated dll, it works ok, otherwise not. Any clue? You end up with different instances of the runtime library, each with its own heap management. You allocate the object on the heap of one DLL and free it onto the heap of the other - bang. Sorry, I don't know what the corresponding flag might be on mingw. Cheers, /ulrich -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQEcBAEBCAAGBQJU8vDIAAoJEP8WARS52jMYq6gH/Axcl3evhaF8tdjUePeHb707 Et4rociiWaZdVu2Cq3x3TWr6MvOqqdcJMka1h7z0Nyy43FI0HI2s63NdPiXH5LcS BYC8j1w8BTzOisOUYyQJwGaqt4856ne2tHAjAU47Qp5bAsvbx7ZTZa0VU2ncLmJt A5P2TOtDRGBjtxoQc4Kmx33AWHFzX3iT+yaN5v6EUTVO3MReQTqWCXdJWr+/GC/0 DMWmO/ZhGLis2NONoDGeNtZtgABPhg91Z+tZt0jYyzEkJ9eC4WN+F7x++0NPfRaf BBAzFN8Ch9YA4mcMjQF2TkqEdMcBHnmUb49ObUbU6fHd9Ce946dwfrB1gtlne4M= =Q7H0 -END PGP SIGNATURE- ___ 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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] referenced memory management across dlls/exe (Windows only)
Hi all, I am facing a problem with memory clean-up when mixing the place of allocation across dlls and the executable. Let say I have main executable that loads dlls (plugins) in which I allocate memory using referenced pointers. On exit, those pointers that were allocated in one of the dlls got stucked in if (needDelete) { signalObserversAndDelete(true,true); } Ln 198 in Referenced. And this is Windows only, on Mac or Linux I don't have this problem. If I clean these pointers from the originated dll, it works ok, otherwise not. Any clue? Thanks as allways! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] referenced memory management across dlls/exe (Windows only)
also I am using Qt Creator and MinGW (whatever the last version is). I know in Visual Studio you can specify the /MD option to use shared CRT libs and to avoid this problem. Any MinGW gurus around with hints? Nick On Sat, Feb 28, 2015 at 2:46 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi all, I am facing a problem with memory clean-up when mixing the place of allocation across dlls and the executable. Let say I have main executable that loads dlls (plugins) in which I allocate memory using referenced pointers. On exit, those pointers that were allocated in one of the dlls got stucked in if (needDelete) { signalObserversAndDelete(true,true); } Ln 198 in Referenced. And this is Windows only, on Mac or Linux I don't have this problem. If I clean these pointers from the originated dll, it works ok, otherwise not. Any clue? Thanks as allways! Nick -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG will not work on OpenSUSE 13.2 with the AMD driver on Radeon
Hi Robert, thanks for the ping. No, I didn't fixed it. It is driver issue and I went through all the forums I found online with no good result. The driver available seams to be somewhat very new so and there are bugs reported. I was hoping maybe someone from the community have some experience with. I will wait on some more stable one. In mean time I moved the dev to another DELL system with NVIDIA. All the geometry shaders work there just fine. So I am good but I will follow this issue since the project I work on is cross-platform so it will be shame if I don;t make it work on the specified system. Thanks again ! Nick On Sat, Feb 14, 2015 at 12:42 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, Have you been able to sort the problem? I haven't used SUSE for over a decade, and don't have Radeon card so can't help on the specifics - I use Kubuntu + NVidia for day to day dev work. I was hoping other might chip in but it's been a bit of ghost town on the mailing list/forum this last week. Is the forum down? If you haven't yet resolved the problem then trying out other OpenGL applications would a good place to start. Checking the support/forum discussions for SUSE and Radeon would also be an avenue to explore. Robert. On 9 February 2015 at 19:20, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I spent the whole day today trying to make it work and I need your help since I am new to Linux development. My driver is from here https://en.opensuse.org/SDB:AMD_fglrx and when I run glxinfo I get this: name of display: :0 X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 12 Current serial number in output stream: 12 The system I use is hybrid with one intel and one radeon card and I am clueless how to setup X11 for this configuration Anyone can share some nowhow, hints? As always, thanks a bunch! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG will not work on OpenSUSE 13.2 with the AMD driver on Radeon
Hi Community, I spent the whole day today trying to make it work and I need your help since I am new to Linux development. My driver is from here https://en.opensuse.org/SDB:AMD_fglrx and when I run glxinfo I get this: name of display: :0 X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 12 Current serial number in output stream: 12 The system I use is hybrid with one intel and one radeon card and I am clueless how to setup X11 for this configuration Anyone can share some nowhow, hints? As always, thanks a bunch! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about bump mapping
Hi Alexandre, if you want to disable the texture that is bound to unit 1, you have to write a NodeVisitor that will traverse the statesets of the nodes where the texture to unit 1 is set, and simply switch that attribute to StateAttribute::OFF Nick On Thu, Feb 5, 2015 at 8:03 PM, Alexandre Vaillancourt alexandre.vaillancourt.l...@gmail.com wrote: Robert, This appears to be exactly the situation. Is there a way to see where this feature is enabled and is there is a way to disable it? Thanks a lot! -- Alexandre Vaillancourt 2015-02-05 13:54 GMT-05:00 Robert Osfield robert.osfi...@gmail.com: Hi Alexandre, It sounds like might be talking about a pre-rendered shadow texture rather than a shadow map. The OSG by default handles multi-texturing by simply blending them - this is part of the OpenGL fixed function pipeline, so it's not a case of enabling shadow map, but simply blending a shadow texture on texture unit 1 with the base texture on texture unit 0. However, I'm just guessing, only you have the data and application in front of you. Robert. On 5 February 2015 at 18:28, Alexandre Vaillancourt alexandre.vaillancourt.l...@gmail.com wrote: Gentlemen, Thank you for your replies. It turns out that the node is not bumpmapped with a shader (I've used a nodevisitor to check if a program was loaded on a node's stateset and didn't see any). However, the node seems to be having a shadow map. In our model editor (Creator) there is an extended material on the node, and the material has, among other things a surface modifier that has shadow map on texture unit 1. Looking at the exported osg file, I don't see how this texture is used as shadow map (I would assume a shader could need to use it, but we're not adding any shader for now (I'm debugging)). Could it be that upon loading, the plugin for the .osg files assumes that texture unit 1 would be the shadow map and enables it right away or something like that? Thanks for your help! -- Alexandre Vaillancourt 2015-02-05 4:26 GMT-05:00 Robert Osfield robert.osfi...@gmail.com: Hi Alexandre, Does the scene graph code you have inherited contain use of osgFX::BumpMapping? osgFX::BumpingMapping It's a really ancient bit of the OSG so it's really how I'd tackle it these days but it provides the old style osg::VertexProgram and FragmentProgram. Have a look at the OpenSceneGraph/src/osgFX/BumpMapping.cpp so see what it's doing. Robert. On 4 February 2015 at 23:57, Alexandre Vaillancourt alexandre.vaillancourt.l...@gmail.com wrote: Hi All, I'm not too knowledgeable in the field of shaders and bump map, but lately I've had the task of fixing something related to it in our software. The issue is that some faces in our software are bumpmapped (I see the 3 different texture units used in the .osg file, as well as in the original .flt model), but the node itself does not seem to have an osg::Program (nor osg::VertexProgram or osg::FragmentProgram) part of its stateset's state attributes. The question is this: is it possible that there is a way that a chunk of code of OSG could set up bump mapping on a node by itsefl and NOT add an osg::Program to it? For instance, if it finds more than one texture units in the .osg file, it would find a way to add a shader to enable the bump maping..? I'm really wondering how that node could be bump mapped... Thanks -- Alexandre Vaillancourt ___ 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 ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about bump mapping
/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 -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgEphemeris build on Linux
Hi All, this is not for this list, but I know some of you are using it. I downloaded the source from https://code.google.com/p/osgephemeris/source/checkout, run CMake (on Linux) and run make. or make all. It seam it is not set to be built on Linux even though CMake generated the Makefiles. What I am missing Thanks a bunch as allways p.s. the output is this ~/Dev/osgephemeris/osgEphemeris make all GNUmakefile:1: /makedefs: No such file or directory GNUmakefile:6: /makerules: No such file or directory make: *** No rule to make target '/makerules'. Stop. -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgEphemeris build on Linux
Thanks Chris, Alberto. Alberto, yeah, that did the build. Thanks again Nick On Thu, Feb 5, 2015 at 4:08 PM, Chris Hanson xe...@alphapixel.com wrote: Seems like we rebuilt it a while ago and it needed a bunch of hacking but I can't recall what the deal was. On Thu, Feb 5, 2015 at 7:33 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi All, this is not for this list, but I know some of you are using it. I downloaded the source from https://code.google.com/p/osgephemeris/source/checkout, run CMake (on Linux) and run make. or make all. It seam it is not set to be built on Linux even though CMake generated the Makefiles. What I am missing Thanks a bunch as allways p.s. the output is this ~/Dev/osgephemeris/osgEphemeris make all GNUmakefile:1: /makedefs: No such file or directory GNUmakefile:6: /makerules: No such file or directory make: *** No rule to make target '/makerules'. Stop. -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open Scene Graph/OSG) * OpenGL 2 * OpenGL 3 * OpenGL 4 * GLSL * OpenGL ES 1 * OpenGL ES 2 * OpenCL Digital Imaging * GIS * GPS * osgEarth * Terrain * Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded * Mobile * iPhone/iPad/iOS * Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgEphemeris build on Linux
Thanks Chris. I know someone has hacked it to work nice. I hope these people can share it :-) . maybe update the base code on the repo as well Nick On Thu, Feb 5, 2015 at 5:29 PM, Chris Hanson xe...@alphapixel.com wrote: I haven't actually used it in about 2 years. I switched to using osgEarth for most stuff now, and it includes its own sky, though it doesn't have the same featureset as osgEphemeris. On Thu, Feb 5, 2015 at 9:25 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Me again, on this topic. I hope noone will be mad for using this list for 3rd party software. Alberto, Chris, did you made it work? For some reason I am setting the skyDomeCenter to be the eye point and it doesnt work. Also, setMoveWithEyePoint seam to not have an effect. Any hints? Thanks again Nick On Thu, Feb 5, 2015 at 4:12 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Chris, Alberto. Alberto, yeah, that did the build. Thanks again Nick On Thu, Feb 5, 2015 at 4:08 PM, Chris Hanson xe...@alphapixel.com wrote: Seems like we rebuilt it a while ago and it needed a bunch of hacking but I can't recall what the deal was. On Thu, Feb 5, 2015 at 7:33 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi All, this is not for this list, but I know some of you are using it. I downloaded the source from https://code.google.com/p/osgephemeris/source/checkout, run CMake (on Linux) and run make. or make all. It seam it is not set to be built on Linux even though CMake generated the Makefiles. What I am missing Thanks a bunch as allways p.s. the output is this ~/Dev/osgephemeris/osgEphemeris make all GNUmakefile:1: /makedefs: No such file or directory GNUmakefile:6: /makerules: No such file or directory make: *** No rule to make target '/makerules'. Stop. -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open Scene Graph/OSG) * OpenGL 2 * OpenGL 3 * OpenGL 4 * GLSL * OpenGL ES 1 * OpenGL ES 2 * OpenCL Digital Imaging * GIS * GPS * osgEarth * Terrain * Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded * Mobile * iPhone/iPad/iOS * Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open Scene Graph/OSG) * OpenGL 2 * OpenGL 3 * OpenGL 4 * GLSL * OpenGL ES 1 * OpenGL ES 2 * OpenCL Digital Imaging * GIS * GPS * osgEarth * Terrain * Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded * Mobile * iPhone/iPad/iOS * Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgEphemeris build on Linux
Me again, on this topic. I hope noone will be mad for using this list for 3rd party software. Alberto, Chris, did you made it work? For some reason I am setting the skyDomeCenter to be the eye point and it doesnt work. Also, setMoveWithEyePoint seam to not have an effect. Any hints? Thanks again Nick On Thu, Feb 5, 2015 at 4:12 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Chris, Alberto. Alberto, yeah, that did the build. Thanks again Nick On Thu, Feb 5, 2015 at 4:08 PM, Chris Hanson xe...@alphapixel.com wrote: Seems like we rebuilt it a while ago and it needed a bunch of hacking but I can't recall what the deal was. On Thu, Feb 5, 2015 at 7:33 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi All, this is not for this list, but I know some of you are using it. I downloaded the source from https://code.google.com/p/osgephemeris/source/checkout, run CMake (on Linux) and run make. or make all. It seam it is not set to be built on Linux even though CMake generated the Makefiles. What I am missing Thanks a bunch as allways p.s. the output is this ~/Dev/osgephemeris/osgEphemeris make all GNUmakefile:1: /makedefs: No such file or directory GNUmakefile:6: /makerules: No such file or directory make: *** No rule to make target '/makerules'. Stop. -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open Scene Graph/OSG) * OpenGL 2 * OpenGL 3 * OpenGL 4 * GLSL * OpenGL ES 1 * OpenGL ES 2 * OpenCL Digital Imaging * GIS * GPS * osgEarth * Terrain * Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded * Mobile * iPhone/iPad/iOS * Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] StandardShadowMap and Fog
Hi Community, I am seeing in the default fragment shader (snippet bellow) that a fog is used into account but for some reason I can not make it work. Any hints for the Fog settings? Thanks a lot #if FRAGMENT_SHADERS_ONLY _mainFragmentShader = new osg::Shader( osg::Shader::FRAGMENT, // following expressions are auto modified - do not change them: \n // gl_TexCoord[0] 0 - can be subsituted with other index \n \n float DynamicShadow( ); \n \n uniform sampler2D baseTexture; \n \n void main(void) \n { \n vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n // // Add ambient from Light of index = 0\n // colorAmbientEmissive += gl_FrontLightProduct[0].ambient; \n vec4 color = texture2D( baseTexture, gl_TexCoord[0].xy ); \n color *= mix( colorAmbientEmissive, gl_Color, DynamicShadow() ); \n #if DISPLAY_SHADOW_TEXEL_TO_PIXEL_ERROR color.xy = abs( dFdy( gl_TexCoord[1].xy / gl_TexCoord[1].w ) )* 1024.0; \n color.z = color.y; \n color.x = color.z; \n color.y = color.z; \n color.a = 1.0; \n #endif //float fog = clamp((gl_Fog.end - gl_FogFragCoord)*gl_Fog.scale, 0.,1.);\n //color.rgb = mix( gl_Fog.color.rgb, color.rgb, fog ); \n gl_FragColor = color; \n } \n ); -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] StandardShadowMap and Fog
never mind .. blind me.. It is commented out .. Please ignore Nick On Sun, Feb 1, 2015 at 3:21 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I am seeing in the default fragment shader (snippet bellow) that a fog is used into account but for some reason I can not make it work. Any hints for the Fog settings? Thanks a lot #if FRAGMENT_SHADERS_ONLY _mainFragmentShader = new osg::Shader( osg::Shader::FRAGMENT, // following expressions are auto modified - do not change them: \n // gl_TexCoord[0] 0 - can be subsituted with other index \n \n float DynamicShadow( ); \n \n uniform sampler2D baseTexture; \n \n void main(void) \n { \n vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n // // Add ambient from Light of index = 0\n // colorAmbientEmissive += gl_FrontLightProduct[0].ambient; \n vec4 color = texture2D( baseTexture, gl_TexCoord[0].xy ); \n color *= mix( colorAmbientEmissive, gl_Color, DynamicShadow() ); \n #if DISPLAY_SHADOW_TEXEL_TO_PIXEL_ERROR color.xy = abs( dFdy( gl_TexCoord[1].xy / gl_TexCoord[1].w ) )* 1024.0; \n color.z = color.y; \n color.x = color.z; \n color.y = color.z; \n color.a = 1.0; \n #endif //float fog = clamp((gl_Fog.end - gl_FogFragCoord)*gl_Fog.scale, 0.,1.);\n //color.rgb = mix( gl_Fog.color.rgb, color.rgb, fog ); \n gl_FragColor = color; \n } \n ); -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] shader composition
Thanks Robert, Robert, I will wait for the new code then. Nick On Thu, Jan 29, 2015 at 11:54 AM, Robert Milharcic robert.milhar...@ib-caddy.si wrote: On 29.1.2015 0:23, Trajce Nikolov NICK wrote: I read the shader composition code and the used classes - which are really without any documentation:-). Can someone give a fast intro into this, the sample for example? Thanks a bunch as always Hi Nick, I once did some experimental coding on shader composition. The idea was to emulte all the FFP attributes with shaders and possibly extend the composition with custom shaders. Although the code is working and it produces optimal shaders with zero branching or defines, I have never had time to polish it up and send it for a review. I could post the sample I used for testing, if you are interested. The bad news is that it requires some osg core modifications to work properly. I can send those, too. Robert Milharcic ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] shader composition
Hi Community, I read the shader composition code and the used classes - which are really without any documentation :-). Can someone give a fast intro into this, the sample for example? Thanks a bunch as always Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to Preserve FBX baked in textures when running running hardware skinning
Hi Chris, osg::ref_ptrosg::Texture2D texture = model-GetEmbeddeFBXTexture(); I think you have to write NodeVisitor that will traverse your model and extract the Texture from the StateSet. But you can also work with the texture that is mapped in your FBX model. I didn't followed your conversation with Robert on this topic, but maybe you just put in your shader the texture unit to which the texture is assigned? On Tue, Jan 27, 2015 at 1:50 PM, Chris Hidden ch...@erghis.com wrote: Ok so now back to the original intent with this question. So I can now attach a texture to my hand model with a vertex and fragment shader, which is great! I load the texture via its file path and send it along to the shaders. However I was hoping to find a way to do this in a different workflow. I have been and would like to continue to do a fair amount of the texture work in 3D Studio Max. So when I export an FBX model and load it into the scene graph it under normal circumstances retains its embedded texture and displays accordingly. Is there a way I can access these textures for the FBX model, so that I could in some way load the texture directly from the model. So if I have osg::ref_ptrosg::Node model = osgDB::readNodeFile(myModel.fbx); Then I would like to acheive this somehow (Pseudo Code): osg::ref_ptrosg::Texture2D texture = model-GetEmbeddeFBXTexture(); That way we could have a nice system that will take whatever our designers or modelers texture the model with directly through the code instead of having to manually switch in the code later on. Im sure this can be done one way or another. Is there a somewhat simple approach to this? Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62492#62492 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] strange behaviour on dynamic_cast on Mac (QtCreator)
Hi Community, I have this case: osg::ref_ptrosg::Node node = new osg::Geode; osg::Group* group = dynamic_castosg::Group*(node.get()); osg::Geode* geode = dynamic_casyosg::Geode*(node.get()) what is strange is that both are valid, but it should fail on the Group case. This was testted on Linux and Windows, and it works as it should, only strange on Mac Thanks for any input as always Cheers, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg 3.3.3 fails to load dds texture on Mac
Hi Community, anyone experience this? It loads with 3.3.1 and just by upgrading to 3.3.3 it fails. Here is the setup: Macbook pro retina, Mid 2012 NIVIDIA GeForce GT 650M 1024 Processor 2.3 GHz intel Core i7 Memory 8GB Software Yosemite macosx 10.10 QtCreator To recreate you can use osgviewer and any dds texture. Thanks a bunch for any hint/finding Cheers, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] strange behaviour on dynamic_cast on Mac (QtCreator)
Hi Mattias, yes, you are right. My bad. Geode is indeed a Group now. Thanks a lot Nick On Sun, Jan 18, 2015 at 10:33 AM, Mattias Helsing helsin...@gmail.com wrote: Hi Nick, is it possible that you have different versions of the osg source on your computers. In the trunk a Geode is-a Group since a couple of months or so. Can you verify this ? cheers Mattias On Sun, Jan 18, 2015 at 9:15 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I have this case: osg::ref_ptrosg::Node node = new osg::Geode; osg::Group* group = dynamic_castosg::Group*(node.get()); osg::Geode* geode = dynamic_casyosg::Geode*(node.get()) what is strange is that both are valid, but it should fail on the Group case. This was testted on Linux and Windows, and it works as it should, only strange on Mac Thanks for any input as always Cheers, Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using pbuffer as a texture.
Hi Nicolas, yes it is possible. Have a look at osgprerender example. You have to attach the texture to the camera. Look for camera-attach(osg::Camera::COLOR_BUFFER, texture,. Nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera default stateset ???
yes That is what I was look for !! Thanks a bunch Robert! Nick On Mon, Jan 12, 2015 at 12:28 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 12 January 2015 at 09:54, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: yes, I know that, but thanks. I was looking for some setDefaults or something similar. I can not clearly recall the change you made in the later osg to explicitly set some defaults so I was shooting in the fog hoping someone will remember it better. What is appropriate totally depends upon the context and needs. In osg::StateSet there is a setGlobalDefaults() method that gets set for the master Camera or a View(er) so you don't need to set this. setGlobalDefaults() sets some OpenGL state that is off by default such as depth test. A default constructed osg::Camera doesn't have an osg::StateSet assigned though, so if you create our own osg::Camera and assign this to the View(er) then you'll need to call StateSet::setGlobalDefaults(). Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera default stateset ???
Hi Robert, yes, I know that, but thanks. I was looking for some setDefaults or something similar. I can not clearly recall the change you made in the later osg to explicitly set some defaults so I was shooting in the fog hoping someone will remember it better. Thanks again Nick On Mon, Jan 12, 2015 at 10:04 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, osg::Camera is just an Node so to set the state that you want to get inherited to everything below it you simple do: osg::StateSet* ss = camera-getOrCreateStateSet(); ss-set*(); Robert. On 11 January 2015 at 20:48, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I remember there was a change in the later OSG for calling explicitlly the setting of some defaults for the Camera (not sure though) stateset?? or something like that? If you know what I mean can you point me to the right thing? I tried to find it in the archive with no luck Thanks a bunch as always Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Camera default stateset ???
Hi Community, I remember there was a change in the later OSG for calling explicitlly the setting of some defaults for the Camera (not sure though) stateset?? or something like that? If you know what I mean can you point me to the right thing? I tried to find it in the archive with no luck Thanks a bunch as always Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Store parent matrix inside of child
Hi Drake, just guessing by the subject of the email. If you want to store matrix to some node (your child node) you can use the userdata of the node and RefMatrix. Something like osg::Matrix parentMatrix; child-setUserData(new osg::RefMatrix(parentMatrix)); then dynamic_cast the userData to RefMatrix when you need it Again, the hint is just by guessing. Robert is right, it is not clear what you are after Cheers, Nick On Mon, Jan 5, 2015 at 8:50 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Drake, I can't personally help you, I know nothing about gizmo. You don't really explain what you are trying to do either, you provide code, which is a specific attempt at a solution to a problem, not a definition of the problem which makes it doubly impossible to guess what you need to do. I'd suggest when explaining stuff you don't provide code, but a high level explanation of how you want to manage you scene and how gizmo affects this. Robert. On 5 January 2015 at 18:02, Drake Aldwyn azrai...@gmail.com wrote: Well, Ill try describe what I'm trying to do. I have scene where I put object with this code: Code: std::string path=models\\; std::string path2=textures\\; osg::Node* scene = osgDB::readNodeFile(path+n); scene-setName(scene); osg::BlendFunc*blendFunc = new osg::BlendFunc(); osg::BlendColor*blendColor= new osg::BlendColor(osg::Vec4(1, 1, 1, 0.5 )); blendFunc-setSource(osg::BlendFunc::CONSTANT_ALPHA); blendFunc-setDestination(osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA); scene-getOrCreateStateSet()-setAttributeAndModes( new osg::BlendFunc ); scene-getOrCreateStateSet()-setRenderingHint( osg::StateSet:: TRANSPARENT_BIN ); osg::StateSet* pStateSet = scene-getOrCreateStateSet(); pStateSet-setMode( GL_LIGHTING, osg::StateAttribute::OFF ); osg::Texture2D* pTex = new osg::Texture2D; osg::Image* pImage = osgDB::readImageFile(path2+t); pTex-setImage( pImage ); pStateSet-setTextureAttributeAndModes( 0, pTex, osg::StateAttribute::ON ); osg::Material* material = new osg::Material; material-setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(1.0f,1.0f,1.0f,1.0f)); material-setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(1.0f,1.0f,1.0f,1.0f)); material-setAlpha(osg::Material::FRONT_AND_BACK, 0.5); pStateSet-setAttribute(material,osg::StateAttribute::ON); pStateSet-setMode(GL_BLEND, true); osg::BlendFunc* blend = new osg::BlendFunc; blend-setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_DST_ALPHA); pStateSet-setAttributeAndModes(blend, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); osg::ref_ptrosg::Switch sw = new osg::Switch; sw-setName(Switch); sw-addChild(scene,true); sw-addChild(getLineCube(pos,11),false); osg::ref_ptrAgentShape myPos = new AgentShape; myPos-setPosition(pos); myPos-addChild(sw); myPos-setName(AgentShape); osg::ref_ptrosg::Geode geodeGizmo = new osg::Geode; osg::ref_ptrGizmoDrawable gizmo = new GizmoDrawable; gizmo-setName(gizmo); gizmo-setGizmoMode( GizmoDrawable:: NO_GIZMO); geodeGizmo-addDrawable( gizmo.get() ); geodeGizmo-setCullingActive( false ); myPos-addChild(geodeGizmo); return myPos; } I use my own class inherited from PAT, because I need my own values. This PAT contains gizmo from lib gizmo and osggizmo examples. When i put matrix transform of my osg::Node* scene, I can move object but it doesn't move PAT actually, so I trying understand how could I move whole PAT with this gizmo.[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62229#62229 ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Sim/Frame Time/Stamp in shader
Hi Conan, yes, there is. Here is the grep of osg_ find . -name '*.cpp' -exec grep osg_ {} + ./CubeMapGenerator.cpp:void CubeMapGenerator::generateMap(bool use_osg_system) ./CubeMapGenerator.cpp:if (use_osg_system) { ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_FrameNumber,osg::Uniform::UNSIGNED_INT); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_FrameTime,osg::Uniform::FLOAT); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_DeltaFrameTime,osg::Uniform::FLOAT); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_SimulationTime,osg::Uniform::FLOAT); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_DeltaSimulationTime,osg::Uniform::FLOAT); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_ViewMatrix,osg::Uniform::FLOAT_MAT4); ./SceneView.cpp:osg::Uniform* uniform = _localStateSet-getOrCreateUniform(osg_ViewMatrixInverse,osg::Uniform::FLOAT_MAT4); On Thu, Jan 1, 2015 at 6:08 PM, Conan Doyle o...@celticblues.com wrote: Hi, Does OSG have a GLSL uniform for current sim time similar the osg_* uniforms (osg_color etc.)? CD ... Thank you! Cheers, Conan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62214#62214 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Festive Greetings!
Same to you Robert ! And thanks for the support for this year !!! Cheers, Nick On Wed, Dec 24, 2014 at 1:09 PM, Robert Osfield robert.osfi...@gmail.com wrote: Merry Christmas One and All, I've just wrapped up my work for the year and will now join my family to celebrate Christmas and then New Year. May you all have a great end of year and happy prosperous 2015 ;-) Robert ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Yaw pitch and roll or xyz conversion to and from Quaternion
Hi Jason, I had to apply -90 (in degrees) to the pitch to get the correct results after getHPRFromQuat(). Also createMatrix is expecting the input in degrees. Maybe this will help Nick On Fri, Dec 19, 2014 at 3:10 AM, Jason Anderssen janders...@exactal.com wrote: Hi NICK, Thank you for your reply. What do you think I maybe doing wrong with the following code : (NOTE: getHPRfromQuat is cut and paste from link, and the createMatrix is cut and paste from your reply. I was basically hoping that q2 == q after the conversion to and from osg::Quat q(-0.7071067811865475, 0.0, 0.0, 0.7071067811865476); osg::Vec3d hpr = getHPRfromQuat(q); osg::Matrixd m = createMatrix(0.0, 0.0, 0.0, hpr.x(), hpr.y(), hpr.z()); osg::Quat q2; q2.set(m); Any assistance is very much appreciated. Cheers Jason Anderssen *Jason Anderssen*, Senior Product Engineer Exactal -- Precision Software [image: Exactal Pty Ltd] http://www.exactal.com/ Level 2, Toowong Tower, 9 Sherwood Road, Toowong QLD 4066, Australia P: +61 7 3870 2666 | F: +61 7 3870 5266 | janders...@exactal.com | www.exactal.com[image: Download CostX Viewer] http://www.exactal.com/viewer/download.php[image: Send a CostX Invitation] http://www.exactal.com/viewer/invite.php -- *From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of Trajce Nikolov NICK [trajce.nikolov.n...@gmail.com] *Sent:* Thursday, 18 December 2014 6:14 PM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] Yaw pitch and roll or xyz conversion to and from Quaternion Hi Jason, here you have YPR from osg::Quat (look at the snippets) http://forum.openscenegraph.org/viewtopic.php?t=548 As for the other way it is easy, you create the Matrix and get the rotate Quat, (return matrix.getRotate()), something like: osg::Matrixd Utils::createMatrix(double x, double y, double z, double h, double p, double r) { osg::Matrixd mxR; mxR.makeRotate(osg::DegreesToRadians(r),osg::Vec3(0,1,0)); osg::Matrixd mxP; mxP.makeRotate(osg::DegreesToRadians(p),osg::Vec3(1,0,0)); osg::Matrixd mxH; mxH.makeRotate(osg::DegreesToRadians(h),osg::Vec3(0,0,1)); osg::Matrixd mxT; mxT.makeTranslate(osg::Vec3(x,y,z)); return (mxP*mxH*mxT*mxR); } On Thu, Dec 18, 2014 at 12:03 AM, Jason Anderssen janders...@exactal.com wrote: Hi Chris, Thank you for you reply. I had a look at those, maybe I can get it to work with them, but I really just want a simple 3 values for Yaw Pitch and Roll, from which I can re-create the exactly same Quat or Matrix. I will also clarify, I don't care about translation or scale etc, and the quaternion I am using is of course only a rotation anyway. So basically I want the following type of code : getYPR(float yaw, float pitch, float roll); Quaternion::fromYPR(yaw, pitch, roll); Cheers Jason Anderssen From: Chris Hanson xe...@alphapixel.com Reply-To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Date: Wed, 17 Dec 2014 15:47:57 -0700 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Yaw pitch and roll or xyz conversion to and from Quaternion Just wondering if in OSG there is anywhere I can extract either Yaw pitch and roll / or XYZ eular angles, too and from either a matrix or a quaternion? The void http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01593.html#a306a73ea16dfe10406725cefb3867dfa get http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html#a341e0295def3df6e07a014a1ff8195b4 (Matrixd http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html matrix) const method lets you convert a Quat to a 4x4 Matrix. void http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01593.html#a306a73ea16dfe10406725cefb3867dfa decompose http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html#a3aad163d793a9d5af248e42fd2e94dea (osg::Vec3d http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00972.html translation, osg::Quat http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html rotation, osg::Vec3d http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00972.html scale http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html#a9a9ad7cd3f007df5f559e10d471f1981 , osg::Quat http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html so) constdecompose the matrix into translation, rotation, scale and scale orientation. Will extract the trans, rot and scale components out of the matrix. Is that what you want? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open
Re: [osg-users] Yaw pitch and roll or xyz conversion to and from Quaternion
Hi Jason, here you have YPR from osg::Quat (look at the snippets) http://forum.openscenegraph.org/viewtopic.php?t=548 As for the other way it is easy, you create the Matrix and get the rotate Quat, (return matrix.getRotate()), something like: osg::Matrixd Utils::createMatrix(double x, double y, double z, double h, double p, double r) { osg::Matrixd mxR; mxR.makeRotate(osg::DegreesToRadians(r),osg::Vec3(0,1,0)); osg::Matrixd mxP; mxP.makeRotate(osg::DegreesToRadians(p),osg::Vec3(1,0,0)); osg::Matrixd mxH; mxH.makeRotate(osg::DegreesToRadians(h),osg::Vec3(0,0,1)); osg::Matrixd mxT; mxT.makeTranslate(osg::Vec3(x,y,z)); return (mxP*mxH*mxT*mxR); } On Thu, Dec 18, 2014 at 12:03 AM, Jason Anderssen janders...@exactal.com wrote: Hi Chris, Thank you for you reply. I had a look at those, maybe I can get it to work with them, but I really just want a simple 3 values for Yaw Pitch and Roll, from which I can re-create the exactly same Quat or Matrix. I will also clarify, I don't care about translation or scale etc, and the quaternion I am using is of course only a rotation anyway. So basically I want the following type of code : getYPR(float yaw, float pitch, float roll); Quaternion::fromYPR(yaw, pitch, roll); Cheers Jason Anderssen From: Chris Hanson xe...@alphapixel.com Reply-To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Date: Wed, 17 Dec 2014 15:47:57 -0700 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Yaw pitch and roll or xyz conversion to and from Quaternion Just wondering if in OSG there is anywhere I can extract either Yaw pitch and roll / or XYZ eular angles, too and from either a matrix or a quaternion? The void http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01593.html#a306a73ea16dfe10406725cefb3867dfa get http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html#a341e0295def3df6e07a014a1ff8195b4 (Matrixd http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html matrix) const method lets you convert a Quat to a 4x4 Matrix. void http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01593.html#a306a73ea16dfe10406725cefb3867dfa decompose http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html#a3aad163d793a9d5af248e42fd2e94dea (osg::Vec3d http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00972.html translation, osg::Quat http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html rotation, osg::Vec3d http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00972.html scale http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00489.html#a9a9ad7cd3f007df5f559e10d471f1981 , osg::Quat http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00648.html so) constdecompose the matrix into translation, rotation, scale and scale orientation. Will extract the trans, rot and scale components out of the matrix. Is that what you want? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training * Consulting * Contracting 3D * Scene Graphs (Open Scene Graph/OSG) * OpenGL 2 * OpenGL 3 * OpenGL 4 * GLSL * OpenGL ES 1 * OpenGL ES 2 * OpenCL Digital Imaging * GIS * GPS * osgEarth * Terrain * Telemetry * Cryptography * Digital Audio * LIDAR * Kinect * Embedded * Mobile * iPhone/iPad/iOS * Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Internet Email Confidentiality Footer: This email and any files transmitted with it contain privileged/confidential information intended for the addressee. Neither the confidentiality of nor any privilege in the email is waived, lost or destroyed by reason that it has been transmitted other than to the addressee. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Replace pure OpenGL method by OSG
Hi, have a look at the osggeometry example Nick On Fri, Dec 12, 2014 at 3:42 PM, Marcin Kolny marcin.ko...@gmail.com wrote: Hi, I've got following code: Code: glMatrixMode (GL_PROJECTION); glLoadIdentity (); GLfloat verts[] = { -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f }; GLfloat texcoords[] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f }; glEnable (GL_TEXTURE_2D); glBindTexture (GL_TEXTURE_2D, texture); glClientActiveTexture (GL_TEXTURE0); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState (GL_TEXTURE_COORD_ARRAY); glVertexPointer (2, GL_FLOAT, 0, verts); glTexCoordPointer (2, GL_FLOAT, 0, texcoords); glDrawArrays (GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); glEnableClientState(GL_COLOR_ARRAY); float line_vertex [] = { -1,-1, 1,1, }; float line_color[] = { 1,0,0, 1,0,0, }; glVertexPointer(2, GL_FLOAT, 0, line_vertex); glColorPointer(3, GL_FLOAT, 0, line_color); glDrawArrays(GL_LINES, 0, 2); //draw_user_function(); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); And I'd like to use OSG instead. But unfortunately, I've no idea, how to do it. Could somebody give me an advice? Thanks in advance Thank you! Cheers, M.K. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62043#62043 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lagging between main camera MV and prerender camera
Hi Daniel, I faced the same problem http://forum.openscenegraph.org/viewtopic.php?t=14354 How I fixed and hints from Robert. Hope it helps Nick On Fri, Dec 12, 2014 at 4:08 PM, Daniel Schmid daniel.sch...@swiss-simtec.ch wrote: Hi all Trust me, I searched the forum for a hint but couldn't find stuff that could point me into a solution... To understand the situation, please have a look at the screenshot. I have tracks from a vehicle that are prerendered into a texture, and then blended with underground during the main shader. Everything works fine and I'm happy with the visual result. But there is one problem... As soon as I move (rotate) my main camera, the track texture starts to lag with the underground, it looks like if the modelview matrix are nomore in sync. Technical details: The model view and projection matrices for the prerender camera are calculated and passed into a uniform : Code: ... osg::Matrix MVP = m_Camera-getViewMatrix() * m_Camera-getProjectionMatrix(); osg::Matrix MVPT = l_MainCamera-getInverseViewMatrix() * MVP * osg::Matrix::translate(1.0,1.0,1.0) * osg::Matrix::scale(0.5,0.5,0.5); m_TextureMatrix = MVPT; m_Camera-accept(*a_cv); ... The uniform with the textureMatrix is added to the root scene nodes stateset. In the shader, I calculate the TextureMatrix: Code: vec4 ecPos = gl_ModelViewMatrix * gl_Vertex; TexCoordTracksmap = tracksmapTextureMatrix * ecPos; What is the reason for the lagging? What do I have to consider? By the way I use ViewDependentShadowMap, and it also uses prerender camera and they don't produce lagging shadow, so there has to be a solution. Can anybody help?[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62044#62044 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] moving a vertex of a Geometry
Hi Gianni, years ago whan I was working on a 3D editor I faced similar challenge. I solved it with selection buffer, where I had two representation of the model - one for fast rendering, when you obviously don't pick or manipulate, so your model with osg::PrimitiveSet::POINTS will represent this, and other for picking/editing - here a single vertex was a separate node and along with the selection buffer you can put id on each single vertex. Maybe there are some better ideas, but the approach I took worked very well. Just thoughts Nick On Wed, Dec 3, 2014 at 1:41 PM, Gianni Ambrosio g.ambrosio+...@gmail.com wrote: Hi All, I have a surface where a user can pick points. As suggested I used a Geode with Geometry built with osg::PrimitiveSet::POINTS and verteices. Then I used PointSprite to show an image on each point (but I think this is not really important). Now I need to drag points with the mouse. First of all I have to handle the mouse move event to understand on which point the mouse is over. And now the problem. Given the mouse is over one of the previously picked points, how can I get which is the exact point of the Geometry from a osgUtil::PolytopeIntersector? The Intersection object contains a nodePath that at least refers to the Geometry node, not the single vertex/point. So I guess I have to loop over the actual picked points coordinates (i.e. geometry-getVertexArray()) and calculate the distance from the intersection.localIntersectionPoint. Is that right or is there a better way to implement it? Cheers, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61962#61962 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi Community, me again on this. I have it working, however, it looks really bad when using large coordinates (when placed on UTM or Geocentric). The model is somewhat distorted due to precission issues. I know how to avoid this, like working with double matrices, but when I pass double matrix on the vertex shader it kills the performance - from 60Fps to ~1 fps. Bellow is the vertex shader. Any hints? Thanks a bunch as always #version 150 compatibility uniform mat4 osg_ModelViewProjectionMatrix; uniform mat3 osg_NormalMatrix; uniform vec3 lightDirection; in vec3 vPosition; in vec3 vNormal; in vec2 vTexCoord; in mat4 vInstanceModelMatrix; smooth out vec2 texCoord; smooth out vec3 normal; smooth out vec3 lightDir; void main() { gl_Position = /*osg_ModelViewProjectionMatrix*/ gl_ModelViewProjectionMatrix * vInstanceModelMatrix * vec4(vPosition, 1.0); texCoord = vTexCoord; mat3 instanceNormalMatrix = mat3(vInstanceModelMatrix[0][0], vInstanceModelMatrix[0][1], vInstanceModelMatrix[0][2], vInstanceModelMatrix[1][0], vInstanceModelMatrix[1][1], vInstanceModelMatrix[1][2], vInstanceModelMatrix[2][0], vInstanceModelMatrix[2][1], vInstanceModelMatrix[2][2]); normal = osg_NormalMatrix * instanceNormalMatrix * vNormal; lightDir = lightDirection; } On Tue, Nov 25, 2014 at 12:06 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi All, On 24 November 2014 at 09:28, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: The example I was looking for was in the submissions, called: [osg-submissions] New example : culling and LODing performed on GPU side Unfortunately Robert didn't approve or merge the nescessary changes. Maybe it went unnoticed. I am still progressing through the submissions backlog and am delighted to say that this wee gem of an example is now checked into svn/trunk - look for osggpucull. I haven't had a chance to spend the time understanding it yet, but the code is there. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Thanks Sebastian.I could of thought of this. Let me give it a shot. Thanks again! Nick On Mon, Dec 1, 2014 at 9:26 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, One way to improve this is to place your root somewhere near the center of your instanced geometry and subtract the center from your instances positions. This way the coordinates to be multiplied stay small in relation (as the big precision loss due to View*Model is done on the CPU side (during cull) instead of multiplying big coordinates one the GPU with the inverse. So decorate your CustomGeometry subgraph with a transform and modify your instances position accordingly. Hi Community, me again on this. I have it working, however, it looks really bad when using large coordinates (when placed on UTM or Geocentric). The model is somewhat distorted due to precission issues. I know how to avoid this, like working with double matrices, but when I pass double matrix on the vertex shader it kills the performance - from 60Fps to ~1 fps. Bellow is the vertex shader. Any hints? Thanks a bunch as always #version 150 compatibility uniform mat4 osg_ModelViewProjectionMatrix; uniform mat3 osg_NormalMatrix; uniform vec3 lightDirection; in vec3 vPosition; in vec3 vNormal; in vec2 vTexCoord; in mat4 vInstanceModelMatrix; smooth out vec2 texCoord; smooth out vec3 normal; smooth out vec3 lightDir; void main() { gl_Position = /*osg_ModelViewProjectionMatrix*/ gl_ModelViewProjectionMatrix * vInstanceModelMatrix * vec4(vPosition, 1.0); texCoord = vTexCoord; mat3 instanceNormalMatrix = mat3(vInstanceModelMatrix[0][0], vInstanceModelMatrix[0][1], vInstanceModelMatrix[0][2], vInstanceModelMatrix[1][0], vInstanceModelMatrix[1][1], vInstanceModelMatrix[1][2], vInstanceModelMatrix[2][0], vInstanceModelMatrix[2][1], vInstanceModelMatrix[2][2]); normal = osg_NormalMatrix * instanceNormalMatrix * vNormal; lightDir = lightDirection; } On Tue, Nov 25, 2014 at 12:06 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi All, On 24 November 2014 at 09:28, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: The example I was looking for was in the submissions, called: [osg-submissions] New example : culling and LODing performed on GPU side Unfortunately Robert didn't approve or merge the nescessary changes. Maybe it went unnoticed. I am still progressing through the submissions backlog and am delighted to say that this wee gem of an example is now checked into svn/trunk - look for osggpucull. I haven't had a chance to spend the time understanding it yet, but the code is there. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Yeah, work well now. Thanks !!! Nick On Mon, Dec 1, 2014 at 9:45 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Sebastian.I could of thought of this. Let me give it a shot. Thanks again! Nick On Mon, Dec 1, 2014 at 9:26 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, One way to improve this is to place your root somewhere near the center of your instanced geometry and subtract the center from your instances positions. This way the coordinates to be multiplied stay small in relation (as the big precision loss due to View*Model is done on the CPU side (during cull) instead of multiplying big coordinates one the GPU with the inverse. So decorate your CustomGeometry subgraph with a transform and modify your instances position accordingly. Hi Community, me again on this. I have it working, however, it looks really bad when using large coordinates (when placed on UTM or Geocentric). The model is somewhat distorted due to precission issues. I know how to avoid this, like working with double matrices, but when I pass double matrix on the vertex shader it kills the performance - from 60Fps to ~1 fps. Bellow is the vertex shader. Any hints? Thanks a bunch as always #version 150 compatibility uniform mat4 osg_ModelViewProjectionMatrix; uniform mat3 osg_NormalMatrix; uniform vec3 lightDirection; in vec3 vPosition; in vec3 vNormal; in vec2 vTexCoord; in mat4 vInstanceModelMatrix; smooth out vec2 texCoord; smooth out vec3 normal; smooth out vec3 lightDir; void main() { gl_Position = /*osg_ModelViewProjectionMatrix*/ gl_ModelViewProjectionMatrix * vInstanceModelMatrix * vec4(vPosition, 1.0); texCoord = vTexCoord; mat3 instanceNormalMatrix = mat3(vInstanceModelMatrix[0][0], vInstanceModelMatrix[0][1], vInstanceModelMatrix[0][2], vInstanceModelMatrix[1][0], vInstanceModelMatrix[1][1], vInstanceModelMatrix[1][2], vInstanceModelMatrix[2][0], vInstanceModelMatrix[2][1], vInstanceModelMatrix[2][2]); normal = osg_NormalMatrix * instanceNormalMatrix * vNormal; lightDir = lightDirection; } On Tue, Nov 25, 2014 at 12:06 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi All, On 24 November 2014 at 09:28, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: The example I was looking for was in the submissions, called: [osg-submissions] New example : culling and LODing performed on GPU side Unfortunately Robert didn't approve or merge the nescessary changes. Maybe it went unnoticed. I am still progressing through the submissions backlog and am delighted to say that this wee gem of an example is now checked into svn/trunk - look for osggpucull. I haven't had a chance to spend the time understanding it yet, but the code is there. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] StatsFunctor not taking into account number of indices
Hi Community, Robert, I debug the code where I have my own drawable down to -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] StatsFunctor not taking into account number of indices
it sent the email too fast The code debug down to void Statistics::drawElements(GLenum mode,GLsizei count,const GLuint*) { PrimitivePair prim = _primitiveCount[mode]; ++prim.first; prim.second+=count; _primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count); } and it is not taking into account the number of instances. Any pointers what is needed to be modified? Thanks Nick On Tue, Nov 25, 2014 at 12:51 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, Robert, I debug the code where I have my own drawable down to -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] StatsFunctor not taking into account number of indices
also it has to be number of instances instead of indices Nick On Tue, Nov 25, 2014 at 12:52 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: it sent the email too fast The code debug down to void Statistics::drawElements(GLenum mode,GLsizei count,const GLuint*) { PrimitivePair prim = _primitiveCount[mode]; ++prim.first; prim.second+=count; _primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count); } and it is not taking into account the number of instances. Any pointers what is needed to be modified? Thanks Nick On Tue, Nov 25, 2014 at 12:51 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, Robert, I debug the code where I have my own drawable down to -- trajce nikolov nick -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
HI Sebastian, thanks for the reply. I also have vegetation generated on the GPU, works really fine - like 5mil trees on 60Hz. Now I want to try HW instancing for moving models - your NodeVisitor is good idea to have any geometry instantiable. What was your start point? Did you also try the code from the blog I found or you did it your self? For some reason the code on the blog is not working and I am struggling to try to fix it since it has really nice implementation and ideas I am learning now. Nick On Mon, Nov 24, 2014 at 10:28 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: And again: The example I was looking for was in the submissions, called: [osg-submissions] New example : culling and LODing performed on GPU side Unfortunately Robert didn't approve or merge the nescessary changes. Maybe it went unnoticed. Cheers Sebastian HI Trajce, I implemented HW Instancing using the UBO and texture approach using the osgforest example as a guide. The majority of the work in my project lied in developing a visitor making arbitrary geometry nodes instanceable. I also experimented with geometry shader based billboard instancing, which worked nice for trees etc. And I do remember some example featuring GPU culling and instancing, but I cannot find it in the mailing list right now Hi Community I found this blog http://3dcgtutorials.blogspot.de/2013/09/instancing-with-openscenegraph-part-ii.html and found it very interesting. Although the description is very well written the code samples seams incomplete and sort of outdated. Was to ask you if any of you have done some work with this and is willing to share hints, code snippets? Thanks a bunch as always, Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] drawImplementation not called on custom Drawables
Hi Community, again :-) what can be the reason for the drawImplementation to not be called? I have set setCullingActive(false) to not cull the node but still I am not hiting the call to this method. Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] drawImplementation not called on custom Drawables
I have attached a callback for this, but it is never called as well . Nick On Mon, Nov 24, 2014 at 12:06 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, I I think you will have to provide a valid intial bound in any case Hi Community, again :-) what can be the reason for the drawImplementation to not be called? I have set setCullingActive(false) to not cull the node but still I am not hiting the call to this method. Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi All, just for the case of someone else will need it, I was able to manage fix for the sample from the blog that do HW instancing with VertexAttribs and VertexAttribDivisor. If any interested, please ping me. I will also send it to the author. Cheers, Nick On Mon, Nov 24, 2014 at 12:07 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Am 24.11.2014 11:38, schrieb Trajce Nikolov NICK: HI Sebastian, thanks for the reply. I also have vegetation generated on the GPU, works really fine - like 5mil trees on 60Hz. Now I want to try HW instancing for moving models - your NodeVisitor is good idea to have any geometry instantiable. What was your start point? Did you also try the code from the blog I found or you did it your self? For some reason the code on the blog is not working and I am struggling to try to fix it since it has really nice implementation and ideas I am learning now. I started with the osgforest example Nick On Mon, Nov 24, 2014 at 10:28 AM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: And again: The example I was looking for was in the submissions, called: [osg-submissions] New example : culling and LODing performed on GPU side Unfortunately Robert didn't approve or merge the nescessary changes. Maybe it went unnoticed. Cheers Sebastian HI Trajce, I implemented HW Instancing using the UBO and texture approach using the osgforest example as a guide. The majority of the work in my project lied in developing a visitor making arbitrary geometry nodes instanceable. I also experimented with geometry shader based billboard instancing, which worked nice for trees etc. And I do remember some example featuring GPU culling and instancing, but I cannot find it in the mailing list right now Hi Community I found this blog http://3dcgtutorials.blogspot.de/2013/09/instancing-with-openscenegraph-part-ii.html and found it very interesting. Although the description is very well written the code samples seams incomplete and sort of outdated. Was to ask you if any of you have done some work with this and is willing to share hints, code snippets? Thanks a bunch as always, Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] drawImplementation not called on custom Drawables
Hi, at the end it worked with overriding virtual osg::BoundingBox computeBoundingBox() const; the other one virtual osg::BoundingSphere computeBound() const; and attaching a callback for compute the bb is not working. Don't have time to investigate but it looks a small bug somewhere Nick On Mon, Nov 24, 2014 at 1:41 PM, Julien Valentin julienvalenti...@gmail.com wrote: Have you tried geom-setUseDisplayList(false) geom-setUseVertexBufferObject(true) ? Trajce Nikolov NICK wrote: I have attached a callback for this, but it is never called as well . Nick On Mon, Nov 24, 2014 at 12:06 PM, Sebastian Messerschmidt () wrote: Hi Nick, I I think you will have to provide a valid intial bound in any case Hi Community, again :-) what can be the reason for the drawImplementation to not be called? I have set setCullingActive(false) to not cull the node but still I am not hiting the call to this method. Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ) -- trajce nikolov nick -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61814#61814 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi Roman, this is exactly what I am trying to achieve. Sebastian's hint for writing a NodeVisitor to make any model instantiable is what I am trying to write just about this moment. Once I complete some working version I will post my code, no problem. Maybe Sebastian can provide some snips from his NodeVisitor as well ;-) Nick On Mon, Nov 24, 2014 at 1:43 PM, Roman Grigoriev grigor...@gosniias.ru wrote: Hi, Nick! Long time ago I tried to implement model with moving parts instancing. For forests it works OK but when you have many moving parts you have to once collect matrices and after send it to TBO to render. Also there are a lot of state switches in model. Another difficulty is model picking and also bounding box calculation. So I gave up. And if you implemented it now could you please drop a code to view it. Thank you! Cheers, Roman -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61815#61815 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi Roman, yeah, I thought of doing it that way. Still fighting with my NodeVisitor to convert any loaded model to instantiable DrawElements . Nick On Mon, Nov 24, 2014 at 4:05 PM, Roman Grigoriev grigor...@gosniias.ru wrote: Hi,Nick! Also for some speedup I've read that it's good to store matrices as position and quatertion, and resore ModelViewMatrix in vertex shader because vertex calcualtion is very fast on modern GPU, and scale is not aplicable to this calculations. Thank you! Cheers, Roman -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61823#61823 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Thanks Robert. Very cool ! Nick On Mon, Nov 24, 2014 at 4:07 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Guys, I have just checked osg::VertexAttribDivisor StateAttribute class that wraps up glVertexAttribDivisor. Assign this new StateAttribute to the subgraphs/geometry that you want to set the divisor on. This new class is checked into svn/trunk. I haven't yet written a test for the next class though... will need to do that soon, but others are welcome to jump and write one :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] converting arbitrary model to indexed triangle list
Hi Community, any hints for this one? I see there is osg::TriangleFunctor that extracts triangles from a osg::Geometry but this is not preserving the uv's and normals. Any hint is appreciated Thanks a bunch, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] converting arbitrary model to indexed triangle list
Yeah, there is osg::TriangleIndexedFunctor. Works well so nevermind :-) Nick On Mon, Nov 24, 2014 at 5:48 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, any hints for this one? I see there is osg::TriangleFunctor that extracts triangles from a osg::Geometry but this is not preserving the uv's and normals. Any hint is appreciated Thanks a bunch, Nick -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi All, I have it working based on the code from the mentioned blog. for 4K dynamicly updated objects (a fully 3D model) I am getting 160fps. I will try to put more thoughts on it how to optimize, perhaps cutting out the matrix usage and use vec3 and quats instead, and want to try with latest submission from Robert with the VertexAttribDisvisor StateAttribute now. Will ping you with the findings . Stay tuned :-). And thanks for the support so far Cheers, Nick On Mon, Nov 24, 2014 at 4:53 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Roman, yeah, I thought of doing it that way. Still fighting with my NodeVisitor to convert any loaded model to instantiable DrawElements . Nick On Mon, Nov 24, 2014 at 4:05 PM, Roman Grigoriev grigor...@gosniias.ru wrote: Hi,Nick! Also for some speedup I've read that it's good to store matrices as position and quatertion, and resore ModelViewMatrix in vertex shader because vertex calcualtion is very fast on modern GPU, and scale is not aplicable to this calculations. Thank you! Cheers, Roman -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61823#61823 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] hardware instancing with VertexAttribs and VertexAttribsDivisor
Hi Community I found this blog http://3dcgtutorials.blogspot.de/2013/09/instancing-with-openscenegraph-part-ii.html and found it very interesting. Although the description is very well written the code samples seams incomplete and sort of outdated. Was to ask you if any of you have done some work with this and is willing to share hints, code snippets? Thanks a bunch as always, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GeometryTechnique race condition crash
Hi Robert, I ve been following this thread from the beginning since I had issues with the database pager so I thought it might be related. I have different big datasets so I am going to give it a shot tomorrow and ping you with the findings Nick On Mon, Nov 10, 2014 at 5:12 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI All, On 7 November 2014 17:30, Robert Osfield robert.osfi...@gmail.com wrote: I have now written the basic code to move the management of the object cache to with the DatabasePager when the it's used in conjunction with object cache. I haven't yet tested it but have run out of week so will need to return to testing next week. If all goes well I'll check these changes in and look for wider testing. I have now done some testing on the new object cache handling in the DatabasePager and this has gone fine, but my tests only touched part of the possible range of usage models with using the database pager and the object cache so would appreciate testing out on the community. I have just checked my changes in. Could you check out svn/trunk and let me know how you get on. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] frequently modified osg::Image uploads
Hi Community, I have a case where I work with osg::Image on the CPU and uploading it to a osg::Texture object. However, it is terribly slow - the osg::Image is modified on each frame. Any hints techniques for this tip of task? Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Sebastian, it is TextureRectangle so NPOT is not an issue. Also, I am using the osg::Image for transfer of data from the CPU to the GPU, so it is not possible to have it all in the GPU. Thanks anyway though! Nick On Wed, Oct 29, 2014 at 12:10 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Trajce, Hi Community, I have a case where I work with osg::Image on the CPU and uploading it to a osg::Texture object. However, it is terribly slow - the osg::Image is modified on each frame. Any hints techniques for this tip of task? 1. Make sure it is not resized during upload (NPOT) 2. If possible try to keep it on the GPU. I.e. try to move your CPU-algorithm to the GPU. Cheers Sebastian Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Thans Robert, since I haven't used this before, is the assignment enough for this or I should make some setups etc. What I did I just ser _image-setPixelBufferObject( new osg::PixelBufferObject ) and seeing the same performance . poor . Thanks again Nick On Wed, Oct 29, 2014 at 1:02 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 29 October 2014 11:14, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: it is TextureRectangle so NPOT is not an issue. Also, I am using the osg::Image for transfer of data from the CPU to the GPU, so it is not possible to have it all in the GPU. Thanks anyway though! Assign an osg::PixelBufferObject to the osg::Image to assist with the data transfer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Bjorn, I am using the osg::Image just for storing some vector data in it and passing it to the shaders, so not retrieving from anywhere. Thanks anyway Nick On Wed, Oct 29, 2014 at 1:18 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi Nick, Make sure that it actually is the image transfer which is the culprit. In my case it was the image retrieval which was slowing down my osg webcam example program. So moving the image retrieval function to an own thread made my example go from 4 fps to ~3000 fps. Cheers, Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61456#61456 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] order of PreRender camera with respect to the main camera
Hi Robert, this is really good idea .. Haven't thought of Thanks again Nick On Mon, Oct 27, 2014 at 11:52 AM, Robert Osfield robert.osfi...@gmail.com wrote: HI Nick, If you Camera that is following the main camera requires the same view matrix then could you not simply set the Camera::ReferenceFrame to REALATVE_TF so that it inherits the view and projection matrix from above? Robert. On 25 October 2014 08:35, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Robert, below is my frame code, and this seam to fix it. But, just a question, shouldnt the main view matrix be updated by the camera manipulator prior to any other update (I have attached UpdateCallback to the pre render camera and these seam to be called before the main camera update which results in frame delay)? if (_viewer.valid()) { static bool firstFrame = true; if (firstFrame) { _viewer-frame(); firstFrame = false; } else { _viewer-advance(); _viewer-eventTraversal(); _viewer-updateTraversal(); if (_reflectionCamera.valid()) { _reflectionCamera-setViewMatrix(_viewer-getView(0)-getCamera()-getViewMatrix()); } _viewer-renderingTraversals(); } } This way it works, it gurantee the pre render camera has the updated view matrix With this update callback it is with delay class FollowMainCameraNodeCallback : public osg::NodeCallback { public: FollowMainCameraNodeCallback(osg::Camera* camera) : _camera(camera) { } virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osg::Camera* thisCamera = dynamic_castosg::Camera*(node); if (!thisCamera) return; thisCamera-setViewMatrix(_camera-getViewMatrix()); . _reflectionCamera-setUpdateCallback(new FollowMainCameraNodeCallback(_viewer-getView(0)-getCamera())); Nick On Fri, Oct 24, 2014 at 5:31 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: thanks Robert Nick On Fri, Oct 24, 2014 at 5:19 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, The update of the CameraManipulator happens at the end of VIewer::updateTraversal(). The default Viewer::frame() implementation() runs the event and then update traversal. Your own application can override any of the viewer.frame() or updateTraversal/eventTraversal() methods so if you want to take control and do things in a different from standard you can do. Robert. On 24 October 2014 16:13, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I am facing the same problem for long time and always have to hack it. I have prerender camera that has to follow the main camera. My pre-render camera is always a frame behind the main camera which is updated by a CameraManipulator. The update of the Pre-Render camera is done with UpdateCallback that simply copy the ViewMatrix of the main camera, but it seam that the main camera is updated afterwards. What is the order of these updates? I was expecting the main camera is updated from the CameraMainpulator and then everything else (including the Pre-Render cameras), but seam it is not the case? Any hints on this? Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] order of PreRender camera with respect to the main camera
Hi Robert, below is my frame code, and this seam to fix it. But, just a question, shouldnt the main view matrix be updated by the camera manipulator prior to any other update (I have attached UpdateCallback to the pre render camera and these seam to be called before the main camera update which results in frame delay)? if (_viewer.valid()) { static bool firstFrame = true; if (firstFrame) { _viewer-frame(); firstFrame = false; } else { _viewer-advance(); _viewer-eventTraversal(); _viewer-updateTraversal(); if (_reflectionCamera.valid()) { _reflectionCamera-setViewMatrix(_viewer-getView(0)-getCamera()-getViewMatrix()); } _viewer-renderingTraversals(); } } This way it works, it gurantee the pre render camera has the updated view matrix With this update callback it is with delay class FollowMainCameraNodeCallback : public osg::NodeCallback { public: FollowMainCameraNodeCallback(osg::Camera* camera) : _camera(camera) { } virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osg::Camera* thisCamera = dynamic_castosg::Camera*(node); if (!thisCamera) return; thisCamera-setViewMatrix(_camera-getViewMatrix()); . _reflectionCamera-setUpdateCallback(new FollowMainCameraNodeCallback(_viewer-getView(0)-getCamera())); Nick On Fri, Oct 24, 2014 at 5:31 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: thanks Robert Nick On Fri, Oct 24, 2014 at 5:19 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, The update of the CameraManipulator happens at the end of VIewer::updateTraversal(). The default Viewer::frame() implementation() runs the event and then update traversal. Your own application can override any of the viewer.frame() or updateTraversal/eventTraversal() methods so if you want to take control and do things in a different from standard you can do. Robert. On 24 October 2014 16:13, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I am facing the same problem for long time and always have to hack it. I have prerender camera that has to follow the main camera. My pre-render camera is always a frame behind the main camera which is updated by a CameraManipulator. The update of the Pre-Render camera is done with UpdateCallback that simply copy the ViewMatrix of the main camera, but it seam that the main camera is updated afterwards. What is the order of these updates? I was expecting the main camera is updated from the CameraMainpulator and then everything else (including the Pre-Render cameras), but seam it is not the case? Any hints on this? Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] order of PreRender camera with respect to the main camera
Hi Community, I am facing the same problem for long time and always have to hack it. I have prerender camera that has to follow the main camera. My pre-render camera is always a frame behind the main camera which is updated by a CameraManipulator. The update of the Pre-Render camera is done with UpdateCallback that simply copy the ViewMatrix of the main camera, but it seam that the main camera is updated afterwards. What is the order of these updates? I was expecting the main camera is updated from the CameraMainpulator and then everything else (including the Pre-Render cameras), but seam it is not the case? Any hints on this? Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] order of PreRender camera with respect to the main camera
thanks Robert Nick On Fri, Oct 24, 2014 at 5:19 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, The update of the CameraManipulator happens at the end of VIewer::updateTraversal(). The default Viewer::frame() implementation() runs the event and then update traversal. Your own application can override any of the viewer.frame() or updateTraversal/eventTraversal() methods so if you want to take control and do things in a different from standard you can do. Robert. On 24 October 2014 16:13, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Community, I am facing the same problem for long time and always have to hack it. I have prerender camera that has to follow the main camera. My pre-render camera is always a frame behind the main camera which is updated by a CameraManipulator. The update of the Pre-Render camera is done with UpdateCallback that simply copy the ViewMatrix of the main camera, but it seam that the main camera is updated afterwards. What is the order of these updates? I was expecting the main camera is updated from the CameraMainpulator and then everything else (including the Pre-Render cameras), but seam it is not the case? Any hints on this? Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] invalid enumerant error
Hi community, This is question for those who has debug OpenGL apps. I am getting the following message: Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 0x40b3 Any hints how to resolve it or at least get some more info? Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] invalid enumerant error
Thanks Karl, I set this in my code: std::ostringstream oss; oss OSG_GL_ERROR_CHECKING=ON; _putenv(oss.str().c_str()); still getting the same output, nothing extra. I am using TextureRectangle as well so might be the same issue. Any further hints? Thanks a bunch! Nick On Thu, Oct 23, 2014 at 1:08 PM, Cary, Karl A. karl.a.c...@leidos.com wrote: Robert had a suggestion in the past that helped me track down a similar issue in the past. From an earlier post from him: One way of pinpointing the error better is to enable fine grained error checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on my Linux system this is: export OSG_GL_ERROR_CHECKING=ON In my case this pointed me to a Texture2DRectangle that I was improperly declaring a min filter on. Hope this helps. -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Thursday, October 23, 2014 6:57 AM To: OpenSceneGraph Users Subject: [osg-users] invalid enumerant error Hi community, This is question for those who has debug OpenGL apps. I am getting the following message: Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 0x40b3 Any hints how to resolve it or at least get some more info? Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] invalid enumerant error
thats the ugly approach ... but needed indeed. Thanks again Nick On Thu, Oct 23, 2014 at 1:44 PM, Cary, Karl A. karl.a.c...@leidos.com wrote: Just checked my changelog, I thought it was a min filter, but actually it was I was enabling wrap, which isn't allowed for a texture rectangle. Not sure if this is it or not. From it saying GLMode, I would suspect you are doing a stateset setAttribute or setMode that isn't viable. Personally I would suggest commenting out large groups of stateset code until the error goes away and use that to track down what section of your code is doing it. -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Thursday, October 23, 2014 7:36 AM To: OpenSceneGraph Users Subject: Re: [osg-users] invalid enumerant error Thanks Karl, I set this in my code: std::ostringstream oss; oss OSG_GL_ERROR_CHECKING=ON; _putenv(oss.str().c_str()); still getting the same output, nothing extra. I am using TextureRectangle as well so might be the same issue. Any further hints? Thanks a bunch! Nick On Thu, Oct 23, 2014 at 1:08 PM, Cary, Karl A. karl.a.c...@leidos.com wrote: Robert had a suggestion in the past that helped me track down a similar issue in the past. From an earlier post from him: One way of pinpointing the error better is to enable fine grained error checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on my Linux system this is: export OSG_GL_ERROR_CHECKING=ON In my case this pointed me to a Texture2DRectangle that I was improperly declaring a min filter on. Hope this helps. -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Thursday, October 23, 2014 6:57 AM To: OpenSceneGraph Users Subject: [osg-users] invalid enumerant error Hi community, This is question for those who has debug OpenGL apps. I am getting the following message: Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 0x40b3 Any hints how to resolve it or at least get some more info? Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] invalid enumerant error
Thanks Sebasitian . I have heard of it but never tried. Now seam the time comes. Thanks again! Nick On Thu, Oct 23, 2014 at 1:50 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Nick, I usually use GDebugger or similar tools which can hook into the OpenGLDriver. There you can get the stack-trace telling you the provoking OpenGL call. Good tools might like GDebugger will also allow you to see the actual code (e.g. the OSG call) where the error stems from Thanks Karl, I set this in my code: std::ostringstream oss; oss OSG_GL_ERROR_CHECKING=ON; _putenv(oss.str().c_str()); still getting the same output, nothing extra. I am using TextureRectangle as well so might be the same issue. Any further hints? Thanks a bunch! Nick On Thu, Oct 23, 2014 at 1:08 PM, Cary, Karl A. karl.a.c...@leidos.com wrote: Robert had a suggestion in the past that helped me track down a similar issue in the past. From an earlier post from him: One way of pinpointing the error better is to enable fine grained error checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on my Linux system this is: export OSG_GL_ERROR_CHECKING=ON In my case this pointed me to a Texture2DRectangle that I was improperly declaring a min filter on. Hope this helps. -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Thursday, October 23, 2014 6:57 AM To: OpenSceneGraph Users Subject: [osg-users] invalid enumerant error Hi community, This is question for those who has debug OpenGL apps. I am getting the following message: Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 0x40b3 Any hints how to resolve it or at least get some more info? Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] invalid enumerant error
Thanks Conan! Nick On Thu, Oct 23, 2014 at 3:08 PM, Conan Doyle o...@celticblues.com wrote: +1 on gDEBbugger.. very useful tool... also look into AMD CodeXL, which I believe, is an updated version of gDEBugger. Trajce Nikolov NICK wrote: Thanks Sebasitian . I have heard of it but never tried. Now seam the time comes. Thanks again! Nick On Thu, Oct 23, 2014 at 1:50 PM, Sebastian Messerschmidt () wrote: Hi Nick, I usually use GDebugger or similar tools which can hook into the OpenGLDriver. There you can get the stack-trace telling you the provoking OpenGL call. Good tools might like GDebugger will also allow you to see the actual code (e.g. the OSG call) where the error stems from Thanks Karl, I set this in my code: std::ostringstream oss; oss OSG_GL_ERROR_CHECKING=ON; _putenv(oss.str().c_str()); still getting the same output, nothing extra. I am using TextureRectangle as well so might be the same issue. Any further hints? Thanks a bunch! Nick On Thu, Oct 23, 2014 at 1:08 PM, Cary, Karl A. () wrote: Robert had a suggestion in the past that helped me track down a similar issue in the past. From an earlier post from him: One way of pinpointing the error better is to enable fine grained error checking in the osg::State by setting the env OSG_GL_ERROR_CHECKING to ON, on my Linux system this is: export OSG_GL_ERROR_CHECKING=ON In my case this pointed me to a Texture2DRectangle that I was improperly declaring a min filter on. Hope this helps. -Original Message- From: osg-users [mailto: ()] On Behalf Of Trajce Nikolov NICK Sent: Thursday, October 23, 2014 6:57 AM To: OpenSceneGraph Users Subject: invalid enumerant error Hi community, This is question for those who has debug OpenGL apps. I am getting the following message: Warning: detected OpenGL error 'invalid enumerant' after applying GLMode 0x40b3 Any hints how to resolve it or at least get some more info? Thanks a lot, Nick -- trajce nikolov nick ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ) -- trajce nikolov nick ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ) -- trajce nikolov nick -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61399#61399 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] underline fonts
Thanks Robert, I will have a look at freetype and osgText::Text then Thanks again Nick On Mon, Oct 20, 2014 at 10:39 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 15 October 2014 14:47, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: any clue how to load fonts (or set) with underlined characters? There isn't any support for this in osgText/freetype plugin. I would guess that freetype itself would support this so it may well be possible to add support without too much difficulty. One would need to add options on the osgText side to provide hints for underlining. The other alternative would be to render the underlining as an overlay. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgText and languages
Hi community, what are the steps to have different characters (language, like russian for example) working with osgText? Thanks a bunch! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText and languages
answering my own question. Just in case someone else gets into the same issue osgText::String text; wchar_t chars[] = Lȹ; text.set(chars); m_label = new osgText::Text; m_label-setFont(fonts/arial.ttf); m_label-setText(text/*ȹ*/); Cheers, Nick On Thu, Oct 16, 2014 at 3:55 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi community, what are the steps to have different characters (language, like russian for example) working with osgText? Thanks a bunch! Nick -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] underline fonts
Hi Community, any clue how to load fonts (or set) with underlined characters? Thanks a bunch, Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ViewDependentShadowMap example
Hi Community, any hints or sample how to use this technique? I was not able to find anything in the rep Thanks a bunch! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ViewDependentShadowMap example
Thanks Christian, Nick On Thu, Oct 2, 2014 at 1:46 PM, Christian Buchner christian.buch...@gmail.com wrote: Hi, The osg shadow mapping techniques are interchangeable, as they share a common base interface. Note that while a standard Shadow Map will produce some flickering/artifacting when light sources move, expect some artifacting from ViewDependentShadowMap also when the camera moves around. For us this was the reason to stick with the standard shadow map. Christian 2014-10-02 13:42 GMT+02:00 Trajce Nikolov NICK trajce.nikolov.n...@gmail.com: Hi Community, any hints or sample how to use this technique? I was not able to find anything in the rep Thanks a bunch! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ViewDependentShadowMap example
Me again, I tried few techniques and so far I was most happy with the LightSpacePerspectiveShadowMap. However it does not work on databases with large coordinates (like UTM) and I got few hints from Wojtek L. but did not helped. Any experience with this someone? Thanks again Nick On Thu, Oct 2, 2014 at 2:10 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thanks Christian, Nick On Thu, Oct 2, 2014 at 1:46 PM, Christian Buchner christian.buch...@gmail.com wrote: Hi, The osg shadow mapping techniques are interchangeable, as they share a common base interface. Note that while a standard Shadow Map will produce some flickering/artifacting when light sources move, expect some artifacting from ViewDependentShadowMap also when the camera moves around. For us this was the reason to stick with the standard shadow map. Christian 2014-10-02 13:42 GMT+02:00 Trajce Nikolov NICK trajce.nikolov.n...@gmail.com: Hi Community, any hints or sample how to use this technique? I was not able to find anything in the rep Thanks a bunch! Nick -- trajce nikolov nick ___ 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 -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgUtil::PositionalStateContainer::AttrMatrixList from the currentRenderStage
Hi Robert, Community, this will be hard to be described I guess, but I will try. Will make a video as well later. I am doing something with lights and in a CullCallback I do computation of some light attribs for a shader. This something is splitting the computation between the CPU and the GPU for lighting purposes.. And I am doing sort of my LOD within this CullCallback. so the lights are not active after a distance. And it works great but my cull time is really high so I am about to optimize it with an LOD (just a try). My scenegraph is like: root-MatrixTransform-LightSource and again it works ok as long as I add LOD between the transform and the lightsource. Honestly, I have no clue what is going on. The final result is as I am getting close to the LOD switch out distance the lights are changing position, intensity and they fade away.instead of just switch out on that distance. Since I am using the osgUtil::PositionalStateContainer::AttrMatrixList from the currentRenderStage (snippet bellow) and I am using the matrices from there for the osg::Light attributes something is telling me that these matrices are somewhat wrong when LOD is in the scene path. But again this is only guessing I am aware that based on written above it is hard to give a hint and I had big doubts to post this really, but just in case maybe someone will have an idea. Thanks a bunch as always Nick snippet from the cullcallback: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgUtil::CullVisitor * cv = dynamic_castosgUtil::CullVisitor*(nv); osgUtil::PositionalStateContainer::AttrMatrixList aml = originalRenderStage-getPositionalStateContainer()-getAttrMatrixList(); // here I iterate over the list and after I use the osg::Light attrib with its associated matrix to compute stuff for the shader -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgUtil::PositionalStateContainer::AttrMatrixList from the currentRenderStage
Hi again, here I managed to make some videos. The first one is without LOD in the scene the second one is with LOD in the scene Thanks a lot for any hint! Nick https://dl.dropboxusercontent.com/u/91101321/ll-1.mov https://dl.dropboxusercontent.com/u/91101321/ll-2.mov On Wed, Sep 24, 2014 at 2:28 PM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Robert, Community, this will be hard to be described I guess, but I will try. Will make a video as well later. I am doing something with lights and in a CullCallback I do computation of some light attribs for a shader. This something is splitting the computation between the CPU and the GPU for lighting purposes.. And I am doing sort of my LOD within this CullCallback. so the lights are not active after a distance. And it works great but my cull time is really high so I am about to optimize it with an LOD (just a try). My scenegraph is like: root-MatrixTransform-LightSource and again it works ok as long as I add LOD between the transform and the lightsource. Honestly, I have no clue what is going on. The final result is as I am getting close to the LOD switch out distance the lights are changing position, intensity and they fade away.instead of just switch out on that distance. Since I am using the osgUtil::PositionalStateContainer::AttrMatrixList from the currentRenderStage (snippet bellow) and I am using the matrices from there for the osg::Light attributes something is telling me that these matrices are somewhat wrong when LOD is in the scene path. But again this is only guessing I am aware that based on written above it is hard to give a hint and I had big doubts to post this really, but just in case maybe someone will have an idea. Thanks a bunch as always Nick snippet from the cullcallback: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgUtil::CullVisitor * cv = dynamic_castosgUtil::CullVisitor*(nv); osgUtil::PositionalStateContainer::AttrMatrixList aml = originalRenderStage-getPositionalStateContainer()-getAttrMatrixList(); // here I iterate over the list and after I use the osg::Light attrib with its associated matrix to compute stuff for the shader -- trajce nikolov nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] recent changes to osg::Geometry
Thanks Wojtek, yes, that is it. In very brief. Any clue what is making now osg::Geometry faster, what is the story behind? Thanks again! Nick On Fri, Sep 19, 2014 at 11:43 AM, Wojciech Lewandowski w.p.lewandow...@gmail.com wrote: Hi Trajce, I spent good time to go through the archive looking for the announcement from Robert from time ago about the changes in osg::Geometry with no luck. And I don't mean the last one that now it is a regular osg::Node, but was something else, and I don't remember what was it. I believe those earlier changes were made around OSG 3.2 release. See http://www.openscenegraph.org/index.php/community/press-releases/143-openscenegraph-3-2-release . ... - Clean up of osg::Geometry class removing all deprecated slow path API's resulting in a smaller and faster Geometry class ... And were mainly related to VecArrays refactoring. Look for changes in array binding setup. Cheers, Wojtek Lewandowski ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] recent changes to osg::Geometry
Hi Robert, thanks a lot for the detailed info. I was following the user list but was somehow moving the upgrade to the latest from the trunk to some better days, and these days are now :-). I understand now the changes, just reading the code now and comparing it to some older version. I have another question. Are these changes reflected into the plugins like OpenFlight, ive, osgb? The real problem I am facing is the performance of a system already installed on a site and if there is a way to improve them just by upgrading OSG. or I have to touch the mentioned plugins as well. Probably the most important is the OpenFlight plugin Thanks again ! Nick On Fri, Sep 19, 2014 at 12:03 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Nick, On 19 September 2014 10:47, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: yes, that is it. In very brief. Any clue what is making now osg::Geometry faster, what is the story behind? The changes to osg::Geometry in 3.2 relate to removal of the code paths that handle the cases where index arrays where used, even when not used this added an small overhead to each osg::Geometry call when display lists weren't used. These changes distil osg::Geometry down to just supporting OpenGL fast paths. For most end users there won't need to be any changes as they shouldn't have been using index arrays as they have been deprecated slow paths for many years. To support this change the osg::Array has already been re-factored a little to now contain things like binding information directly with the osg::Array rather than as part of osg::Geometry. In svn/trunk and the OSG-3.3.x dev releases there are further changes to osg::Drawable that relate to change it to subclass from osg::Node rather than osg::Object. This change also brought about unification and generalization of the Callback. Now that Drawable is a Node you no longer need an osg::Geode to attach a Drawable to the scene graph, this makes a little simpler to create scene graphs, and reduces the number of nodes in the scene graph which which can help cut down CPU overhead of cull traversal. All of these changes have been done in a way that retains backwards compatibility as far as possible, so most applications won't notice a difference when compiling their OSG apps. The small improvements to performance are unlikely to be noticeable without accurate time stats. Together these changes are all about slowly cleaning up the OSG API and making more efficient and flexible. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] recent changes to osg::Geometry
Ok. I think I will definitely give it a try and see. Thanks again !!! Cheers, Nick On Fri, Sep 19, 2014 at 12:40 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 19 September 2014 11:29, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Robert, thanks a lot for the detailed info. I was following the user list but was somehow moving the upgrade to the latest from the trunk to some better days, and these days are now :-). I understand now the changes, just reading the code now and comparing it to some older version. I have another question. Are these changes reflected into the plugins like OpenFlight, ive, osgb? The real problem I am facing is the performance of a system already installed on a site and if there is a way to improve them just by upgrading OSG. or I have to touch the mentioned plugins as well. Probably the most important is the OpenFlight plugin The plugins have remained pretty well the same, just a few tweaks to the serializers for the refactor. If you are upgrading to a svn/trunk or dev release then you should be able to update the whole OSG and not worry about plugins - just pull them all in as well. Most of the plugins don't yet take advantage of the new changes of the Drawable subclassing from osg::Node, so they mostly all still create osg::Geode and attach the Drawables to it. These plugins could be optimized a little by removing the Geode where it isn't required but I haven't tackled this work. Others are welcome to pitch in. There are various other small tweaks to the OSG to help reduce the CPU overhead, so in general the the latest should just be all-round a better bet. Don't expect big performance changes though, it's just little improvements here and there. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] recent changes to osg::Geometry
Hi Robert, Community, I spent good time to go through the archive looking for the announcement from Robert from time ago about the changes in osg::Geometry with no luck. And I don't mean the last one that now it is a regular osg::Node, but was something else, and I don't remember what was it. Can you/someone give me brief insights in the changes made in the last versions what were they and why? Thanks a bunch ! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] order of MatrixTransform
Hi Bram, If you use single MatrixTransform you can achieve the same effect in the way you are constructing the scenegraph above by multiplication of different matrices. Something like osg::MatrixTransform *mxt = new osg::MatrixTransform; mxt-setMatrix( osg::Matrix::translate(-myPoint) * osg::Matrix::rotate(myRotation) * osg::Matrix::translate(myPoint) ); And you keep track and change myRotation, which is osg::Quat. Nick On Sun, Sep 14, 2014 at 5:29 PM, Bram Vaessen bram.vaes...@gmail.com wrote: Thanks. Is there a way to make it a single node, but still being able to easily change the rotation around the point (the point on which to rotate doesn't change) ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61035#61035 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] order of MatrixTransform
yes. This is what I think Robert had in mind when he mentioned performance efficiency Nick On Sun, Sep 14, 2014 at 10:42 PM, Bram Vaessen bram.vaes...@gmail.com wrote: Ok thanks, I would have to recalculate the matrix every time the rotation changes I assume, but in the end that is probably more efficient than having 3 matrixtransforms in the scenegraph... right? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61037#61037 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org