Re: [osg-users] osgPPU CUDA Example - slower than expected?
Hi, I don't have any other suggestions than to use a GL debugger to make sure nothing is going to CPU or to try the new CUDA functions in osgPPU or your own code. I remember something in the GL to CUDA stuff bugging me, but cannot remember the details. AFAIR something was converting from texture to PBO and then to CUDA mem. jp On 16/12/10 13:25, Thorsten Roth wrote: Hi, as I explained in some other mail to this list, I am currently working on a graph based image processing framework using CUDA. Basically, this is independent from OSG, but I am using OSG for my example application :-) For my first implemented postprocessing algorithm I need color and depth data. As I want the depth to be linearized between 0 and 1, I used a shader for that and also I render it in a separate pass to the color. This stuff is then fetched from the GPU to the CPU by directly attaching osg::Images to the cameras. This works perfectly, but is quite a bit slow, as you might already have suspected, because the data is also processed in CUDA kernels later, which is quite a back and forth ;-) In fact, my application with three filter kernels based on CUDA (one gauss blur with radius 21, one image subtract and one image pseudo-add (about as elaborate as a simple add ;-)) yields about 15 fps with a resolution of 1024 x 1024 (images for normal and absolute position information are also rendered transferred from GPU to CPU here). So with these 15 frames, I thought it should perform FAR better when avoiding that GPU - CPU copying stuff. That's when I came across the osgPPU-cuda example. As far as I am aware, this uses direct mapping of PixelBuferObjects to cuda memory space. This should be fast! At least that's what I thought, but running it at a resolution of 1024 x 1024 with a StatsHandler attached shows that it runs at just ~21 fps, not getting too much better when the cuda kernel execution is completely disabled. Now my question is: Is that a general (known) problem which cannot be avoided? Does it have anything to do with the memory mapping functions? How can it be optimized? I know that, while osgPPU uses older CUDA memory mapping functions, there are new ones as of CUDA 3. Is there a difference in performance? Any information on this is appreciated, because it will really help me to decide wether I should integrate buffer mapping or just keep the copying stuff going :-) Best Regards -Thorsten ___ 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] File Size Limit on OSG::Image?
Hi, On 23/12/10 04:19, Blake Mason wrote: If you just need to create a high resoultion rendering from of a single frame, you can modify the camera's projection matrix to capture many smaller segments, something like this: camera-setProjectionMatrix(projMat * osg::Matrix::scale(xSegments, ySegments, 1.0) * osg::Matrix::translate((float)(xSegments) - segmentX*2.0f - 1.0, (float)(ySegments) - segmentY*2.0f - 1.0, 0.0)); I got this idea from the osgcamera example. You can then save an image for each segment with osgDB::writeImageFile and then piece it together with another image editing program. there is also osgposter that does this for you. rgds jp On 2010-12-21 11:30, Geoff Rhodes wrote: Hi, I am currently working on creating a poster image from several images and the file size is pretty large. Currently the one I am trying to create is 65250 wide x 22500 pixels in height (Image needs to be large) Currently I am doing the following: Code: posterImage = new osg::Image; posterImage-allocateImage( (mHeight), (mWidth), 1, GL_RGBA, GL_UNSIGNED_BYTE ); Right now it is giving me an exception when trying to allocate that image. Is there a size limit on it, or am I doing something wrong? ... Thank you! Cheers, Geoff -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35036#35036 ___ 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 message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] VPB vs osgEarth...
Hi, On 27/12/10 20:37, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: Glenn and Robert, Thanks much for the input. I'll try out osgEarth to see how it works in a small app I have... I've found osgearth_cache useful to pre-build pyramids. rgds jp Thanks again, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Glenn Waldron Sent: Thursday, December 23, 2010 3:22 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] [vpb] VPB vs osgEarth... Shayne, Whether you get a palpable performance hit depends on a lot of factors. One of osgEarth's features is the ability to pull data from web mapping services (similar to Googe Maps). That type of data is pre-tiled into raster pyramids - which is what VPB does too. So if your source data is similarly prepared, you can achieve loading speeds comparable to a pre-generated terrain model. osgEarth includes tools for that. osgEarth's caching stores multi-resolution pyramids of source data, so if you have to ingest expensive data it will only be a performance hit the first time through. If you're loading flat files - GeoTIFFs, DEMs, etc - then there is some processing overhead in pulling in the data, especially if it needs reprojecting. But otherwise, you might be surprised at how fast is actually is. It is worth mentioning that osgEarth is not just a terrain engine, but a whole toolkit. It includes an API for coordinate conversion, support for vector features, utilities for clamping, a programmable manipulator, plugins for lots of web- and file-based data sources, and shader composition support. Glenn Waldron : Pelican Mapping On Thu, Dec 23, 2010 at 2:59 PM, Shayne Tuellershayne.tuel...@hill.af.mil wrote: All, Up to this point, we've used VPB for building our databases that our OSG app uses. However, I've contemplated taking a look at osgEarth for future consideration. My question is, is what advantages are there for using osgEarth vs. VPB? I understand that source content (DTED, GeoTiff, etc.) is loaded on the fly in osgEarth but doesn't that hurt performance when compared to a statically built database done with VPB? Thanks for any input in advance... -Shayne ... Thank you! Cheers, Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35137#35137 ___ 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 message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Terrain creation procedure in vpb
Hi, I suggest you manipulate your input data using gdal tools and then just stick the results into vpb. Trying to align and crop data in vpb is difficult. jp On 31/12/10 12:08, Vijeesh Theningaledathil wrote: Hi Martin, Thanks for your information, I'll try with better resolution imagery Thank you! Cheers, Vijeesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35238#35238 ___ 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] PagedLOD problem (setFileName vs addChild)
On Sun, Jan 2, 2011 at 1:56 PM, Anders olofsson anders.olofs...@biologigrand.ac wrote: Hi, I have a set of terraintiles (wavefront obj meshes) with 2 lods wich I'm trying to use with the PagedLOD node like this: I know that you are trying to set up a simple test, but some aspects of your test are quite far from the optimal scene graph usage, so you might want to take those into account. Code: osg::Node* land1 = osgDB::readNodeFile(land1.obj); osg::Node* land2 = osgDB::readNodeFile(land2.obj); Here, I'm sure you know that you are sharing these two objects among all the nodes in the scene graph, and they will only be loaded once. Also, OSG will be able to optimize graphics state changes among the 2736 instances of each model. The database pager, which you are using in your second example, will load new files in each PagedLOD unless you use an object cache. Those files will not share graphics state unless you use another option, the SharedState manager. osg::PagedLOD* tiles[48*57]; osg::MatrixTransform *xform[48*57]; int i=0; for (int y=0;y48;y++) { for (int x=0;x57;x++) { tiles[i]=new osg::PagedLOD; tiles[i]-addChild(land1,0,2); tiles[i]-addChild(land2,2,4); Note that PagedLOD expects the further (less detailed) LODs to come first in the list. I think that you will force both files to be loaded even though the less detailed LOD is the only one in range. xform[i]=new osg::MatrixTransform; xform[i]-setMatrix( osg::Matrix::translate(x*2, y*2, 0.0f) ); xform[i]-addChild(tiles[i]); root-addChild(xform[i]); The cull traversal will have to traverse 2736 nodes to determine visibility. This is not considered a well-balanced scene graph. Usually we try to set up a quad-tree organization in the scene graph. i++; } } I translate the tile because each tile is centered around 0,0,0. Now, this works just fine, no performance problem at all but as you can see I preload the meshes and use addChild(). It's not clear what you mean by no performance problem :) I would like to use setFileName, something like this: Code: osg::PagedLOD* tiles[48*57]; osg::MatrixTransform *xform[48*57]; int i=0; for (int y=0;y48;y++) { for (int x=0;x57;x++) { tiles[i]=new osg::PagedLOD; tiles[i]-setFileName( 0, land1.obj ); tiles[i]-setRange( 0, 0, 2); tiles[i]-setFileName( 1, land2.obj ); tiles[i]-setRange( 1, 2, 4); xform[i]=new osg::MatrixTransform; xform[i]-setMatrix( osg::Matrix::translate(x*2, y*2, 0.0f) ); xform[i]-addChild(tiles[i]); root-addChild(xform[i]); i++; } } This works too but performance is allot worse, the loading of the meshes is causing stuttering of the view/animation. And the tiles takes a long time to load (3 seconds before the first tile shows up). One thing you should do is manually set a bounding sphere on the PagedLOD node. Otherwise OSG will need to load the file to calculate a bounding sphere! Needless to say, you are loading a large number of files when OSG starts up. I dont want to preload all the tiles since that kind of defeats the whole idea with PagedLODs. In the above example I use the same 2 lod meshes for all tiles, this will change if/when I get the setFileName example to work. Am I doing something utterly wrong? Hope this gives you some ideas... Tim ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 2.9.11 and CEGUI 0.7.5
Hi, I'm updating my projects to this version of OSG, and now I have a problem ... If I define viewer.setThreadingModel (osgViewer:: Viewer:: singlethreaded), I get an error in ot12-OpenThreadsd.dll(Thread:: setProcessorAffinity ()). I use singlethreaded for CEGUI ... if you do not define that line the error occurs when creating the object CEGUI, because there is no graphic context ( CEGUI:: OpenGLRenderer:: create (CEGUI:: Size (width, height)), is there any way to define the active context id? In the next post you can see how I use CEGUI with OSG 2.8.3: http://forum.openscenegraph.org/viewtopic.php?t=5630 Thank you! Cheers, Aitor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35261#35261 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD problem (setFileName vs addChild)
Hi! Thanks for reply! Yes, its a first simple test to figure things out. I'll test to have the lowest lod first in list and do the bounding sphere calculation manually. How would I implement a quadtree for this?. I mean, I know the algorithm and so but not how to get it to work with osg and my pagelod array. How do I tell osg to not loop through the 2736 nodes all the time and use my quadtree instead? I'm guessing I'll have to override the traverse function, I read something about that somewhere. But I still have to loop through each node once at startup to set the filenames, calculate bounding sphere and other initialization, right? Sorry if this is asked all the time, searched for examples on pagedlods but didn't find much. Thanks again! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35262#35262 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] runtime error
Ok. I installed OSG using apt-get and it installed 2.8.1 on both my 32 and 64 bit machines. Both ran the osgversion command. However, I removed the package from the 32 bit machine and tried to compile the latest. The compile goes fine no errors, the make install works great. However, when I try osgversion, I still get the following: osgversion: symbol lookup error: /usr/local/lib/libosg.so.70: undefined symbol: _ZN11OpenThreads5MutexC1ENS0_9MutexTypeE How do I run the ldd with osgversion to see what it needed? I have tried and I cannot figure out how to use it. I do have the libosg.s0.70 on my machine. Is any one else seeing this. Could be that I am missing something needed to run. Any help with ldd will be appreciated. Michael___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Plugin: animation speed not as expected...
Hi everybody, I'm still testing the FBX plugin but I'm still experiencing problems with animations. The humanoid.fbx test model that comes with the FBX SDK 2011.3 is displayed incorrectly by osgviewer and by osganimationviewer too (OSG 2.9.10). In order to try to understand where the problem is, I tried to simplify the animation (I removed everything but the left arm animation) but, since I'm not confortable with osgAnimation yet, I still cannot figure out the cause of this issue. The only thing I can think of, is that the model seems to miss an 'initial pose' (at least this is the warning that I get if I try to import the model in 3dsMax) but anyway 3dsMax, Motion Builder and QuickTime display it correctly. 3dsMax warns me that it will try to 'guess' the initial pose and actually it manage to set the correct one. Could the problem be related to a missing 'initial pose'? Maybe if such an 'initial pose' is missing then the model's starting position is messed up and so, when we play the animation, everything is messed up too. Any ideas? One more thing I've found out is that if I comment the following line: vi.push_back(osgAnimation::VertexIndexWeight(gi.second, weight)); in fbxRMesh.cpp then the humanoid mesh is displayed correctly (of course without animations) and the mesh rests in the 'arms spread' pose. Maybe there is somthing happening when setting the initial pose weights? Still guessing... Cheers. Alessandro ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] NVIDIA OptiX cross-format
Hi, i am working on an OptiX integration into an OSG based application. I am wondering if there are other projects about this issue. Currently i study to set up an serialized OptiX format (e.g. binary or XML) including reader and writter, what could be something like done for OSG (http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/SerializationSupport) this year. The idea would be to set up an open format (if there is none) for OptiX's node graph. Of course it is not possible as OSG input, but would probably be a first step. Thank you! Cheers, Holger -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35267#35267 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] draw a partial torus and a half sphere
Hi, I want to draw a partial torus, I know the center, the starting angle, the angle of arrival, the minimum radius and maximum radius. I want to draw also a half sphere! Can you help me? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35268#35268 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Fwd: Optimizing performance of LineSegmentIntersector
Good Day, A very Happy New Year to All! Are there any thoughts regarding this inquiry that I'd posted a couple of weeks ago? To further clarify, I guess what I'm asking is: Is it possible to specify that only the highest LOD be paged in (ignoring all other LODs), or alternatively is it possible to generate a paged terrain database that contains only one (i.e. the highest) LOD (and in so doing specify the desired tile size for this highest LOD)? and Is it possible to control the maximum range from the observer at which tiles will be paged in/out? Many thanks in advance, Murray Begin forwarded message: From: Murray G. Gamble mgam...@connect.carleton.ca Date: December 21, 2010 3:09:19 PM EST To: osg-users@lists.openscenegraph.org Subject: [osg-users] Optimizing performance of LineSegmentIntersector Reply-To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Good Day, We're using osg VPB/osgdem to create a polygonal terrain representation that interacts with the undercarriage model of a helicopter flight model using a set of LineSegmentIntersectors. While this approach works quite well, we'd like to optimize the performance of the LineSegmentIntersector queries in order to allow us to increase the frequency to of queries to ~200 Hz and maintain consistent query times (currently the performance of the intersection tests varies significantly as we move through the virtual terrain). Ideally by minimizing the hierarchy of terrain that the IntersectionVisitor needs to traverse over, we hope to improve the performance of the intersection queries. Since the interaction is non-visual in nature, we only require the highest LOD of the terrain and we only require the tiles that are within a few hundred meters of the observer to be loaded by the DatabasePager, however we're unsure as to how to influence: Which LOD is loaded by the DatabasePager; and The radius around the observer for which the DatabasePager will load the highest LOD tiles. Can anyone offer some guidance re. configuring the DatabasePager (and/or other parts of the system) to perform as desired? Many thanks, Murray ___ 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] OSX .app bundle internal dir path rules?
Hi Len, so is that the actual name of the folder @executable_path within the App bundle, or are you inferring that is to be substituted with the actual exec path where the binary is, e.g., @MacOS, is s etc.? Just want to make sure I understand-- Thanks a lot for your help! Cheers, Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35270#35270 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSX .app bundle internal dir path rules?
Yes, that's literally the keyword that mac libraries understand that will be translated to the appropriate path. There are others, I believe, but that's the only one I use. -Len On Jan 3, 2011, at 11:11 AM, Ted Morris ted.mor...@gmail.com wrote: Hi Len, so is that the actual name of the folder @executable_path within the App bundle, or are you inferring that is to be substituted with the actual exec path where the binary is, e.g., @MacOS, is s etc.? Just want to make sure I understand-- Thanks a lot for your help! Cheers, Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35270#35270 ___ 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] OSX .app bundle internal dir path rules?
Am 03.01.11 18:11, schrieb Ted Morris: so is that the actual name of the folder @executable_path within the App bundle, or are you inferring that is to be substituted with the actual exec path where the binary is, e.g., @MacOS, is s etc.? the @executable_path / @loader_path are special instructions for the dynamic linker to find dependent libs or plugins, these paths are stored inside the dynamic-libs to help the linker resolving. This has nothing to do with your own data-files or plugins residing in the app-bundle. osg looks in the Plugins-folder of your app-bundle for your osg-based plugins, and looks into the Resources-folder for your data-files. A common layout of an app-bundle looks like this: myApp.app + Contents + MacOS - myApp + Frameworks - osg.framework - osgDB.framework - ... + Plugins - osgdb_iomageio.so - osgdb_osg.so - ... + Resources - cow.osg + aSampleFolder - dumptruck.osg You can use the copy-files build-phase of xcode to copy the various files to their correct locations. So, to get the path to cow.osg, all you need to do is: { std::string file = osgDB::findDataFile(cow.osg); osg::Node* node = osgDB::readNodeFile(file); } { std::string file = osgDB::findDataFile(aSampleFolder/dumptruck.osg); osg::Node* node = osgDB::readNodeFile(file); } HTH, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] large VBOs for multiple Drawables
Hi Jason, Thank you for the suggestion. I feel like I'm missing something still. Is there an Optimizer feature or something that combines Arrays for you? Or did you write a bunch of custom code that processes your models after you load them? -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com Message: 3 Date: Sun, 2 Jan 2011 21:28:12 -0500 From: Jason Beverage jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi Terry, You can pack the verts of your small objects into a single osg::Vec3Array and share that array across multiple osg::Geometry objects then use DrawElements for each geometry with the correct indices. I've just recently done this actually for a project I'm working on and it's worked out great. Thanks, Jason On Sat, Jan 1, 2011 at 6:21 PM, Terry Welsh mogu...@gmail.com wrote: I found some email threads that hinted at this a little, but nothing seemed very specific. ?I have scenes where display lists perform a bit better than VBOs. ?My best guess is because my objects have relatively small vertex counts (usually between 20 and 200). ?Is there any way in OSG to use one large VBO to store the date for multiple Drawables in order to minimize buffer state changes? -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] large VBOs for multiple Drawables
Hi Terry, I was generating all my geometry in code so I wrote some custom code to pack them tightly into a single vertex array. Jason On Mon, Jan 3, 2011 at 1:05 PM, Terry Welsh mogu...@gmail.com wrote: Hi Jason, Thank you for the suggestion. I feel like I'm missing something still. Is there an Optimizer feature or something that combines Arrays for you? Or did you write a bunch of custom code that processes your models after you load them? -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com Message: 3 Date: Sun, 2 Jan 2011 21:28:12 -0500 From: Jason Beverage jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi Terry, You can pack the verts of your small objects into a single osg::Vec3Array and share that array across multiple osg::Geometry objects then use DrawElements for each geometry with the correct indices. I've just recently done this actually for a project I'm working on and it's worked out great. Thanks, Jason On Sat, Jan 1, 2011 at 6:21 PM, Terry Welsh mogu...@gmail.com wrote: I found some email threads that hinted at this a little, but nothing seemed very specific. ?I have scenes where display lists perform a bit better than VBOs. ?My best guess is because my objects have relatively small vertex counts (usually between 20 and 200). ?Is there any way in OSG to use one large VBO to store the date for multiple Drawables in order to minimize buffer state changes? -- Terry Welsh mogumbo 'at' gmail.com www.reallyslick.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to do shadows in large scenes?
I Peter, PSSM is probably the best choice for large scene. PSSM technique have been fixed in osg 2.9.9 or 2.9.10 for minor bug. If you didn't see shadow in your scene with this technique, this probably a bug in your code. Take a look to osgshadow example to know how use it. You have to run osgshadow --pssm to see pssm in action. HTH David Callu 2011/1/3 Peter Amstutz peter.amst...@tseboston.com Hello all, I am trying to determine the right approach to apply shadows to a large scene. My test scene is 2k x 2k, but I need to support larger terrains as well. The scene consists of static geometry (ordinary osg::Geodes) and animated dynamic entities. I have a single directional light as the sun. I'm using osg 2.8.3 with a Radeon 3400 on Windows 7 64 bit. I've attached some screenshots. First is a view with no shadows for reference. I tried osgShadow::ShadowMap as that seems to be most recommended. This works but unfortunately the resolution of the depth map is far too low relative to the terrain size, resulting in numerous artifacts (see attachment). Increasing the shadow map resolution don't help, as a 2048x2048 shadow map is still much too small (attached). After doing some research, it seems that cascaded shadow maps are a possible solution to the resolution problem, so I tried osgShadow::ParallelSplitShadowMap. This doesn't work at all, as seen in the attached image. I've also been looking at doing an offline radiosity render and baking the results into shadow maps, but that creates its own set of challenges and doesn't deal with shadows from dynamic entities. I'm not sure where to go from here. Are there other shadow techniques that I should try? Does PSSM work any better in osg 2.9? Should I look at fixing writing my own cascaded shadow map implementation and/or try to fix PSSM? Or do something else entirely? By the way, the wiki page discussing shadows seems to have last been updated for osg 2.4, which adds to the confusion: http://www.openscenegraph.org/projects/osg/wiki/Support/ProgrammingGuide/osgShadow Advice will be very appreciated. Thanks! -- Peter Amstutz Senior Software Engineer Technology Solutions Experts Natick, MA 02131 ___ 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] draw a partial torus and a half sphere
Hi Lucie, You can fill an osg::Geometry by computing yourself the vertices position. take a look to osggeometry to know how to use and fill osg::Geometry. You can also use an osg::Shape combined with osg::ShapeDrawable to draw a half sphere. Take a look to osgshape to know how to use osg::Shape and osg::ShapeDrawable. And take a look to osg::DrawShapeVisitor::drawHalfSphere(...) which do what you want. Don't forget that osg::Shape is not an optimized way to draw a geometry. osg::Geometry is a better solution by need more work from you. HTH David Callu 2011/1/3 lucie lemonnier lucielemonn...@hotmail.fr Hi, I want to draw a partial torus, I know the center, the starting angle, the angle of arrival, the minimum radius and maximum radius. I want to draw also a half sphere! Can you help me? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35268#35268 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to do shadows in large scenes?
Thanks, I'll have to determine if upgrading to osg 2.9.10 is feasible for my project. Or perhaps osgShadow could be backported to osg 2.8.3? After writing that email, I also discovered osgShadow::StandardShadowMap and osgShadow::LightSpacePerspectiveShadowMap, both of which work quite a bit better than osgShadow::ShadowMap. On 1/3/2011 1:45 PM, David Callu wrote: I Peter, PSSM is probably the best choice for large scene. PSSM technique have been fixed in osg 2.9.9 or 2.9.10 for minor bug. If you didn't see shadow in your scene with this technique, this probably a bug in your code. Take a look to osgshadow example to know how use it. You have to run osgshadow --pssm to see pssm in action. HTH David Callu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Peter Amstutz Senior Software Engineer Technology Solutions Experts Natick, MA 02131 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] runtime error
I Michael, This seem that you run 64bit osgversion executable and use 32bit libosg.so library, or vice versa. You have to choose one version to install on your computer, or put the directory containing the right version of osg library in first place of your PATH environment variable ex : if you use the 32bit version of osg, do # export PATH=/usr/local/lib:$PATH # /usr/local/bin/osgversion HTH David Callu 2011/1/3 Michael Hall hal...@att.net Ok. I installed OSG using apt-get and it installed 2.8.1 on both my 32 and 64 bit machines. Both ran the osgversion command. However, I removed the package from the 32 bit machine and tried to compile the latest. The compile goes fine no errors, the make install works great. However, when I try osgversion, I still get the following: osgversion: symbol lookup error: /usr/local/lib/libosg.so.70: undefined symbol: _ZN11OpenThreads5MutexC1ENS0_9MutexTypeE How do I run the ldd with osgversion to see what it needed? I have tried and I cannot figure out how to use it. I do have the libosg.s0.70 on my machine. Is any one else seeing this. Could be that I am missing something needed to run. Any help with ldd will be appreciated. Michael ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VS2010 Memcpy error with osgviewerMFC example
Hi, I recently moved from VS2005 to VS2010 and all of my MFC based projects now die with the same memory access error in memcpy_s() when setting up the manipulator. The osgviewerMFC example experiences the same issue. Has anyone gotten an osg-MFC example compiled through VS2010 yet? It seems to happen when the manipulator name string is copied over, but if this is commented out I just get memory read/write related errors elsewhere... So perhaps the hWnd pointer is not valid at this point? Any ideas would be appreciated. Thanks, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35279#35279 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VS2010 Memcpy error with osgviewerMFC example
Hi Garrett, I recently moved from VS2005 to VS2010 and all of my MFC based projects now die with the same memory access error in memcpy_s() when setting up the manipulator. The osgviewerMFC example experiences the same issue. Has anyone gotten an osg-MFC example compiled through VS2010 yet? It seems to happen when the manipulator name string is copied over, but if this is commented out I just get memory read/write related errors elsewhere... So perhaps the hWnd pointer is not valid at this point? Any ideas would be appreciated. I doubt this is related in any way to VS 2010, because we and others around the world are using OSG with VS 2010 successfully. I suspect in recompiling OSG for VS 2010 you have perhaps gotten your versions mixed up, i.e. your application compiled in debug is linking to a release OSG, or vice versa. Or it may be that you have another version of OSG on your machine built with VS 2005 and you are linking to the VS 2010 version at compile time but at runtime your app ends up using the VS 2005 version. Running your app through Dependency Walker might help to figure out what's happening if just checking your build settings and system PATH doesn't give you any clues. 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] VS2010 Memcpy error with osgviewerMFC example
Hi J-S, Thanks for the reply. I also am using OSG with VS2010 on other projects with no problems. The only time I encounter this issue is when running an MFC based OSG app compiled with VS2010. As you suggested I double checked to be sure that I am compiling with the correct library versions and everything checks out. Perhaps it's an MFC related project setting that changed in 2010? Do you have an MFC-OSG app compiled with VS2010 that works? Thanks, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35282#35282 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with State::convertShaderSourceToOsgBuiltins
Hi Robert, I'm seeing the following GLSL compile error. It looks like the code in State::convertShaderSourceToOsgBuiltins() is inserting declarations before the #version directive, which is apparently illegal. (Only on one of our machines does OSG even go down this code path ... I am still investigating why that is.) Let me know if you will accept a patch to insert declarations after any GLSL compiler directives, or whether you think another solution would be more appropriate. Thanks. State::convertShaderSourceToOsgBuiltIns() ++Before Converted source #version 110 uniform mat4 osgearth_overlay_TexGenMatrix; uniform mat4 osg_ViewMatrixInverse; void osgearth_overlay_vertex(void) { gl_TexCoord[0] = osgearth_overlay_TexGenMatrix * osg_ViewMatrixInverse * gl_ModelViewMatrix * gl_Vertex; } Converted source uniform mat4 osg_ModelViewMatrix; attribute vec4 osg_Vertex; #version 110 uniform mat4 osgearth_overlay_TexGenMatrix; uniform mat4 osg_ViewMatrixInverse; void osgearth_overlay_vertex(void) { gl_TexCoord[0] = osgearth_overlay_TexGenMatrix * osg_ViewMatrixInverse * osg_ModelViewMatrix * osg_Vertex; } VERTEX glCompileShader osgearth_overlay_vertex FAILED VERTEX Shader osgearth_overlay_vertex infolog: 0(3) : error C0204: version directive must be first statement and may not be repeated Glenn Waldron : Pelican Mapping : +1.703.652.4791 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSX .app bundle internal dir path rules?
Ah! thanks Stephan (and Len) for the follow up explanation. Now I get it. Cheers, Ted snip + Resources - cow.osg + aSampleFolder - dumptruck.osg You can use the copy-files build-phase of xcode to copy the various files to their correct locations. So, to get the path to cow.osg, all you need to do is: { std::string file = osgDB::findDataFile(cow.osg); osg::Node* node = osgDB::readNodeFile(file); } { std::string file = osgDB::findDataFile(aSampleFolder/dumptruck.osg); osg::Node* node = osgDB::readNodeFile(file); } snip ... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35284#35284 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] cannot build osg on mac os x 10.6.5 with gcc version 4.2.1
Hi, while my earlier built was successful ([i]osgversion[/i] outputs [i]OpenSceneGraph Library 2.8.3 [/i]) the [i]osglogo[/i] fails. I get: [i]Warning: Could not find plugin to read objects from file Images/land_shallow_topo_2048.jpg. View::setUpViewAcrossAllScreens() : Error, no WindowSystemInterface available, cannot create windows. Viewer::realize() - failed to set up any windows [/i] Any ideas how to fix that? Thank you! Cheers, Nikos -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35285#35285 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VS2010 Memcpy error with osgviewerMFC example
Hi Garrett, As you suggested I double checked to be sure that I am compiling with the correct library versions and everything checks out. Perhaps it's an MFC related project setting that changed in 2010? Do you have an MFC-OSG app compiled with VS2010 that works? Err, no. Though I would doubt MS would do anything special to accomodate MFC in its compiler, they've done weirder things before. Perhaps someone else on this list has used OSG and MFC together in VS 2010? In the past (VS 2005 and 2008) we didn't need to do anything special. You already mentioned the osgViewerMFC example has the same problem, that's good info, I and others can try that out soon and let you know what results we get (in my case I can probably try it tomorrow). Have you tried to search MS-related sources (forums, MSDN, etc.) for info about this kind of issue? As you've confirmed non-MFC OSG apps work for you on VS 2010, it's probably something MFC-related as you suggest. Perhaps some flags need to be added when building the OSG libraries to make the results compatible with VS 2010's MFC? If that's the case, you can add specific flags like that to the CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, CMAKE_EXE_LINKER_FLAGS, etc. settings that you will see by showing the advanced settings in CMake. Hope this helps, and let us know what you find out, 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] [forum] Line Of Sight and skyline tools
Hi all, I had a question in regards to possible examples of lines of sight or skyline tool implementations in OSG. I did notice the OSGSim LineOfSight helper class in my research and was wondering if there are any examples of that class in use. Also any examples of skyline calculation from the loaded data within the scene? Any advice or pointers would be greatly appreciated. Thank you! Cheers, Dan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35287#35287 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org