Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Hi Art, Art Tevs wrote: Hi Miika, J.P., ok, after hours of thinking and studying of OSG's source code, I have to admit, that this would not be an easy task to solve that issue. The problem is that, even if I am able to restore any FBO attribute, FBOs used by cameras will break the whole thing down :( Imagine this simple scene graph: mainCamera->FBO 1 | +---slaveCamera->FBO 2 -- scene -- Node->FBO 3 | scene So whenever now slaveCamera is activated, the corresponding FBO will be bound. However, the problem is that this FBO is not handled like an Attribute, so that it can be pushed and popped, no it is a hard coded call to enable FBO. Now, whenever I have a node, which uses another FBO, this will cause the traverser to pop the FBO 3 after rendering of Node, and hence even pop the FBO out of the mainCamera. So in order to get rid of circumstances to change OSG code, I decided to patch osgPPU to handle FBOs manually. Hence, now whenever a Unit is rendered, it first pushes current FBO on stack and then activates its own. After rendering is done, it does activates the previous FBO back. Now, Miika, your examples works like a charme. Yeah, I still remember that very first version of osgPPU handled FBOs on its own. However I droped that handling, because there were issues with multithreading. It seems that now, there are no such issue sanymore. So, take a look into current osgPPU svn trunk. Please test it and let me know, if you experience other issues with it. J.P. could you also test new osgPPU in your application. The changes are not trivial and hence may even introduce new bugs (I would expect them in handling of multiple rendering targets). Thanks for the update Art, I will let you know if there are any issues. jp Cheers, Art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16096#16096 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Reset Viewer and Context question
Hi, In my app, I allow user to restart the scene by - keeping all the nodes but disconnect all nodes from the scene root node - recreate new graphic context and composite viewer. - assign the root node to the new viewer. If the user create some object which was created in last session, I will find that node and reconnect it to the scene root. At the moment I have problem to see the reconnected node. It does connected to the root correctly and all the data seems ok. It even shows up in the stats (all number of Group, StateSet are correct). But I just can't see it on the screen. It seems it just didn't get dispatch to the card. By taking a really long shot guess, is there a cache system store in the node? the node think there should be a cache but it's not exist in the new context/viewer? Does anyone able to shine some light on this? Thank you! Cheers, Jimmy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16118#16118 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] could you please tell me how to build osg as static library on win32
my project environment >>> visual studio 2008 professional openscenegraph 2.8.1 I have difficulties in building osg as static library on win32. please tell me how to build osg as static library on win32. thanks in advance;; -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16117#16117 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] runtime error
Hi, I am getting a lot of "Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)" at run time. Can someone tell me how to narrow it down? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16116#16116 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] "X-ray" Design use of OsgPPU
Hi, yes view dependent ok. imagine a vehicle, each geode is a "panel" and the panel has a thickness. i plan to set a "distance" for the "x-ray" and a viewing angle (about "z", assume constant elevation (about "x" or "y"), render a frame and see what interior geometry fraction "shows through" by counting the pixels as the ratio of num of colored pixels. for the next frame, the viewing angle and/or "distance" will change. Note that the "distance" only serves to effect the "power" (vs thickness) of the x-ray so that as the viewing pos is "closer" more "penetration" can occur. i would be interested in how to set this up as a multi-render ppu arrangement. My geometry is in a file, but there are several other nodes i create programmatically to make all this work. My problem is i'm very new with textures and shading and it's difficult to debug, compared to the usual development approach. right now i don't know the best way to set up the shader / texture / pixel objects. I'm ok with the osg nodes and have the transforms and callbacks ok. even the uniforms per geode are ok. i'm looking at depthpeeling and several other examples from osg to find the way to go with the shader pixel analysis parts. ... Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16111#16111 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Hello from New Orleans
I updated this page with the PDF of Wang Rui's presentation. I strongly encourage everyone to take a look at the OSG In Chine presentation. It's amazing to see how big their OSG community is. Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 Jean-Sébastien Guay wrote: Hi all, It was great meeting all of you at the BOF. Great presentations all around, and very encouraging to see such an active community in China. I've started a page on the wiki: http://www.openscenegraph.org/projects/osg/wiki/Support/SIGGRAPH2009 Perhaps people can post their presentations in PDF or send me their presentation personally and I can post it for them. Also if anyone has photos either post them here or to the wiki, or send them to me. Also the page is missing Marc Olano's affiliation (that'll teach me not to take notes) - if someone could tell me or update the page to correct that. J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] "X-ray" Design use of OsgPPU
Hello, Pardon me if I am jumping into the middle of this conversation, but XRay rendering has been done before. Look at shader examples from NVidia and others for volumetric fog and adapt them accordingly. The basic approach is to use the depth buffer and subtraction to render thickness as a bit field depth and then use that depth index for a lookup into your "fog" texture (1D) to produce the desired visual effect. Attenuation of the objects (different material parameters) can be achieved by setting values in texture units 1, 2 or 3 of the model (so you can still look at them visually). Modeling more advanced features of X-Ray light (non-linear falloff, for example) can be accomplished in the 1D lookup texture or it can be extended to a 2D or even 3D texture. Very realistic effects that mix with "real" objects can even be achieved. Hope that helps, - Paul On Aug 11, 2009, at 1:15 PM, Art Tevs wrote: Hello, ryoumans wrote: for the "thickness" it's actually a fixed data for the geometry (not really thickness). It's only thickness in the analogue of the x-ray model. It's geometry dependent data, and for starting out adding this data item and/or having only the one value will do. I'm just looking for the best design using osg. So with that, maybe osgVolume is not necessary. I have userdata and/or node callbacks to get this data for each geometry (e.g., Uniform callback for the vertex shader all using the same var name). OK, but your data must be view dependent. Otherwise how you would imagine to have X-ray like view, if you just have per vertex data? Or maybe I just don't really understand what you would like to have. I found your slicing idea in osgppu interesting. So, given this "thickness" as data and not requiring geometry calculation, how would you see going at it? Giving the thickness of data, I would render the object just as it is and using a shader, I would compute the viewing direction for each pixel (or vertex). Then having your view dependent data (so it would be probably a 6D data, for each position in each viewing direction. Or maybe 5D, for each position on surrounding sphere in each viewing direction) I would just compute color based on this thicknes. I do not see currently any other way of rendering X-ray like 3D models without having thickness data for each viewing direction and viewing position. THe way I proposed, is the way how one could compute this data on the fly. Maybe we can work out an example usng osgPPU so that other people can profit from it ;) cheers, art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16110#16110 ___ 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] [osgPPU] "X-ray" Design use of OsgPPU
Hello, ryoumans wrote: > > for the "thickness" it's actually a fixed data for the geometry (not really > thickness). It's only thickness in the analogue of the x-ray model. It's > geometry dependent data, and for starting out adding this data item and/or > having only the one value will do. I'm just looking for the best design > using osg. So with that, maybe osgVolume is not necessary. I have userdata > and/or node callbacks to get this data for each geometry (e.g., Uniform > callback for the vertex shader all using the same var name). > OK, but your data must be view dependent. Otherwise how you would imagine to have X-ray like view, if you just have per vertex data? Or maybe I just don't really understand what you would like to have. > > I found your slicing idea in osgppu interesting. So, given this "thickness" > as data and not requiring geometry calculation, how would you see going at it? > Giving the thickness of data, I would render the object just as it is and using a shader, I would compute the viewing direction for each pixel (or vertex). Then having your view dependent data (so it would be probably a 6D data, for each position in each viewing direction. Or maybe 5D, for each position on surrounding sphere in each viewing direction) I would just compute color based on this thicknes. I do not see currently any other way of rendering X-ray like 3D models without having thickness data for each viewing direction and viewing position. THe way I proposed, is the way how one could compute this data on the fly. Maybe we can work out an example usng osgPPU so that other people can profit from it ;) cheers, art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16110#16110 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Current state of Collada importer
Hi rosme, I have been looking for the things you are working also. Is it possible for you to ship me the files you have. If so that would be great. ... Thank you! Cheers, Michael -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16109#16109 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PolytopeIntersector "distance" and Transform
Hi Peter, I have no time to work on this either at the moment. I will just avoid the scale transforms and scale the objects 'manually'. Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16108#16108 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] "X-ray" Design use of OsgPPU
Hi, for the "thickness" it's actually a fixed data for the geometry (not really thickness). It's only thickness in the analogue of the x-ray model. It's geometry dependent data, and for starting out adding this data item and/or having only the one value will do. I'm just looking for the best design using osg. So with that, maybe osgVolume is not necessary. I have userdata and/or node callbacks to get this data for each geometry (e.g., Uniform callback for the vertex shader all using the same var name). I found your slicing idea in osgppu interesting. So, given this "thickness" as data and not requiring geometry calculation, how would you see going at it? Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16106#16106 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Using shared OpenGL contexts
Hi, Is it possible in OSG to use shared opengl contexts that are created outside of OSG, and yet declare to OSG that they are sharing their texture spaces (and VBO, etc)? I searched the documentation, but could not find a way to do that. Thank you, Raphael ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] about the bounding sphere of a geode computed by OSG
Gianluca Natale wrote: I cannot completely agree. I mean that I know that the real perfect bounding sphere is computationally expensive, but in many cases (solid objects) it should be computed just once But in many other cases (dynamic geometry) it must be computed each frame. So it really does need to be very fast. If you need a very tight bounding sphere, you could write your own NodeVisitor to create it. But changing OSG to compute and use tight bounding spheres throughout would be a formidable redesign that could take 2-4 engineering months to completely code and test, and while it might improve culling in some cases, it would also harm performance in other cases, so the net result would probably be a wash. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] line intersection performance
Hello Andrew, I am trying to implement something like this, in order to compute hit tests on a line. I don't need to know which objects intersected the line, or get a list of objects/intersections out, just need to know "Is there an intersection or not". The original posts are included below. Would anyone know how I might go about implementing this? I think I had mentioned the files to check in that thread, but if not, have a look at the code in osgUtil::IntersectionVisitor, osgUtil::LineSegmentIntersector and associated classes (some of which are in the source files only). It should be pretty simple to use those as guidance and just return true whenever it can be decided without error that the intersection will succeed. Also if you remove all the calculations that are done in the case an intersection was successful (node path copy, local intersection point and normal, etc.) you might gain a bit too. Note that if you can survive by doing an approximate test, then you could also implement your own subclasses of LineSegmentIntersector/IntersectionVisitor that would only check bounding volumes. That would be much quicker than testing the geometry. If you do need exact tests, then make sure you enable kd-trees for your geometries, this will help greatly. If you end up doing this, please do it in a way that can be re-integrated into OSG since I expect other people will be interested in using this kind of test. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Get the top coordonates from screen of an object
Hi Adrien, I'm trying to put a text on the top of a node, a sort of caption. This caption can be added for mutliple objects without being stacked with other captions. My idea is to add those caption to the global scene by getting the coordinates of the top of the followed node and project the text on the screen from the given coordinates. Are you just trying to get the highest point of a node? If so, just use the center of the node's bounds in X and Y, but the highest point in Z. You can get an approximate solution using // node is your node osg::Vec3 top = node->getBound().center() + node->getBound().radius() * osg::Vec3(0,0,1) This won't work well for objects that are slim but not high (think of a box which is wide and deep but not high, so for example it has a size (100, 100, 1) ). In those cases the text will be too high above the object. You can get closer using the osgUtil::ComputeBoundsVisitor which just visits all drawables under your node and combines their bounding boxes into one bounding box which you can then get. Then using that bounding box, you can just use // bb is the bounding box gotten from the ComputeBoundsVisitor osg::Vec3 top(bb._max.x() - bb._min.x(), bb._max.y() - bb._min.y(), bb._max.z()); This all assumes that you're in Z-up as is default in OSG. If this is not what you wanted, please clarify your question. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ShaderGen and GL3
Jean-Sébastien Guay wrote: Still, your visitor is interesting, extending it would be good, and testing it by having OSG create a GL3 context (perhaps even GL3.1 so that it errors out when using deprecated functionality) would be even better. I've given this some thought, and tried to write this "GL3-safe OSG" app in such a way that, even if OSG does issue deprecated GL1/2 commands (which it certainly does: glMatrixMode and glLight are always called at least once per frame in current osgViewer apps), that it would not affect the execution of the app. GL calls that generate errors have no effect on OpenGL state, so if the app doesn't depend on those functions working, I'd think that the app should still function on a 3.1 context in spite of OSG continuing to issue GL 1/2 calls. But the 3.1 context would help us track down all OSG code that issues GL 1/2 commands. I am meeting with my client next week, the one who is really interested in future-proofing all their new OSG development from this point forward, and it'll be interesting to discuss the road forward with them. I'm looking forward to getting additional funding from this client to pursue this work, such as GL 3.1 context creation in OSG. But this work needs to be prioritized against other work the client has lined up for me, Cheers, -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 360 degree screen captures
I am interested in creating a small OSG programs that will read in a model of whatever type and then render screen captures that would mimic a 360 rotation around the model. I would imagine this would be rather simple to write but my days of writing C++ are rusty at best and my initial attempts have proved to be fruitless (got a bunch of gray screen captures). The basic idea is that I could run a command line program with one argument (the path to the model) and have that do the stepping, say 36 steps of 10 degrees each, taking a screen capture at each step and outputting the sequence to JPG or PNG (i.e. model01.png, model02.png, ...). Are there any kind souls out there that could help me with such a task or know of something that already may do such a thing? Thanks in advance for your help, Wally Atkins -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16101#16101 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using OSGShadow to compute and return a shadow map in a texture or bitmap
I realise this is a bit of a complicated question, but does anyone have any ideas if this is possible with OSG? Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16099#16099 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] line intersection performance
This is an old thread I found when I was searching. It may not be in the forums so I have included the original text below as a quote. I am trying to implement something like this, in order to compute hit tests on a line. I don't need to know which objects intersected the line, or get a list of objects/intersections out, just need to know "Is there an intersection or not". The original posts are included below. Would anyone know how I might go about implementing this? /// A couple of other questions related to intersection performance: ... 2) I need to do line-of-sight tests where I am only interested in whether any intersection exists, and not what those intersections are. This allows for a "trap door" optimization where the search process terminates on the first positive intersection. Is there a way to do that with the current osgUtil::IntersectionVisitor, or do I need to modify it to serve this purpose? Thanks, Peter Hi Jean-Sébastien, Jean-Sébastien Guay wrote: So the answer IMHO would be that in any case, you will want to try and build a good scene graph (both for culling performance and intersection performance). Whether you want to make a global kd-tree for the whole scene will depend on how dynamic your scene is, and if you can take the time to implement it so that only parts that change need updating. In my case I am reading OpenFlight files produced by a third party, so I don't have much control over whether it was constructed efficiently or not. Since the terrain will be static, my thought was to build a mostly static KdTree of scene graph nodes separate from the normal rendering state graph and to be used for culling and intersection tests. I believe a number of other 3D engines use this approach. However my question was really whether something like this already existed in OSG, to which the answer is no. This is not implemented currently. It's another one of those little projects I'd like to do eventually. It's what some publications call "test-intersection" vs "find-intersection". Test-intersection: If all you want to know is if something intersects (for example, for shadow tests in raytracing) some shortcuts can be taken. Find-intersection: If you really want to find all objects that intersect (and potentially then sort by distance so you can get the closest one) (for example, for the main rays in raytracing) then you'd do it more or less the way it's done right now. If you want to implement test-intersection, you could subclass IntersectionVisitor/LineSegmentIntersector, or you could do it directly in these classes as an option and then submit it to OSG. :-) I do need this feature, so I will look into implementing it in osgUtil::IntersectionVisitor. This should be as simple as setting a flag, I think, and modifying the traversal to return as soon as an intersection is found. I will let the list know how it goes. Thanks, Peter /// ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] "X-ray" Design use of OsgPPU
Hi Bob, huh, I would say it depends on your implementation. Currently the way you describe it requires a volumetric rendering approach. The thickness calculation seems to be the most tricky part. If you have your volume data, then use osgVolume for that (I haven't tested it, so I do not know how well it suits your expectations). Other possible solution is to render all your triangles in slices which are perpendicular in viewing direction. So you specify clip planes and render your model in several passes. Of course no backface culling or any other culling except of this clip planes should be active. So you render your slices into a several textures (actually you only need depth values). Using osgPPU you combine all that textures and compute thickness. After all passes (depends on complexity of your model, how much passes you want to use), i.e. 128 passes, you will have as result thickness of each pixel in viewing direction. This thickness texture can then be projected on the model in your scene back. Since hte projection is from the view point, you shouldn't see any big artifacts. So this is a way, how I would try to do it. Maybe there exists better approaches. Cheers, art ryoumans wrote: > Hi, > > I'm trying to come up with a design using OSG to build what i'm calling an > "X-ray" viewer. Basically i have relatively simple geometry, a "shell" or > "skin" of a vehicle and then the "interior." I want to view the interior as > "penetrated" by the X-rays, which is based on a "thickness" calculation and a > "distance" and "aspect" angle, all hopefully done in shaders. I envision the > shaders setting the fragment alpha and/or color when rendering the "shell", > then after to render the "interior" and combine with the "shell" texture to > create the final view, showing through the interior in desired parts. > Finally, i desire to get a histogram of the colors of the interior to see how > the "shell" performed on the x-rays with the interior. > > Do you see this as an appropriate application / use of osgppu? i'm running > osg 2.8.1. will ppu work with that. i've got osgppu 0.4 i think. > > also, i'm thinking i need to create the ppu nodes programmatically instead of > reading ppu files, so i need examples of that type. i'm just starting to > look through them. > > > Thank you! > > Cheers, > Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16098#16098 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Get the top coordonates from screen of an object
Hi Adrien, I'm afraid I don't have an answer for you, but I am about to attempt to do the same thing, so would be interested to hear the answer. Any ideas OSG community? Thanks, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16097#16097 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Hi Miika, J.P., ok, after hours of thinking and studying of OSG's source code, I have to admit, that this would not be an easy task to solve that issue. The problem is that, even if I am able to restore any FBO attribute, FBOs used by cameras will break the whole thing down :( Imagine this simple scene graph: mainCamera->FBO 1 | +---slaveCamera->FBO 2 -- scene -- Node->FBO 3 | scene So whenever now slaveCamera is activated, the corresponding FBO will be bound. However, the problem is that this FBO is not handled like an Attribute, so that it can be pushed and popped, no it is a hard coded call to enable FBO. Now, whenever I have a node, which uses another FBO, this will cause the traverser to pop the FBO 3 after rendering of Node, and hence even pop the FBO out of the mainCamera. So in order to get rid of circumstances to change OSG code, I decided to patch osgPPU to handle FBOs manually. Hence, now whenever a Unit is rendered, it first pushes current FBO on stack and then activates its own. After rendering is done, it does activates the previous FBO back. Now, Miika, your examples works like a charme. Yeah, I still remember that very first version of osgPPU handled FBOs on its own. However I droped that handling, because there were issues with multithreading. It seems that now, there are no such issue sanymore. So, take a look into current osgPPU svn trunk. Please test it and let me know, if you experience other issues with it. J.P. could you also test new osgPPU in your application. The changes are not trivial and hence may even introduce new bugs (I would expect them in handling of multiple rendering targets). Cheers, Art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16096#16096 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBOs without color or depth attachments /DrawBuffer/ ReadBuffer
Hi Wojciech, I was browsing/searching the mailing list and found this topic. A question is interspersed below. Am 07.08.09 18:52, schrieb Wojciech Lewandowski: Hi Robert and J-S and all interested, I have prepared the code for the proposal. There was a bunch of changes to Camera/SceneView/CullVisitor/RenderStage (and few other files). Its not exactly like what we planned because practice once again showed the theories are only work on paper and on the internet;- ). I initially have written the code for lazy updates of DrawBuffer and ReadBuffer to osg::State. But during debugging & reading FBO spec again, I learned that it does not make sense. OpenGL treats DrawBuffer/ReadBuffers as members of FBO state. Buffers are not unique per GL context but each FBO can have them set differently and once FBO is bound its DrawBuffer/ReadBuffer selection is made active. So it won't work to keep them in State. For the first point of our plan I also had to make modifications. Fortunately, as planned, camera uses inheritance DRAW_BUFFER / READ_BUFFER masks. However, RenderStage code seems to not always expect presence of associated camera that would contain valid DrawBuffer/ReadBuffer settings. For this case it was neccessary to add _drawBufferApplyMask / _readBufferApplyMask flags to RenderStage. These flags effectively replace former case of RenderStage::_drawBuffer/RenderStage::_readBuffer being set to GL_NONE. These flags are now used to inform RenderStage to inherit / not touch buffer settings from what was set in prior stage. See the attached code for details. I must admit that this modification eluded me a bit. I hope I did everything properly, but I really count on peer reviews. I have left FORCE_COLOR_ATTACHMENT / FORCE_DEPTH_ATTACHMENT defines in the RenderStage.cpp. I expect that Robert will take decision to remove them or keep them for a while. FORCE_COLOR_ATTACHMENT is set to 0 but FORCE_DEPTH_ATTACHMENT is set to 1. I tested the changes with Viewer Prerender/ Shadow examples. I noticed that when DEPTH_ATTACHMENT is not forced, depth tests in Prerender fail and Cow.osg or Cessna.osg are displayyed with "holes". So it would be necccesary to test all examples using FBOs and check if they require exlpicit setting of depth attachments. Once examples are fixed one may turn off FORCE_DEPTH_ATTACHMENT in RenderStage.cpp. This sounds exactly like the issue I'm currently experiencing. I've already tried to find some help in this topic: http://forum.openscenegraph.org/viewtopic.php?t=3322 I had to create/manage my own FBO since I need a handle to it for various reasons. Basically I'm trying to do RTT. This means my FBO has just a texture2d attached to it (as GL_COLOR_ATTACHMENT). Do you know what the reason for this behaviour is? Am I right that attaching a depth attachment to an FBO solves the issue? What is different in your implementation when FORCE_DEPTH_ATTACHMENT is set? Uff, It was bit exhausting. I have spent 3 days on this stuff and I must admit that it is still undertested. Unfortunatelly, I have to move over to other activities this week. If it becomes neccessary, I will go back to the subject after next weekend. Although I doubt I will be able to do any coding this week but I should be able to stay in touch with forums. I also hope, that in the meantime You will look at these changes, test them and make neccessary tweaks or send me requests for aditional changes. Cheers, Wojtek Thanks for any help. Mathias Buhr ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Material editor/designer?
Anybody know of a osg compatible material editor/designer? Repeating the edit/compile/link/curse cycle is starting to get a little tedious. I'm sure I saw a post about one not so long ago, but I'm damned if I can find it now. tia. -- http://www.ssTk.co.uk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer.frame() rendering not complete
Hi, I save it in a file. The problem is with frame(). If I call viewer.run() and hit Esc to quit the viewer the image is complete. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16092#16092 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer.frame() rendering not complete
wrote: > Hi, > > I have a code that creates a temporary viewer and uses it to render one frame > and copy from the color buffer to an image. When I call viewer.frame() the > rendered image is only half done. Is there anyone to tell the viewer to > complete a frame, save it and close itself? > > Thank you! > > Cheers, > Rabbi Hi, How do you visualize your color image? Are you sure you allocated it with the good width and height? Cheers, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16091#16091 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] "X-ray" Design use of OsgPPU
Hi, I'm trying to come up with a design using OSG to build what i'm calling an "X-ray" viewer. Basically i have relatively simple geometry, a "shell" or "skin" of a vehicle and then the "interior." I want to view the interior as "penetrated" by the X-rays, which is based on a "thickness" calculation and a "distance" and "aspect" angle, all hopefully done in shaders. I envision the shaders setting the fragment alpha and/or color when rendering the "shell", then after to render the "interior" and combine with the "shell" texture to create the final view, showing through the interior in desired parts. Finally, i desire to get a histogram of the colors of the interior to see how the "shell" performed on the x-rays with the interior. Do you see this as an appropriate application / use of osgppu? i'm running osg 2.8.1. will ppu work with that. i've got osgppu 0.4 i think. also, i'm thinking i need to create the ppu nodes programmatically instead of reading ppu files, so i need examples of that type. i'm just starting to look through them. Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16090#16090 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Need help including COLLADA support
Hi wally, Which of the COLLADA_* values are filled in by CMake initially? And after you specify the proper COLLADA_DOM_ROOT manually? In your case COLLADA_DOM_ROOT should point to Z:/OpenSceneGraph-2.8.1/ collada-dom-2.2/dom -- Roland -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16089#16089 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Need help including COLLADA support
I have tinkered a little bit further and set a bunch of the COLLADA_*_LIBRARY values manually and appear to have gotten further. The only thing that it is saying now is: Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) Should I add these entries? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16088#16088 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Need help including COLLADA support
Currently I have this structure: Code: Z:\OpenSceneGraph-2.8.1\ - 3rdParty\ - applications\ - bin\ - CMakeFiles\ - CMakeModules\ - collada-dom-2.2\ - collada-dom\ - dom\ - fx\ - ... - doc\ - examples\ - include\ - lib\ - OpenScenGraph\ - packaging\ - PlatformSpecifics\ - src\ - Xcode\ - ALL_BUILD.vcproj - ... In CMake 2.6 it originally had COLLADA_DOM_ROOT set as "dom/" but I have changed that several times trying to make it happy. Also, I have set the environment variable COLLADA_DIR to "Z:\OpenSceneGraph-2.8.1\collada-dom-2.2\collada-dom\dom\" I appreciate your assistance, Wally -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16086#16086 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer invisible?
Hi Rabbi, How can I set a viewer invisible for RTT? This is an FAQ. Create a pbuffer graphics context. Please search the archives for more details. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] viewer invisible?
Hi, How can I set a viewer invisible for RTT? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16084#16084 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] viewer.frame() rendering not complete
Hi, I have a code that creates a temporary viewer and uses it to render one frame and copy from the color buffer to an image. When I call viewer.frame() the rendered image is only half done. Is there anyone to tell the viewer to complete a frame, save it and close itself? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16083#16083 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Turning off main osgViewer camera
Try setting the main camera node mask to 0 when you don't want it to render and 0x when you do. Brian This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. • -osg-users-boun...@lists.openscenegraph.org wrote: - To: OpenSceneGraph Users From: "J.P. Delport" Sent by: osg-users-boun...@lists.openscenegraph.org Date: 08/11/2009 10:15AM Subject: Re: [osg-users] Turning off main osgViewer camera Hi, sorry I might have answered too fast. What do you want the main camera to render when you are taking screenshots? What is it rendering when when you only attach the FBO camera? AFAIK you still need to call viewer frame() to trigger the FBO, but you can make the main camera just render nothing. If you want to run an FBO camera without creating a window, then consider the pbuffer option for the main frame buffer. See also maybe the osgscreencapture example. jp J.P. Delport wrote: > Hi, > > have a look at the osgautocapture example. Set the main camera to render > offscreen, pbuffer. > > jp > > jake chambers wrote: >> Hi, >> >> I have an application where I setup a "normal" osgViewer view with >> setUpViewOnSingleScreen(). This works fine. >> >> I also create an FBO camera to which I add my scene. When I want to >> take a screenshot of the application I call >> osgviewer->setSceneData(myFBOCamera) and render via >> osgviewer->eventTraversal() / updateTraversal() / >> renderingTraversals(). After I get the screenshot I restore my normal >> scene with osgviewer->setSceneData(mySceneData). This also works fine >> for taking screenshots. >> >> What I want to do now is to turn off the "main" camera whilst I render >> the FBO (ie if I create a lot of screenshots for a movie I don't want >> to render to the screen). How can I turn off the main camera and >> render only to the FBO? >> I've tried calling osgviewer->setCamera(NULL) without sucess. Indeed >> when I meddle with the main camera I dont get a valid image from my >> FBO. I think this makes sense as the FBO is under the main camera(?). >> I also tried calling osgviewer->setCamera(myFBO) but no luck that way >> either. I also can't restore the original camera to the osgviewer. >> >> Perhaps I am solving the problem the wrong way - is there a better >> method? Perhaps having two seperate osgViewer objects? But then I >> think I have only one conceptual "View" (my FBO always shows the same >> view as the main camera, it's only a question of if the main camera >> should render an image or not), so having one Viewer, one View and two >> Cameras feels correct - it's just that it doesn't work :-) >> >> >> Thank you! >> >> Cheers, >> jake >> >> -- >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=16079#16079 >> >> >> >> >> >> ___ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Turning off main osgViewer camera
Hi, sorry I might have answered too fast. What do you want the main camera to render when you are taking screenshots? What is it rendering when when you only attach the FBO camera? AFAIK you still need to call viewer frame() to trigger the FBO, but you can make the main camera just render nothing. If you want to run an FBO camera without creating a window, then consider the pbuffer option for the main frame buffer. See also maybe the osgscreencapture example. jp J.P. Delport wrote: Hi, have a look at the osgautocapture example. Set the main camera to render offscreen, pbuffer. jp jake chambers wrote: Hi, I have an application where I setup a "normal" osgViewer view with setUpViewOnSingleScreen(). This works fine. I also create an FBO camera to which I add my scene. When I want to take a screenshot of the application I call osgviewer->setSceneData(myFBOCamera) and render via osgviewer->eventTraversal() / updateTraversal() / renderingTraversals(). After I get the screenshot I restore my normal scene with osgviewer->setSceneData(mySceneData). This also works fine for taking screenshots. What I want to do now is to turn off the "main" camera whilst I render the FBO (ie if I create a lot of screenshots for a movie I don't want to render to the screen). How can I turn off the main camera and render only to the FBO? I've tried calling osgviewer->setCamera(NULL) without sucess. Indeed when I meddle with the main camera I dont get a valid image from my FBO. I think this makes sense as the FBO is under the main camera(?). I also tried calling osgviewer->setCamera(myFBO) but no luck that way either. I also can't restore the original camera to the osgviewer. Perhaps I am solving the problem the wrong way - is there a better method? Perhaps having two seperate osgViewer objects? But then I think I have only one conceptual "View" (my FBO always shows the same view as the main camera, it's only a question of if the main camera should render an image or not), so having one Viewer, one View and two Cameras feels correct - it's just that it doesn't work :-) Thank you! Cheers, jake -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16079#16079 ___ 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] Turning off main osgViewer camera
Hi, have a look at the osgautocapture example. Set the main camera to render offscreen, pbuffer. jp jake chambers wrote: Hi, I have an application where I setup a "normal" osgViewer view with setUpViewOnSingleScreen(). This works fine. I also create an FBO camera to which I add my scene. When I want to take a screenshot of the application I call osgviewer->setSceneData(myFBOCamera) and render via osgviewer->eventTraversal() / updateTraversal() / renderingTraversals(). After I get the screenshot I restore my normal scene with osgviewer->setSceneData(mySceneData). This also works fine for taking screenshots. What I want to do now is to turn off the "main" camera whilst I render the FBO (ie if I create a lot of screenshots for a movie I don't want to render to the screen). How can I turn off the main camera and render only to the FBO? I've tried calling osgviewer->setCamera(NULL) without sucess. Indeed when I meddle with the main camera I dont get a valid image from my FBO. I think this makes sense as the FBO is under the main camera(?). I also tried calling osgviewer->setCamera(myFBO) but no luck that way either. I also can't restore the original camera to the osgviewer. Perhaps I am solving the problem the wrong way - is there a better method? Perhaps having two seperate osgViewer objects? But then I think I have only one conceptual "View" (my FBO always shows the same view as the main camera, it's only a question of if the main camera should render an image or not), so having one Viewer, one View and two Cameras feels correct - it's just that it doesn't work :-) Thank you! Cheers, jake -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16079#16079 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Turning off main osgViewer camera
Hi, I have an application where I setup a "normal" osgViewer view with setUpViewOnSingleScreen(). This works fine. I also create an FBO camera to which I add my scene. When I want to take a screenshot of the application I call osgviewer->setSceneData(myFBOCamera) and render via osgviewer->eventTraversal() / updateTraversal() / renderingTraversals(). After I get the screenshot I restore my normal scene with osgviewer->setSceneData(mySceneData). This also works fine for taking screenshots. What I want to do now is to turn off the "main" camera whilst I render the FBO (ie if I create a lot of screenshots for a movie I don't want to render to the screen). How can I turn off the main camera and render only to the FBO? I've tried calling osgviewer->setCamera(NULL) without sucess. Indeed when I meddle with the main camera I dont get a valid image from my FBO. I think this makes sense as the FBO is under the main camera(?). I also tried calling osgviewer->setCamera(myFBO) but no luck that way either. I also can't restore the original camera to the osgviewer. Perhaps I am solving the problem the wrong way - is there a better method? Perhaps having two seperate osgViewer objects? But then I think I have only one conceptual "View" (my FBO always shows the same view as the main camera, it's only a question of if the main camera should render an image or not), so having one Viewer, one View and two Cameras feels correct - it's just that it doesn't work :-) Thank you! Cheers, jake -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16079#16079 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Need help including COLLADA support
dfu23 wrote: > > http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/Collada > Maybe there's fault in that documentation or the way the CMake file configuration works. There have been some changes to the CMake files after this wiki page was written. dfu23 wrote: > > I'm using VC++ 2008 Express Edition > I have downloaded and built the Collada DOM > I have set the environment variable on Windows > Which of the COLLADA_* values are filled in by CMake? If the COLLADA_DIR environment variable points to the proper Collada DOM install directory all should be filled in by CMake automatically. If that does not work specify that directory by hand by setting the COLLADA_DOM_ROOT in CMake and selecting Configure. If that doesn't work you can always manually set the all files although it's a big list, but in this case the Collada CMake files contain an error. kind regards, Roland Smeenk -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16080#16080 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] Need help including COLLADA support
Hi, I am having issues with adding the DAE (Collada) plugin to my project. I have been following the step-by-step instructions located here: http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/Collada I'm using VC++ 2008 Express Edition I have downloaded and built the Collada DOM I have set the environment variable on Windows I cannot get CMake to find the addition of Collada so I can add it to my OSG project. There must be something simple that I am missing. Any thoughts? Thanks, Wally -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16078#16078 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Get the top coordonates from screen of an object
Hi, I'm trying to put a text on the top of a node, a sort of caption. This caption can be added for mutliple objects without being stacked with other captions. My idea is to add those caption to the global scene by getting the coordinates of the top of the followed node and project the text on the screen from the given coordinates. Here are my questions: Have you got a better idea? How can I get the top of the Node directly (I thought to use the LineSegment and BoundingSphere)? Is there an easier (and better for performances) way to get them? Thank you for your answers! Cheers, Adrien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16077#16077 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] about the bounding sphere of a geode computed by OSG
This is how it is in OSG and all other Scene graphs I have ever worked with and I have work with most Without meaning to sound rude, I would say Get used to it in OSG as it not likely to change in how's its done Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Gianluca Natale Sent: Tuesday, August 11, 2009 6:36 AM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] about the bounding sphere of a geode computed by OSG I cannot completely agree. I mean that I know that the real perfect bounding sphere is computationally expensive, but in many cases (solid objects) it should be computed just once (since BoundingSphere& node::getBound() checks if the bounding sphere has been already computed), when the object is created. The global bounding sphere might affect the fitting operation a lot. In case of objects like spheres or discs, the bounding sphere computed by OSG might be much greater than strictly required. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Simon Hammett Sent: martedì 11 agosto 2009 12.00 To: OpenSceneGraph Users Subject: Re: [osg-users] about the bounding sphere of a geode computed by OSG Calculating the perfect bounding sphere is an expensive operation. You need to calc the convex hull which is O(n log n). osg uses a fast approximation which is generally good enough. 2009/8/11 Gianluca Natale : > Hi All, > I'm having problem computing the global bounding sphere of my model. > I debugged OSG (2.8.0) and discovered that the bounding sphere of a > geode (BoundingSphere Geode::computeBound()) is computed as the > bounding sphere of the bounding box that includes all its drawables > !?! > > > > Why that? > > Shouldn't it be the global bounding sphere of the drawables, merging > the single bounding spheres of all the drawables? > > > > So, a drawable that represents a sphere should have as bounding sphere > itself, but this is not true with the computation OSG performs. It is > larger than strictly required. > > > > Thanks, > Gianluca Natale > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > org > > -- http://www.ssTk.co.uk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.49/2295 - Release Date: 08/10/09 18:19:00 ___ 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] about the bounding sphere of a geode computed by OSG
Like ALL scene graphs out there the OSG uses an approximation ( for Scenegraph performance reasons) to produce a bounding sphere that is ensured to encompass all its children but not necessarily tightly, and this is fine for 99% of bounding sphere usage in a scene graph If you want a tight and much more accurate bound sphere and or bounding box then you will need to calculate this your self Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Gianluca Natale Sent: Tuesday, August 11, 2009 4:32 AM To: Osg Users Subject: [osg-users] about the bounding sphere of a geode computed by OSG Hi All, I'm having problem computing the global bounding sphere of my model. I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode (BoundingSphere Geode::computeBound()) is computed as the bounding sphere of the bounding box that includes all its drawables !?! Why that? Shouldn't it be the global bounding sphere of the drawables, merging the single bounding spheres of all the drawables? So, a drawable that represents a sphere should have as bounding sphere itself, but this is not true with the computation OSG performs. It is larger than strictly required. Thanks, Gianluca Natale ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] about the bounding sphere of a geode computed by OSG
I cannot completely agree. I mean that I know that the real perfect bounding sphere is computationally expensive, but in many cases (solid objects) it should be computed just once (since BoundingSphere& node::getBound() checks if the bounding sphere has been already computed), when the object is created. The global bounding sphere might affect the fitting operation a lot. In case of objects like spheres or discs, the bounding sphere computed by OSG might be much greater than strictly required. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Simon Hammett Sent: martedì 11 agosto 2009 12.00 To: OpenSceneGraph Users Subject: Re: [osg-users] about the bounding sphere of a geode computed by OSG Calculating the perfect bounding sphere is an expensive operation. You need to calc the convex hull which is O(n log n). osg uses a fast approximation which is generally good enough. 2009/8/11 Gianluca Natale : > Hi All, > Im having problem computing the global bounding sphere of my model. > I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode > (BoundingSphere Geode::computeBound()) is > computed as the bounding sphere of the bounding box that includes all its > drawables !?! > > > > Why that? > > Shouldnt it be the global bounding sphere of the drawables, merging the > single bounding spheres > of all the drawables? > > > > So, a drawable that represents a sphere should have as bounding sphere > itself, > but this is not true with the computation OSG performs. It is larger than > strictly required. > > > > Thanks, > Gianluca Natale > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- http://www.ssTk.co.uk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.49/2295 - Release Date: 08/10/09 18:19:00 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
J.P. Delport wrote: > > sorry, I have not had time to run your test app, just thinking out loud... > > what happens if stage 3 is again a pre-render RTT camera with the > processor as a child and you then use the viewer camera only to display > the final output quad? Have you tried commenting out the osgPPU setting > of bin numbers? > I tried this and some other similar trickery but, again, just when it seems to be almost working it adds that FBO 0 call. Doing it this way just moves the problem away from the main camera, to the newly added second RTT camera which now tries to draw directly to the screen. Looking forward for that patch Art, hopefully you can work something out of it. :) That certainly sounds like it would be more correct behavior for OSG in general too. Thanks, Miika -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16073#16073 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] about the bounding sphere of a geode computed by OSG
Calculating the perfect bounding sphere is an expensive operation. You need to calc the convex hull which is O(n log n). osg uses a fast approximation which is generally good enough. 2009/8/11 Gianluca Natale : > Hi All, > I’m having problem computing the global bounding sphere of my model. > I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode > (BoundingSphere Geode::computeBound()) is > computed as the bounding sphere of the bounding box that includes all its > drawables !?! > > > > Why that? > > Shouldn’t it be the global bounding sphere of the drawables, merging the > single bounding spheres > of all the drawables? > > > > So, a drawable that represents a sphere should have as bounding sphere > itself, > but this is not true with the computation OSG performs. It is larger than > strictly required. > > > > Thanks, > Gianluca Natale > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- http://www.ssTk.co.uk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Hi Art, Art Tevs wrote: I am decided to work out some patch for osg to support this. OSG is capable of pushing and popping of texture attributes while traversing the graph. The same thing must also happen for the FBOs. Of course, some elegant solution which covers almost anything is better, however I htink only pushing and popping the FBOs is already what everybody needs ;) just a note. Wojtek has also been working on some updates to the FBO code/management, see the thread on users and the submission: Re: [osg-submissions] [osg-users] FBOs without color or depth attachments /DrawBuffer/ ReadBuffer I am not sure if your updates are complementary or totally orthogonal. regards jp -- 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] [HELP] Cull time in stats?
Hi there, Sorry to interrupt, I have a similar issue with a flat scene graph and it's on my "Todo" list to remove position attitude transforms and flatten them onto the Geodes. My application is a CAD style application, with a scene graph that consists of 300,000 objects, each object is 1x PAT, 1x Geode and 1x Geometry, each Geometry is about 100 vertices (average) and multiple primitives. Each "Object" is wrapped in a class I have defined that contains the OSG nodes. The PAT's are used to position the objects, however I only actually need them when updating an objects position via picking/manipulating and also in-code manipulation. I was thinking to store the position/attitude/scale in my wrapper class and when they are updated, get the geometry vertices, inverse transform them with the old matrixtransform, and forward transform them with a new matrix transform. Does this sound like a feasible way of removing the Pats? Thank you, Andrew On Tue, Aug 11, 2009 at 1:29 AM, Jean-Sébastien Guay < jean-sebastien.g...@cm-labs.com> wrote: > Hi Jimmy, > > Regarding of having a flat scene graph. Does it matter if the whole scene >> will always be seen? Would it still improve the performance if I balance the >> scene graph more? >> > > In the case where the whole scene will always be seen (think about it > carefully, though, because I think these cases should be rare in practice) > then balancing the graph will not help, but removing groups and transforms > will. That is to say, if all your objects will always be visible, then in > order to reduce the cull time you need to reduce the number of objects to > traverse to get to the geometry. To reduce the draw time, you need to group > geometry so that data is uploaded to the card in good-sized chunks. > > So for example, if two objects will always be in the same position relative > to one another, place both in the same osg::Geometry, transforming the > vertices of the second one to be where the transform would have placed it > relative to the first. > > Say object 0 has vertex array V0 and object 1 has vertex array V1, and > suppose that object 0 is at world position T0 and object 1 is at position > T1, then you can build a vertex array V2 containing the vertices of both > objects like this: > > V2 = (V0, V1 + (T1 - T0)) > > (suppose the addition above will apply the same translation to all vertices > in V1) and then position the composite object at position T0. > > You can extend this if you have groups of many objects that will always be > in the same relative position from each other, of course. For example if a > city has buildings and all the buildings are static in world space, then > place them all in the world coordinate frame with no transforms or groups. > They can still be in different geometry objects if they have a sufficient > number of vertices (thousands). If not, then group several of them in the > same geometry object and use a texture atlas to texture them all with the > same texture file. > > Similar scene graph optimization tips have been discussed in the past on > the list. The archives should contain even more tips. I don't know if there > is a wiki page on openscenegraph.org that collects such tips, but if there > isn't we should create one... > > Hope this helps, > > J-S > -- > __ > Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com > http://www.cm-labs.com/ >http://whitestar02.webhop.org/ > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Hi Miika, miika wrote: > Alright, thanks. At least I know what it's about now, it was driving me crazy > because I had no idea whether it was because of me or osgPPU or OSG itself. I > guess I'll have to try and hack together something that sort of circumvents > the more elegant structures of OSG to handle this for the time being. Or > perhaps just take a more deferred route, so that the actual shading itself is > more like a post process too. Drop a line in this thread or somewhere if > there's some progress with this issue someday. > I am decided to work out some patch for osg to support this. OSG is capable of pushing and popping of texture attributes while traversing the graph. The same thing must also happen for the FBOs. Of course, some elegant solution which covers almost anything is better, however I htink only pushing and popping the FBOs is already what everybody needs ;) > > Also while I'm at it, something unrelated... Was there any clean way to > enable trilinear filtering in osgPPU? It's pretty useful for quick and dirty > variable sized blurring with mipmaps in some post processing things. osgPPU > seems to explicitly disable it in UnitInMipmapOut::enableMipmapGeneration(), > I got around that by modifying one of the values there to > LINEAR_MIPMAP_LINEAR but that't not a very nice solution of course. Could > there be an option to set that, for example? > Currently there is no such direct way. You could do this by changing the texture parameters of output textures (or input) of ppus. So not changing the default values in osgPPU, but just changing the texture settings later. Other way would be that you add this functionality to osgPPU and I would include it into the repository ;) Cheers, art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16069#16069 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] about the bounding sphere of a geode computed by OSG
Hi All, I'm having problem computing the global bounding sphere of my model. I debugged OSG (2.8.0) and discovered that the bounding sphere of a geode (BoundingSphere Geode::computeBound()) is computed as the bounding sphere of the bounding box that includes all its drawables !?! Why that? Shouldn't it be the global bounding sphere of the drawables, merging the single bounding spheres of all the drawables? So, a drawable that represents a sphere should have as bounding sphere itself, but this is not true with the computation OSG performs. It is larger than strictly required. Thanks, Gianluca Natale ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Hi, Miika Aittala wrote: Ok, here's a little example (code is attached). Sorry if it's a bit contrived, I couldn't think of anything simple but illustrative. Basically it renders a cylinder with the following stages: 1) Render the cylinder to a texture from slaveCamera 2) Process the texture from stage 1 with firstProcessor, inverting the colors 3) Render the cylinder to a texture from viewer->camera, this time using the result of stage 2 as a texture 4) Process the texture from stage 3 with secondProcessor, which makes the image look wavy The problem is that instead of this ordering, we get 1-3-2-4, which means that the pre-render result is always from the previous frame. If you compile and run the program, you'll notice that this causes a green fringe at the edges of the cylinder when you make it move (because the background color of the texture is green). Here's an image of this whole thing: http://a.imagehost.org/view/0333/osgppukuva To fix this problem, we can try to add firstProcessor as a child of slaveCamera instead of root, as explained in my previous posts. However, this somehow breaks stage 3, which refuses to render to a texture anymore. sorry, I have not had time to run your test app, just thinking out loud... what happens if stage 3 is again a pre-render RTT camera with the processor as a child and you then use the viewer camera only to display the final output quad? Have you tried commenting out the osgPPU setting of bin numbers? jp -- 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] PolytopeIntersector "distance" and Transform
Hi Andrew, Andrew Cunningham schrieb: Hi Peter, Did you ever work up a fix for this? ... I had a partial fix which helped as long as there is no projection involved. Unfortunately that is probably the main use-case... I think the proper way to do this involves storing the inverse matrices in the result- structure and back-transforming the intersection points before sorting. Right now I do not have much time to work on PolytopeIntersector, but if you want to fix it yourself I could describe my idea in more detail. It should not be hard (no hairy math involved). Thank you! Cheers, Andrew Cheers, Peter -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Running the processor between pre-render and main render
Alright, thanks. At least I know what it's about now, it was driving me crazy because I had no idea whether it was because of me or osgPPU or OSG itself. I guess I'll have to try and hack together something that sort of circumvents the more elegant structures of OSG to handle this for the time being. Or perhaps just take a more deferred route, so that the actual shading itself is more like a post process too. Drop a line in this thread or somewhere if there's some progress with this issue someday. Cool technique and video by the way, that and the others. :) Also while I'm at it, something unrelated... Was there any clean way to enable trilinear filtering in osgPPU? It's pretty useful for quick and dirty variable sized blurring with mipmaps in some post processing things. osgPPU seems to explicitly disable it in UnitInMipmapOut::enableMipmapGeneration(), I got around that by modifying one of the values there to LINEAR_MIPMAP_LINEAR but that't not a very nice solution of course. Could there be an option to set that, for example? - Miika -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16065#16065 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org