Re: [osg-users] Lines and only the lines are getting cliped some how!
Hi David, I'm kind of intrigued... do you have some stripped-down example code which reproduces the problem, so we can poke around with it? There are a number of things which *could* be going on (in my imagination if not in reality or not if I knew more about OSG - I'm learning every day though!), but based only on what you've said I don't have meaningful input - but if you could make a small reproducible app, that would be fun to play with and perhaps shed some light on it. (I've solved many a self-generated issue before even asking anyone else while trying to reduce my code to bare essentials, so perhaps that's a worthy step regardless.) Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30950#30950 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry colorArray
Hi, have you tried callind ->dirty() on the array? Are you using VBOs or display lists? jp On 19/08/10 22:18, Emilie Deschamps wrote: Hi, My question may be obvious but I can't figure it out. Here's my problem: I have a (rig)geometry, with a vertexArray, a normalArray, and a colorArray (bind per vertex). Somewhere else in my code, I keep pointers to some of those values (a subset of vertices, a part of my geometry). When I modify a vertex or a normal by thoses pointers, my geometry get updated as expected. But when I modify a color, nothing happens !! What am I missing ? Thank you! Cheers, Emilie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30938#30938 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lines and only the lines are getting cliped some how!
Well, I Do have two cameras. See, this is a planning view and I'm trying to replicate an old Performer trick that I learned. One camera is for the terrain and another camera for the object elements that has it clear mask set to GL_DEPTH_BUFFER_BIT - based on the HUD example. Sort of like layers in photoshop! I did this as a trick to avoid having the lines or anything else be covered behind terrain - so the objects always seem appear on top of the terrain - like a map. I figured that if could do it in Performer, it might work on Open Scene Graph. Behind the grid I also have a phantom version of the terrain. I used the globe from the osglogo example and colored it black, then got the state set and set the color mask useing: Code: osg::ColorMask* cm = new osg::ColorMask(false,false,false,false); state->setAttributeAndModes(cm,osg::StateAttribute::ON); then set render bin details for that object: Code: state->setRenderBinDetails(-1,"RenderBin",osg::StateSet::USE_RENDERBIN_DETAILS); This makes a phantom globe for the grid to hide behind. Well, you see the reason that I thought I might have to post some of the code so you might have a better understanding of whats going on. This may not matter, but this is all being done using QT window (using the osgQTveiwer example as a gide) and it's running under Linux. ... D Glenn D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30948#30948 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Hi, Geometry is loaded and rendered ok. I wanted to do materials next, but encountered small problem. If i add bone/bones to my model, osg loads them as an additional mesh. It may be ok, but there are two consequences: 1. If i try to copy texcoords - crash. So i need to find away for importer to identify that mesh and skip it. 2. Why skip? I know, that LightWave stores real bones in ".lws"(scene file). But i'm really aware, that osg doesn't support LightWave bone animation, looking at strange behavior with bones in .lwo(object) files. Thank you! Cheers, Igor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30947#30947 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Choosing a different cull mask for Viewer's master camera seems to mess up shadows...
Hi Frank, I can't claim to have experienced what you're experiencing, nor any experience with shadowing at all. Instead of setting the cull mask to exclude some objects, can you make them (the shadow-casting but not displayed objects) fully transparent? I don't know if that affects the shadows they cast or not, but to me the naive outsider in shadow-casting it seems like changing shadows based on transparency would be complex so it may allow you to cast stuff from invisible nodes. Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30946#30946 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry colorArray
Hi Emilie, I don't have much experience with doing what you're trying to do, but do you have the data variance on your geometry set to dynamic? When I've forgotten to do this in the past various things I've tried to modify dynamically weren't applied, I can't recall if position (for example) worked but not color - it could have been that nothing was updating right and completely different from your case... but perhaps a hint? Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30945#30945 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Choosing a different cull mask for Viewer's master camera seems to mess up shadows...
Well, I got it to draw something other than a square shadow. =) Remember before I had said that the shadow appeared as a square-shape just below the shadow caster. It was about the right size and position for the caster, leading me to conclude that the shadow technique was correctly locating the shadow caster, and adjusting its view frustum to fit it prior to rendering the shadow map. Well, it's doing the same thing now, but now instead of this square 'shadow region' being filled with shadow, it's filled with a pattern of dots. The cool thing is that, among the dots, I do see a silhouette of the shadow caster! However, this silhouette appears to be offset by half the width of the shadow region. Thus, half of it is cut off, and wraps around to the other side! I don't know if you can picture that or not, but it's definitely very weird! But I have learned some interesting things from this! a) It's stable. That is, if I close the program down, and then start it back up again, I get the same exact pattern of dots with the 'offset and wrapped' silhouette. b) The shadow map isn't updating from frame-to-frame anymore. I've tried moving the directional light source's direction around, as well as moved & rotated the shadow caster around. The shadow itself moves as expected, but it always looks the same. So, the position of the shadow changes, but the content of the shadow does not. It's like a projective texture with a static image of a weird shadow on it. I also tried this. Instead of setting the cull mask to 'visibleMask ', I set it to visibleMask | castShadowMask | receiveShadowMask. Now, the shadowing works perfectly! However, it still leaves me with my original problem, which is that if I want to hide an object, I can't just turn its visibility bit off, I have to turn the shadow bits off as well. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30944#30944 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lines and only are getting cliped some how!
David Glenn wrote: Greetings! I know that I've been through this before, but I have a little more that I can show off, and a little more understanding what to ask. I'm trying to draw lines about my terrain. I'm using my ellipsoid model to help draw on top of things. but as you can see from my example below, even though I can successfully draw above my terrain, when I zoom in my camera for it appears that the near clipping plain is cutting off the lines and not the polygon terrain below. [Image: http://www.dglenn.com/osgpics/test_example_1.png ] I first I figured that it was that I was not setting my near far planes right, but I've been experimenting with that and even used some settings that some of you suggested. I can't figure this one out! The only other things that come to mind is the camera manipulator I'm using. I've ruled out other elements -like the terrain. I have some example code that I can post here that I used to test this that I can post - I just don't what to upload too much stuff and jam things up, you understand! Interesting. Why would you suspect the projection matrix (near far planes)? Cause if you're using the same projection matrix for the lines as you are for the terrain, then the terrain would also be clipped. Are you using a different Camera node to render the lines? If so, why? This this could result in a different projection matrix, causing your geometry to not share the same z mapping. This would break your z buffer, of course. I'm not convinced the problem isn't that the lines are "under" the terrain and therefore losing the z test. If your lines are drawn last (via render bins) then you could disable depth testing just to check to see if this is the case. Set the depth test to GL_ALWAYS for the lines and see if they appear on top of the terrain. -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgSim HeightAboveTerrain performance...
Robert, Sorry it has been long giving feedback on this. I've been working other issues. I did try the KdTrees stuff you suggested without any improvement in performance. I called osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Option s::BUILDKDTREES); before I load my terrain database. Is this the correct way to do this? Is there anything else I need to do to enable this or get this to work? In some respects things got even slower than before when I try LOS intersection calculations via the osgSim::LineOfSight class... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, July 28, 2010 2:47 AM To: OpenSceneGraph Users Subject: Re: [osg-users] osgSim HeightAboveTerrain performance... Hi Shyane, I've not been at my desk too consistently this last few weeks due to school holidays, so not able to dig down into all threads. A couple of general comments. If intersections are slow then consider enabling the building KdTree's on your scene graph, this will greatly improve performance. In osgDB::Options and osgDB::Registry there is a setBuildKdTreesHint(..) method that you can use. Robert. On Tue, Jul 27, 2010 at 7:25 PM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: > Since I didn't receive any input or feedback on my previous inquiry, I'm > assuming no one has used osgSim very much in an extensive setting.?.? > > At any rate, I've done some further investigation. It appears that > performance is very poor when HAT inquiries are randomly called in different > portions of the code via the > osgSim::HeightAboveTerrain::computeHeightAboveTerrain(.) method. On the > other hand, if HAT points via hat.addPoint() are collected up and then > computed (intersections) in one place, performance improves. I'm assuming > that this is the correct usage for OSG? If this is true, I must say that > this is a major problem since HAT inquiries need to be done at different > times throughout the application due to dependencies on HAT for other > calculations. > > I would like some feedback from someone in the know on osgSim so I know what > the proper usage is for maximum performance. If it is true that all HAT > points in OSG need to be consolidated for intersection calculation, then I > will attempt to refactor the code to support what OSG wants. > > Thanks, > -Shayne > > -Original Message- > From: osg-users-boun...@lists.openscenegraph.org > [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of > Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC > Sent: Friday, July 23, 2010 10:57 AM > To: OpenSceneGraph Users > Subject: [osg-users] osgSim HeightAboveTerrain performance... > > All, > > > > I was wanting some feedback for those who have used osgSim in querying VPB > database info such has HAT, LOS, etc., during runtime. > > > > I'm seeing some performance issues when using > osgSim::HeightAboveTerrain::computeHeightAboveTerrain(.) to get the HAT > value for a particular location in the database. At times, we need multiple > HAT values per frame which seems to bog the performance down. I would > surmise that LOS calculations are probably worse since multiple > intersections are computed. > > > > My question is, is how efficient is the osgSim HAT function? Is the process > of retrieving HAT a slow one? If so, is there a way to improve performance > if one or more HAT requests are issued on a per frame basis? > > > > Thanks in advance, > > -Shayne > > > ___ > 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 smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Lines and only are getting cliped some how!
Greetings! I know that I've been through this before, but I have a little more that I can show off, and a little more understanding what to ask. I'm trying to draw lines about my terrain. I'm using my ellipsoid model to help draw on top of things. but as you can see from my example below, even though I can successfully draw above my terrain, when I zoom in my camera for it appears that the near clipping plain is cutting off the lines and not the polygon terrain below. [Image: http://www.dglenn.com/osgpics/test_example_1.png ] I first I figured that it was that I was not setting my near far planes right, but I've been experimenting with that and even used some settings that some of you suggested. I can't figure this one out! The only other things that come to mind is the camera manipulator I'm using. I've ruled out other elements -like the terrain. I have some example code that I can post here that I used to test this that I can post - I just don't what to upload too much stuff and jam things up, you understand! --- D Glenn D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your Desk! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30940#30940 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Choosing a different cull mask for Viewer's master camera seems to mess up shadows...
Hello friends, I am trying to improve the way that we utilize node masks. Right now, the cull mask for our Viewer's master camera is set to 0x (all bits on). So, a node will always be drawn if _any_ of its node mask bits are set. Right now, we're essentially using the node mask for three things: 1) To indicate whether the node should be drawn or is hidden 2) To indicate if the node should be a shadow caster 3) To indicate if the node should be a shadow receiver To this end, we have three basic masks that we bitwise OR together: visibleNodeMask 0x1 castsShadowsMask 0x2 receivesShadowsMask 0x4 So, a visible object that casts shadows, but does not receive them, would have a mask of 0x1 | 0x2 = 0x3. I'm sure you get the idea, as this seem pretty common. But the problem is, since our camera's cull mask is set to 0x, the visibility bit doesn't actually matter. If we want to hide an object, we have to set its node mask to zero. If we want to show an object that was previously hidden, we have to reconstruct its node mask, and that means we have to store its shadow state separately. This is all very silly, so I decided to try and set our camera's cull mask to 0x1. That way, the only bit that matters, as far as whether objects draw or not, is the visibility bit that we've already designated, and showing or hiding an object is a matter of simple, straightforward bitwise math. So I did this: Code: m_viewer->getCamera()->setCullMask(visibleNodeMask); And this seems to work fine, as far as determining which objects should be hidden and which objects should be shown, however now my shadows are messed up. I have a scene with one shadow caster, and the shadow appears as a full square below the caster. To me, it looks as though the camera that renders the shadow map is correctly identifying which object should be rendered, and adjusting its frustum to match the bounding box of this object. However, after the shadow map is rendered, the resulting shadow map is filled with depth values of zero (or nearly zero) -- almost as if it didn't actually render the caster into the shadow map. Just in case, I took a look at my scene graph in the debugger, just to see what the nodes' masks looked like. They all seemed to be what I expected. I know that you guys couldn't possibly tell me exactly what is causing my problem, because you have no idea what my code or scene graph looks like. However, I was hoping that perhaps this is a common-enough problem that has a well-known solution. Just a stab in the dark. I was reading elsewhere that, when setting the cull mask of the camera, one should also set the inheritance mask like so: Code: osg::Node::NodeMask inheritanceMask = m_viewer->getCamera()->getInheritanceMask(); inheritanceMask |= ~(osg::CullSettings::CULL_MASK); m_viewer->getCamera()->setInheritanceMask(inheritanceMask); I have no idea what this does. I tried it, but it didn't seem to help. Thanks, Frank[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30939#30939 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Geometry colorArray
Hi, My question may be obvious but I can't figure it out. Here's my problem: I have a (rig)geometry, with a vertexArray, a normalArray, and a colorArray (bind per vertex). Somewhere else in my code, I keep pointers to some of those values (a subset of vertices, a part of my geometry). When I modify a vertex or a normal by thoses pointers, my geometry get updated as expected. But when I modify a color, nothing happens !! What am I missing ? Thank you! Cheers, Emilie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30938#30938 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visualizing 3D-Points including standard deviation
Thank you for the suggestions, I think a billboard with a gaussian texture is right what I need. Either a view-aligned billboard, which requires to update the width/height of the billboard - or a static billboard with 2 (or 3) crossing quads. A source code example would be great! Could you ask your colleagues, please? :) Thanks again, Felix -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30937#30937 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [VPB] VPB without opengl context
On Thursday 19 August 2010 17:37:12 Fabien Lavignotte wrote: > About the patent issue, i found this on the nvidia site : > http://code.google.com/p/nvidia-texture-tools/wiki/FAQ > Apparently no problem, even in US. IANAL, but I don't think this paragraph from the URL above gives anybody a free hand regarding the patent: "NVIDIA has a license of the S3TC patent that covers all our products, including our Texture Tools. You don't have to obtain a license of the S3TC patent to use any of NVIDIA's products, but certain uses of NVIDIA Texture Tools source code cannot be considered NVIDIA products anymore. Keep in mind that the NVIDIA Texture Tools are licensed under the MIT license and thus are provided without warranty of any kind." Note the phrase "certain uses [...] cannot be considered NVIDIA products anymore." Sounds like unless someone from NVIDIA's licensing department gives the OK we'd better be careful with this. Magnus > So is it ok if i send you a submission in the next few days to use nvidia > texture tools into VPB ? > > Fabien. > > -Original Message- > From: osg-users-boun...@lists.openscenegraph.org > [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert > Osfield Sent: jeudi 19 août 2010 17:41 > To: OpenSceneGraph Users > Subject: Re: [osg-users] [VPB] VPB without opengl context > > Hi Fabien, > > I've been planning to make it possible to use osgdem without a graphics > context - it's only used for mipmapping and texture compression. > > Libsquish is already something I've experimented with but haven't reployed > as the result I got were mixed and there is also the patent on the S3TC > compression technique which libsquish uses which complicates it's usage. > > Robert. > > On Thu, Aug 19, 2010 at 4:10 PM, Fabien Lavignotte wrote: > > Hi Robert, > > I modify a little bit VPB so that it can works without an active > > opengl context. > > First, i use some command line options in order to not need a opengl > > context, disable compressed textures and creation of mip-map (--RGB-24 > > -mip-mapping-hardware). Then i desactivate the creation of graphics > > context in DataSet::_run (see attached the modified file). > > It works, at least i can generate a small database without problem. > > My plan is to add the support of compressed textures and mipmapping > > through the nvidia-texture-tools library > > (http://code.google.com/p/nvidia-texture-tools/). It is based on > > libsquish for the compression part. So i can safely remove the > > creation of a graphics context in DataSet. > > But there is also a graphics context created in ThreadPool, and more > > precisely only for writing threads. Looking at the code, i cannot see > > why this is needed. In which case, the graphics context is needed ? Is > > it safe just to remove it ? > > Thanks, > > Fabien > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] conflict with non-OSG OpenGL view?
My application has an OSG view and a second non-OSG OpenGL view. Occasionally, I'm getting a crash in GraphicsWindowWin32::swapBuffersImplementation() with what looks like a bad _hdc. The crash is an access violation due to an attempted write to 0. I think the relevant code is: void GraphicsWindowWin32::swapBuffersImplementation() { if (!_realized) return; if (!::SwapBuffers(_hdc) && ::GetLastError() != 0) { reportErrorForScreen("GraphicsWindowWin32::swapBuffersImplementation() - Unable to swap display buffers", _traits->screenNum, ::GetLastError()); } } I'm not certain if this is correct because the crash is actually happening down in the atioglxx.dll file. Does anybody know if AMD has a public symbol server? I think it has something to do with OpenGL state between my two views because the crash normally happens when I'm manipulating my non-OSG view (and my OSG view is still drawing nonstop in its own thread). Is this a bad thing to do? Cory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [VPB] VPB without opengl context
About the patent issue, i found this on the nvidia site : http://code.google.com/p/nvidia-texture-tools/wiki/FAQ Apparently no problem, even in US. So is it ok if i send you a submission in the next few days to use nvidia texture tools into VPB ? Fabien. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: jeudi 19 août 2010 17:41 To: OpenSceneGraph Users Subject: Re: [osg-users] [VPB] VPB without opengl context Hi Fabien, I've been planning to make it possible to use osgdem without a graphics context - it's only used for mipmapping and texture compression. Libsquish is already something I've experimented with but haven't reployed as the result I got were mixed and there is also the patent on the S3TC compression technique which libsquish uses which complicates it's usage. Robert. On Thu, Aug 19, 2010 at 4:10 PM, Fabien Lavignotte wrote: > Hi Robert, > I modify a little bit VPB so that it can works without an active > opengl context. > First, i use some command line options in order to not need a opengl > context, disable compressed textures and creation of mip-map (--RGB-24 > -mip-mapping-hardware). Then i desactivate the creation of graphics > context in DataSet::_run (see attached the modified file). > It works, at least i can generate a small database without problem. > My plan is to add the support of compressed textures and mipmapping > through the nvidia-texture-tools library > (http://code.google.com/p/nvidia-texture-tools/). It is based on > libsquish for the compression part. So i can safely remove the > creation of a graphics context in DataSet. > But there is also a graphics context created in ThreadPool, and more > precisely only for writing threads. Looking at the code, i cannot see > why this is needed. In which case, the graphics context is needed ? Is > it safe just to remove it ? > Thanks, > Fabien > > __ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > __ > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] manipulating the camera manipulator
Hi all. My application needs a method to turn the view on the model horizontally and vertically . This is implemented by scroll wheels at the bottom and to the right of the view. I tried to make this working by calling the following methods: osg::Matrixd trackballMatrix; /** ## * Starting to scroll the wheel by the cursor */ void Cl_3Dview_osg::startMoveEvent() { // TODO: Throws disablen. Not possible by default view->requestContinuousUpdate(false); trackballMatrix = view->getCameraManipulator()->getMatrix(); } /** ## * Scrollin the wheel by the cursor */ void Cl_3Dview_osg::valueChangedEvent(Qt::Orientation orientation, int newValue) { osg::Vec3 achse; if (orientation == Qt::Horizontal) { achse = osg::Vec3(0.0, 0.0, 1.0); } else { achse = osg::Vec3(1.0, 0.0, 0.0); } osg::Matrixd myRotationMatrix; myRotationMatrix.makeRotate(osg::DegreesToRadians((float)newValue), achse); view->getCameraManipulator()->setByMatrix(trackballMatrix * myRotationMatrix); } Unfortunately this turns my scene around (0.0, 0.0, 0.0). I'm really not familiar with such kind of stuff so I would appreciate any help. Many thanks in advance! - Werner - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [VPB] VPB without opengl context
Hi Fabien, I've been planning to make it possible to use osgdem without a graphics context - it's only used for mipmapping and texture compression. Libsquish is already something I've experimented with but haven't reployed as the result I got were mixed and there is also the patent on the S3TC compression technique which libsquish uses which complicates it's usage. Robert. On Thu, Aug 19, 2010 at 4:10 PM, Fabien Lavignotte wrote: > Hi Robert, > I modify a little bit VPB so that it can works without an active opengl > context. > First, i use some command line options in order to not need a opengl > context, disable compressed textures and creation of mip-map (--RGB-24 > -mip-mapping-hardware). Then i desactivate the creation of graphics context > in DataSet::_run (see attached the modified file). > It works, at least i can generate a small database without problem. > My plan is to add the support of compressed textures and mipmapping through > the nvidia-texture-tools library > (http://code.google.com/p/nvidia-texture-tools/). It is based on libsquish > for the compression part. So i can safely remove the creation of a graphics > context in DataSet. > But there is also a graphics context created in ThreadPool, and more > precisely only for writing threads. Looking at the code, i cannot see why > this is needed. In which case, the graphics context is needed ? Is it safe > just to remove it ? > Thanks, > Fabien > > __ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > __ > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Building a scene graph for several thousandobjects
David Wilson wrote: One last question though - I'm implementing the cube faces as triangles. Would I be able to scrounge a little more performance by implementing them as quads instead? I'm guessing it would probably be marginal but might decrease memory use a little. I doubt you'll notice any difference. The quads will be tessellated to triangles (by the OpenGL driver, I think) before they're transformed and shaded anyway. --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Array
Igor Lebedev wrote: Hi, Ok. I did it like that. The same thing. Weird index values and bunch of polygons. So i should search in render function? I'm not sure I can help you any more than that. You've made statements that you know the structure and organization of the geometry that you're loading, so I assume you know what kind of primitives you have. If your primitives are indexed, then you should have one or more DrawElements primitive sets in the geometry. If not, you may have DrawArrays primitive sets instead, in which case there won't be any indices. The impression I get is that you're trying to rush as quickly as possible to get stuff on the screen. I wouldn't be surprised if one or more of the assumptions you've made along the way turns out to be false. I'd suggest slowing down a bit, work through an example or two, and figure out how to do things correctly. You'll end up with far fewer headaches that way. --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visualizing 3D-Points including standard deviation
Hi Felix, instead of using explicit 3D shapes, you could also use view-aligned quads with a semi-transparent gauss-texture. These textures could be pre-generated, I think the fountain example in OSG might also be helpful with this. They could also be created on demand in shaders, based on their Gauss attributes. We use a similar trick to draw lots of nicely shaded particles with ellipsoidal or spherical appearance, in this case for flow visualization and molecular visualization, e.g. see http://graphics.tudelft.nl/Projects/AtmosphericViz (this was OpenGL) and the first two images on http://graphics.tudelft.nl/VRVis (these are OSG). If you're interested I can probably get some source code your way, but I'd have to check with colleagues first. cheers, Gerwin On Wed, Aug 18, 2010 at 11:19 AM, Felix Engelmann wrote: > Hi, > I need to visualize points in 3D, whose positions are Gauss distributed. The > expected values and the standard deviations for each x, y and z coordinate > are given. So, how can I do that with OSG? > I could draw a sphere (using osg::SphereDrawable) with a fixed radius at the > center and another transparent sphere around it for visualizing the standard > deviation. But that doesn't look nice... > What I'm looking for is some kind of 3D-radial gradient. The transparency > should increase along the gradient accourding to the Gaussian distribution > function. > Note, that the standard deviation can be different for each dimension. > I'm a newbie in OSG and not an OpenGL expert. Some example code would be > really helpful. > > Thank you > > Sincerely, > Felix > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=30872#30872 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Hi Robert, 2010/8/19 Robert Osfield : > Hi Rafam > > I have Android phone so am curious about how well you'll get on, I > haven't actually attempted any port - way too many other tasks on my > plate to tinker. We have some projects that will make use of 3D in mobile systems, and we are experimenting with Android as first platform. IPhone is also interesting but distribution method of software is a little bit complicated so we are testing first Android. I hope have some results in a few weeks. > > On Wed, Aug 18, 2010 at 7:59 PM, Rafa Gaitan wrote: >> /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp: In member >> function 'void osg::Texture::applyTexImage2D_load(osg::State&, GLenum, >> const osg::Image*, GLsizei, GLsizei, GLsizei) const': >> /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp:1600: error: >> 'GL_RED' was not declared in this scope. >> >> I'm not sure how to achieve the change, maybe adding and #ifdef and >> checking if GLES/GLES2 is active? The other changes I have are only to >> allow ndk gcc compiler build correctly so they are minor changes, but >> the change on Texture.cpp affects functionality and I'm not sure which >> is the better way to achieve it. Once I have things working I will >> post on osg-submission the changes ;) > > You could just add a > > #ifndef GL_RED > #define GL_RED 0x1903 > #endif > > To get the code to compile. It won't do anything as the extension > code paths won't be visited, this is the approach I've previously been > using to minimize the number of code differences between platforms. Ok, I will do that! Thank you! Rafa. -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Building a scene graph for several thousand objects
Hi guys, Thanks very much for the helpful replies! Turns out my framerate was suffering because I was using a PositionAttitudeTransform object for every block in the scene. I was using it to test integration of Bullet physics and I got a huge boost when I removed it for terrain blocks. The octree turns out to have given me a large performance boost, and the advice about grouping up vertex data will no doubt give me the kind of framerates I'm looking for in an open-world environment. One last question though - I'm implementing the cube faces as triangles. Would I be able to scrounge a little more performance by implementing them as quads instead? I'm guessing it would probably be marginal but might decrease memory use a little. Anyway, thanks again! David Wilson -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30925#30925 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] why transform nodes give a big impact to cull time??
Hi John, On Thu, Aug 19, 2010 at 10:06 AM, John Water wrote: > plus, I try just now; I find that animation ive' transform occupy 80~90% > in total transform nodes. some of them are static, some of them are dynamic. > > can I remove or reduce these kind of node( animation ive) when exporting from > 3dMAX using plugin ?? I'll have to defer to others w.r.t Max as I don't have it or have experience of it. Only general comment I can add is that you want all Transform's that you will not be moving to be STATIC, and all moving ones set to DYNAMIC. This DataVariance hint will only affect the FlattenStaticTransformsVisitor, it won't affect your app once it's rendering. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] fade-in/out on Quad/Billboard with ClusterCullingCallback
Hi YT, This type of feature is a little complicated to implement. FadeText has to track the bounding boxes in eye space of the text then sort then and look for overlapping boxes then signal fading in/out accordingly. I'm afraid the source will be the best place to learn about how to do it. Robert. On Thu, Aug 19, 2010 at 5:34 AM, Yun-Ta Tsai wrote: > Hi, > > I am trying to figure out a best practice to implement such feature: > displaying flickr oictures on the Earth globe according to their geo > locations. When the globe turns / zoom, it will reveal or occlude the images > with fade-in/out effect. > > I am trying to follow look for the solution, yet only FadeText example seems > to be close. What would be the best way to do it? My first though is to have > bunch of Quad/Billboard drawable and pin on the Ellipsoid coordinate. Then > assign ClusterCullingCallback to each drawable. For fade-in/out, perhaps > MultiTextureControl would be the best way to go, but I am not sure how to > trigger it when culling happens. > > Thanks for your help. > -YT > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=30911#30911 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Displaying OSG data in MFC window
On Thu, Aug 19, 2010 at 5:54 AM, snehal indurkar wrote: > Thanks.. > But I am able to find this example. > The link i found is not working. > Can you plz post the link here? > Sorry for bothering again... The example is the OpenSceneGraph/examples directory. You need to learn how search for it yourself, it's a basic programming skill. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NITIN R (rangari.niti...@gmail.com) has sent you a private message
Hi All, Sorry about this post, looks pretty much like a malware scam has got in via a address subscribed to the list, so I've unsubscribed the offending address. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] why transform nodes give a big impact to cull time??
Hi, plus, I try just now; I find that animation ive' transform occupy 80~90% in total transform nodes. some of them are static, some of them are dynamic. can I remove or reduce these kind of node( animation ive) when exporting from 3dMAX using plugin ?? thanks a lot. Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30919#30919 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dragger Updated Matrix
Hi Raj, You don't mention which version of the OSG you are using so can't make any specific recommendations. In the svn/trunk and 2.9.x dev series of the OSG the osgManipulator NodeKit has been revamped to make it easier to track changes via callbacks and make it easier to alter associated objects. With these recent OSG rev's, see the osgmanipulator and osgvolume examples for this in action. Robert. On Wed, Aug 18, 2010 at 10:56 PM, Rajesh Darbar wrote: > Hi, > I'm having a scene with many osg::Nodes and i'm using the osgmanipulator > selection and dragger to select an object and then the dragger to drag the > object in the scene. I'm using the linesegmentintersector to check for the > intersections and then to move the objects around the scene. > I would like to know if there is a way to if I can check the selection of a > particular node by the user and also how can I get the updated/transformed > matrix of the node after is dragged and released. Thanks and hope to hear > from you soon. > > Thank you! > > Cheers, > Raj > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=30903#30903 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Hi Rafam I have Android phone so am curious about how well you'll get on, I haven't actually attempted any port - way too many other tasks on my plate to tinker. On Wed, Aug 18, 2010 at 7:59 PM, Rafa Gaitan wrote: > /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp: In member > function 'void osg::Texture::applyTexImage2D_load(osg::State&, GLenum, > const osg::Image*, GLsizei, GLsizei, GLsizei) const': > /Users/rgaitan/Projects/OSG/osg-trunk/src/osg/Texture.cpp:1600: error: > 'GL_RED' was not declared in this scope. > > I'm not sure how to achieve the change, maybe adding and #ifdef and > checking if GLES/GLES2 is active? The other changes I have are only to > allow ndk gcc compiler build correctly so they are minor changes, but > the change on Texture.cpp affects functionality and I'm not sure which > is the better way to achieve it. Once I have things working I will > post on osg-submission the changes ;) You could just add a #ifndef GL_RED #define GL_RED 0x1903 #endif To get the code to compile. It won't do anything as the extension code paths won't be visited, this is the approach I've previously been using to minimize the number of code differences between platforms. Robert, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Building a scene graph for several thousand objects
Hi David, > The octree doesn't seem to have given me much of a performance boost in the > culling department. I am guessing this is because the leaves of the tree > contain so many geometry objects? The octree will only help significantly when the cull traversal is a performance bottleneck and you want to cull as much as the subgraph as quickly as possible and the scene is distributed right across the 3d volume. More usual 3d worlds sit on terrain which limits the height range that things are distributed so the useful of octree is far less, and quad tree is the prefered structure of the scene graph. > I've had a read of the forum and google and have come to the conclusion I > should do something like the following to improve performance: > > 1. Group up my geometry objects to perform "batch rendering" - i.e. render > more than a single face of a single block in one go. I'd go much further than just this, batch rendering for me is pulling together as much vertex and primitive data into a single osg::Geometry as is efficient. The "as is efficient" part vary from app to app. Generally principles to follow is the all the data you are grouping together sit in the local spatial area so the bounding volume remains quick tight for the amount of vertex data in it - think about maximizing vertex density in the bounding volumes. Also consider that the OpenGL driver and graphics hardware will like batches of geometry of a thousands of vertices to tens or even hundreds of thousands, small batches such as 100 or less not efficient at all as the call overheads are very high, and very large batches such as a million vertices or more can lead to OpenGL driver and graphics hardware struggling to managing moving and storing the data around concurrently. Using bigger batches is win from several perspectives - less scene graph nodes to traverse in cull and draw dispatch, less OpenGL commands, better utilization of the graphics hardware. Put too much data together into single really large batches then you can have an impact of culling geometry, as well as potentially stall the graphics pipeline. The sweet spot size will depend upon your apps needs and the type of hardware, but you'll probably be surprised at how big the batches will be for max efficiency. > How can I do this? Do I need to create a single geometry object containing > vertex arrays etc of a whole chunk of block faces? Yep. You even better can still loads of cubes in one osg::Geometry too all with the same local area to keep the density up. If you are putting a thousand to then thousand vertices in a single osg::Geometry then you will probably be doing things pretty efficiently. > 2. Re-use a single geometry object for block faces. Apparently there is code > in osgParticle::PrecipitationEffect which does this - although I haven't > checked it out yet. You could do this, but now the geometry instancing is available in hardware you might be best to just use it instead... > 3. "Instanced rendering" I'm not sure quite what this is about, but is what > osg::Impostor does? I just had a look at osgimpostor.exe for the first time > while writing this, and it seems pretty close to what I want to achieve. Imposters are no longer something I would recommend except for some very specific applications, and even those would be best served by a custom imposter implementation. Geometry instancing is something you should look at though. Also if you don't have to use cubes then perhaps point sprites would be a useful. > I'll be digging into osgimpostor now anyway. :D A decade ago it might have been useful, but not with modern graphics cards. Have a look at osgdrawinstanced and osgpointsprite. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] why transform nodes give a big impact to cull time??
Hi, can I remove all static transform node( use other nodes to replace) from ive model ?? I try osgUtil::Optimizer::FlattenStaticTransformsVisitor to do this, it seems to change some of them, but not of all. any other methods can realize this? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30915#30915 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgdb_ive.dll problem when loading an ive globe in osg app
On Wednesday 18 August 2010 17:26:35 Darko Radiceski wrote: > Hi all, > > My apology if this seems to be a noobish question. I have an osg > application and it seems that is experiencing some problems when i try and > run it on my machine outside visual studio and also other machines. > > I have build osg 2.9.8 and also the plugins for it. If i run osgviewer.exe > on the ive file it loads just fine. > > When i compile my application in debug and release build and run it through > Visual Studio 08 sp1 it runs just fine. > > Now on my machine i get the .exe file and also all the osg dlls and the > plugins and put them in the same folder. I double click on the exe and the > GUI which is in QT starts and i can get to the point to select my globe to > load. > > Then when the application start loading the globe it just dies and i get a > runtime error. I ran the application through Dependency walker and it got > to the point where it says Loading osgdb_ive.dll then an exception is > raised. > > Has anyone seen this before? Any advice on how i can identify what might be > happening? > > Thank you so much to all. Start up your application outside of VS as you did. Then try to attach the VS debugger to this process. Continue to work in your application as you described. When the crash occurs the debugger should be able to show where it crashed, and what the call chain was up to that point. HTH, Magnus ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] osgdb_ive.dll problem when loading an ive globe in osg app
Hi all, My apology if this seems to be a noobish question. I have an osg application and it seems that is experiencing some problems when i try and run it on my machine outside visual studio and also other machines. I have build osg 2.9.8 and also the plugins for it. If i run osgviewer.exe on the ive file it loads just fine. When i compile my application in debug and release build and run it through Visual Studio 08 sp1 it runs just fine. Now on my machine i get the .exe file and also all the osg dlls and the plugins and put them in the same folder. I double click on the exe and the GUI which is in QT starts and i can get to the point to select my globe to load. Then when the application start loading the globe it just dies and i get a runtime error. I ran the application through Dependency walker and it got to the point where it says Loading osgdb_ive.dll then an exception is raised. Has anyone seen this before? Any advice on how i can identify what might be happening? Thank you so much to all. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30887#30887 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] fade-in/out on Quad/Billboard with ClusterCullingCallback
Hi, I am trying to figure out a best practice to implement such feature: displaying flickr oictures on the Earth globe according to their geo locations. When the globe turns / zoom, it will reveal or occlude the images with fade-in/out effect. I am trying to follow look for the solution, yet only FadeText example seems to be close. What would be the best way to do it? My first though is to have bunch of Quad/Billboard drawable and pin on the Ellipsoid coordinate. Then assign ClusterCullingCallback to each drawable. For fade-in/out, perhaps MultiTextureControl would be the best way to go, but I am not sure how to trigger it when culling happens. Thanks for your help. -YT -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30911#30911 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org