Re: [osg-users] Camera composition
if you are going to render whole scene again, i did not understand where culling is? and also i dont believe culling far plane is a good idea if you are rendering large area, the increment of performance will not be dramatic. i suggest you to draw terrain in different levels of details. i render 100km x 100km terrain by LOD instead of culling them. On Fri, Mar 26, 2010 at 3:15 PM, Joseba Rodriguez jrodrig...@landersimulation.com wrote: Hi, I have a large terrain with other geometries on it, and im trying to do some culling on this scene. One of the things i´ve been trying is to keep a minimun far plane distance, but mountains on terrain are cut due to the far plane. For solving this i tried to render terrain and the geometry over it on different cameras with different fal planes, but i just get a black screen when i change the camera projection matrix. The idea is something like this: - Viewer - MainCamera |- Camera1 - (terrain in render bin -5, big far) |- Camera2 - all the other things in scene, small far. Any idea of how can i make this? Thank you! Cheers, J -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26191#26191 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg version problem advice?
Hi, i have .ive models which are created in ~osg::2.2.0. i realized that there are textures which are not 2^n size in these models. normally i call this command: osgconv --compressed model.ive model.ive but when i compress it, i can not open this model with the old version of osg. it says: The version found in the file is newer than this library can handle. then i tried to compress models with version 2.2.0 but this time i got this error: Failed to create pbuffer, failing back to normal graphics window. Error: Unable to create graphis context - cannot run compression Data written to 'model.ive'. do you have any advice about this situation. how can i compress my .ive files. i thougt i can convert them to .osg format but this time textures are lost. then i tried to get images from .ive file in order to put them near the .osg file but i could not get any image. any advice would be great. thanks... -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg version problem advice?
Hi Robert, unfortunately i have to use older version of osg because currenty i am fixing bugs of one our simulators which is developed in 2007and 2008. we implemented this simulator in delta3D 1.4 which uses the older version of osg. i want to upgrade this system to the newer versions but i am afraid of getting many errors. there are many changes between versions like producer. that's why i am trying to find some backward compatible solution... On Mon, Mar 15, 2010 at 2:31 PM, Robert Osfield robert.osfi...@gmail.comwrote: HI Ufuk, Is there a reason that you are using a version of the OSG so many years out of date? In very old versions of the OSG there was a problem under Windows with osgconv attempting to create a graphics context due a crappy windows issue of the MS compiler not pulling in symbols that it should have, the only work around is to explicitly reference these symbols. Modern versions of the OSG has this hack in them to workaround the Windows problem. Robert. On Mon, Mar 15, 2010 at 12:20 PM, Ufuk Gun ufuk...@gmail.com wrote: Hi, i have .ive models which are created in ~osg::2.2.0. i realized that there are textures which are not 2^n size in these models. normally i call this command: osgconv --compressed model.ive model.ive but when i compress it, i can not open this model with the old version of osg. it says: The version found in the file is newer than this library can handle. then i tried to compress models with version 2.2.0 but this time i got this error: Failed to create pbuffer, failing back to normal graphics window. Error: Unable to create graphis context - cannot run compression Data written to 'model.ive'. do you have any advice about this situation. how can i compress my .ive files. i thougt i can convert them to .osg format but this time textures are lost. then i tried to get images from .ive file in order to put them near the .osg file but i could not get any image. any advice would be great. thanks... -- Ufuk Gün ___ 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 -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg version problem advice?
Hi jp, it sounds weird but it might work. i will try because it seems i have no other option :) thanks... On Mon, Mar 15, 2010 at 2:56 PM, J.P. Delport jpdelp...@csir.co.za wrote: Hi, this might be a radical solution, but you should be able to get virtualbox with Ubuntu 8.04 LTS to build OSG 2.2 without problems and hopefully do the convertions you need. Once you have it running you can just archive the virtual machine for future use. jp Ufuk Gun wrote: Hi Robert, unfortunately i have to use older version of osg because currenty i am fixing bugs of one our simulators which is developed in 2007and 2008. we implemented this simulator in delta3D 1.4 which uses the older version of osg. i want to upgrade this system to the newer versions but i am afraid of getting many errors. there are many changes between versions like producer. that's why i am trying to find some backward compatible solution... On Mon, Mar 15, 2010 at 2:31 PM, Robert Osfield robert.osfi...@gmail.commailto: robert.osfi...@gmail.com wrote: HI Ufuk, Is there a reason that you are using a version of the OSG so many years out of date? In very old versions of the OSG there was a problem under Windows with osgconv attempting to create a graphics context due a crappy windows issue of the MS compiler not pulling in symbols that it should have, the only work around is to explicitly reference these symbols. Modern versions of the OSG has this hack in them to workaround the Windows problem. Robert. On Mon, Mar 15, 2010 at 12:20 PM, Ufuk Gun ufuk...@gmail.com mailto:ufuk...@gmail.com wrote: Hi, i have .ive models which are created in ~osg::2.2.0. i realized that there are textures which are not 2^n size in these models. normally i call this command: osgconv --compressed model.ive model.ive but when i compress it, i can not open this model with the old version of osg. it says: The version found in the file is newer than this library can handle. then i tried to compress models with version 2.2.0 but this time i got this error: Failed to create pbuffer, failing back to normal graphics window. Error: Unable to create graphis context - cannot run compression Data written to 'model.ive'. do you have any advice about this situation. how can i compress my .ive files. i thougt i can convert them to .osg format but this time textures are lost. then i tried to get images from .ive file in order to put them near the .osg file but i could not get any image. any advice would be great. thanks... -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk Gün ___ 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 -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] filpped view
Hi Nick, you can render scene to a texture and when you place this texture you can modify the texture coordinates as it seems like mirrored. we made such a thing in rearview mirror in a car simulation. if you are going to mirror whole scene, some monitors are able to mirror its display on the hardware. so you may not do anything for this case. On Mon, Mar 15, 2010 at 2:59 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Nick, On Mon, Mar 15, 2010 at 12:55 PM, Trajce (Nick) Nikolov nikolov.tra...@gmail.com wrote: Hi community, is there a way to flip (mirror along the x axis) a view in a composite viewer? Just flip the left/right values of the projection matrix. If face culling is enabled then you'll need to swap the face that gets culled using osg::FrontFace. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg version problem advice?
Hi Jean-Sébastien, thank you so much for your advice. i did not know that option. now i will convert all my .ive files to .osg with latest version of OSG than convert these .osg files to .ive files with older version of OSG. than everything will be great! thanks :) On Mon, Mar 15, 2010 at 3:32 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Ufuk, i thougt i can convert them to .osg format but this time textures are lost. then i tried to get images from .ive file in order to put them near the .osg file but i could not get any image. You can convert the .ive to .osg while keeping the textures by using the option -O OutputTextureFiles. See the source for the .osg plugin (in newer versions of osgconv you can use --format osg to see what options the .osg plugin supports, but in older versions you need to check the source code). Hope this helps you get a few steps further... 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 -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg version problem advice?
Hi Robert, Yes, this is an another option for this case. i will check if there is a huge difference or not. if not i may write a bug fix to 2.2. thanks Robert... On Mon, Mar 15, 2010 at 4:15 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Ufuk, An option you have open to your is to backport fixes to the OSG to your version of the OSG - this is one of the strengths of the open source. Just do a diff between osgconv in later versions of the OSG with what you have, it may well compile directly. Robert. On Mon, Mar 15, 2010 at 12:47 PM, Ufuk Gun ufuk...@gmail.com wrote: Hi Robert, unfortunately i have to use older version of osg because currenty i am fixing bugs of one our simulators which is developed in 2007and 2008. we implemented this simulator in delta3D 1.4 which uses the older version of osg. i want to upgrade this system to the newer versions but i am afraid of getting many errors. there are many changes between versions like producer. that's why i am trying to find some backward compatible solution... On Mon, Mar 15, 2010 at 2:31 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Ufuk, Is there a reason that you are using a version of the OSG so many years out of date? In very old versions of the OSG there was a problem under Windows with osgconv attempting to create a graphics context due a crappy windows issue of the MS compiler not pulling in symbols that it should have, the only work around is to explicitly reference these symbols. Modern versions of the OSG has this hack in them to workaround the Windows problem. Robert. On Mon, Mar 15, 2010 at 12:20 PM, Ufuk Gun ufuk...@gmail.com wrote: Hi, i have .ive models which are created in ~osg::2.2.0. i realized that there are textures which are not 2^n size in these models. normally i call this command: osgconv --compressed model.ive model.ive but when i compress it, i can not open this model with the old version of osg. it says: The version found in the file is newer than this library can handle. then i tried to compress models with version 2.2.0 but this time i got this error: Failed to create pbuffer, failing back to normal graphics window. Error: Unable to create graphis context - cannot run compression Data written to 'model.ive'. do you have any advice about this situation. how can i compress my .ive files. i thougt i can convert them to .osg format but this time textures are lost. then i tried to get images from .ive file in order to put them near the .osg file but i could not get any image. any advice would be great. thanks... -- Ufuk Gün ___ 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 -- Ufuk Gün ___ 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 -- Ufuk Gün ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD usage??
Hi Chris, Thank you so much for your help. i was just thinking about writing my own pagedLOD mechanism. it works really nice now. thanks again :) On Mon, Feb 15, 2010 at 6:09 PM, Chris 'Xenon' Hanson xe...@alphapixel.comwrote: On 2/15/2010 6:25 AM, Ufuk wrote: do you think i miss something? should i use PagedLOD for my purpose or i should implement something different??* PagedLOD should do the trick for you. Often, you will put in the first LOD as already-leaded, and leave its filename blank. Then, add the higher LODs without using addChild -- you don't want to add a Node, you just want to fill out the filename and ranges in the PagedLOD perRangeData. The DatabasePager will load them for you when needed. If you want the first LOD loaded for you, do not create and add a blank Node as you are doing here. Just add a perRangeData to the PagedLOD node, and start the main OSG program loop running. Make sure you are using something derived from osgViewer and that you have all the DatabasePager bits hooked up properly or background loading won't work. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PagedLOD usage??
Hi all, sorry, this question seems very odd but i could not solved the problem. i need simple paged lod mechanism and i can see that there is a class for this purpose in osg named osg::PagedLOD i have terrain pages with different resolutions. since there are many of them, i don't want to load all of them at the beginning of the program. i want them to be loaded when the camera goes there. osg::LOD works perfect but it loads all the models at the beginning of the program. i call the functions like that: //CALL OF osg::LOD osg::Node* node = osgDB::readNodeFile(filename); lod-addChild(node, min, max); //CALL OF osg::PagedLOD osg::Node* node = new osg::Node(); pagedLOD-addChild(node, min, max, filename); when i use PagedLOD instead of LOD, i dont load the node file at the beginning. but the problem is when i use pagedLOD i cant see anything. it just works when i use LOD. do you think i miss something? should i use PagedLOD for my purpose or i should implement something different??* any idea would be great :) thanks -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] apply LOD when pivot point is different then center of geometry?
Hi all, i have terrain models which have vertex coordinates like (-55000, 42600, 593). The pivot point of this model is (0,0,0). when i dont move transform it, it is placed where it should be. then i want to apply LOD to these models because there are many of them. when i add child to osg::LOD than i cant see the model. then i set the center of bounding of model as the center of osg::LOD but it did not effect. what else i should do? or should i do something different? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compress image
Hi Ulrich,the reason of the problem is not image or cimage. yes you are right they are different but i think i wrote it wrong here. anyway when i debug i saw that cImage resoultion did not change. but today i checked the code again and i saw that i wrote the code like: cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); scaling of first 2 is ok but not the third one. image-r() should not be changed. so i corrected like that: cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() ); now it works... :) On Fri, Aug 21, 2009 at 12:26 PM, Ulrich Hertlein u.hertl...@sandbox.dewrote: Hi Ufuk, disregarding the follow-ups regarding mipmapping: you're saving the original image. The scaled down image is 'cimage', not the original 'image'. Change the 'writeImageFile' to use 'cimage' and you should be good. Cheers, /uli On 20/08/09 4:39 PM, Ufuk wrote: is there any function that com/ void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string filename ) { osg::ref_ptrosg::Image cImage = new osg::Image(*image); cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); osgDB::writeImageFile(*image, filename); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compress image
Hi All,i decided to use a tool for this purpose. now i am lazy to integrate a scaling function into my code.. i found ImageMagick and i will use converter.exe of this library. now i changed my function like: /// void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string outputFilename ) { std::ostringstream command; command converter.exe image-getFileName() -resize image-s() * scaleFactor image-t() * scaleFactor outputFilename; system(command.str().c_str()); } /// thanks to all... On Fri, Aug 21, 2009 at 9:12 AM, J.P. Delport jpdelp...@csir.co.za wrote: Hi Ufuk, Ufuk wrote: actually i just want to have a scale code of image.. half and quarter resolution would be enough for me.. i wanted to scale them when i create terrain. if you are working with terrain I would suggest you also look at the GDAL functions/lib. E.g. have a look at the gdaladdo man page, it is a command line app that builds overview images, but you could use the same functionality directly from your application if you link to GDAL. You might also find some other helpful functions. jp i have a terrain editor and viewer which are 2 separate programs. on editor, in saving process, i want to store lower resolution textures too and i wanted to create in my program. my terrain viewer program will load all textures and use low resolution textures for pages which are far away from the camera.. i don't want to use .dds because in terrain editor, user can use any texture he wants. so i don't want to give up texture selection dynamism here.. i can't limit users just with my textures which are selected before. On Thu, Aug 20, 2009 at 5:58 PM, Ümit Uzun umituzu...@gmail.com mailto: umituzu...@gmail.com wrote: Hi Ufuk; If you want to create mippaped images on your disk instead of programmaticaly. I suggest you to use GIMP to mipmap(rescale each different resolution image separately) and when you need you can call related resolution image :) Is this your expected or you want to create one image which has all resoluted images in it? If you want kind of this operation you can use dds format. But I don't know osg does support reading mipmapped dds format. Regards. Ümit Uzun 2009/8/20 Ufuk ufuk@gmail.com mailto:ufuk@gmail.com Hi Ümit, yes, i need mipmapping but i want to store these mipmapped textures on disk. i dont want so many calculations on rendering... so i wanted to store these images on disk. do you know a way to do this or i should write a code? On Thu, Aug 20, 2009 at 5:43 PM, Ümit Uzun umituzu...@gmail.com mailto:umituzu...@gmail.com wrote: Hi Ufuk; Compress word doesn't define your expected operation very well. This operation's name is Mipmapping. You should generate automatic mipmapping for your texture in runtime and the you can choose any resolution you have created to use your program. Regards. Ümit Uzun 2009/8/20 Ufuk ufuk@gmail.com mailto:ufuk@gmail.com is there any function that compress image in osg? for example i have an 256x256 image and i want to compress it to 128x128 or 64x64... i checked for osg::Image::scaleImage() but it did not change the resolution.. maybe i did something wrong? Here is the code: /// void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string filename ) { osg::ref_ptrosg::Image cImage = new osg::Image(*image); cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); osgDB::writeImageFile(*image, filename); } /// --Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Chris Gordon,i did not know visual studio has an ability like that. i believe i don't know how to use visual studio.. i realized that there are many features that i did not know especially about these breakpoints. Hi Jean-Sebastian, thank you for your answer.. i will search the previous posts of you in the archives.. it will be really useful for me because even if i use ref_ptr all the time, i have memory leaks and i can't find them.. it will be useful for me... thanks... On Wed, Aug 19, 2009 at 10:27 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Ufuk, thank you for your attention.. :) actually i didn't know that it is deleted on suitable time. i always expected it to be deleted when i set to NULL. Perhaps it's as simple as: the render back-end had a ref_ptr to your geometry because it was busy rendering it. So when you set your pointer to NULL, the ref count went down to 1, and at the end of rendering the current frame the render back-end released all its ref_ptrs and your geometry was deleted. Also, search the archives, I have posted a while back a modification to osg::Referenced that allowed you to have certain functions called each time a ref_ptr increments or decrements its reference count, along with Win32 functions that captured the call stack at that point. I had developed it as a way of tracking a memory leak that was caused by circular ref_ptrs. The modifications in question were not general enough to be integrated (in particular they had no Linux/MacOS X implementation), but they were certainly useful for me, and it could be instructive to you if you want to know exactly who has each reference to your object. 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Compress image
is there any function that compress image in osg? for example i have an 256x256 image and i want to compress it to 128x128 or 64x64... i checked for osg::Image::scaleImage() but it did not change the resolution.. maybe i did something wrong? Here is the code: /// void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string filename ) { osg::ref_ptrosg::Image cImage = new osg::Image(*image); cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); osgDB::writeImageFile(*image, filename); } /// -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compress image
Hi Ümit,yes, i need mipmapping but i want to store these mipmapped textures on disk. i dont want so many calculations on rendering... so i wanted to store these images on disk. do you know a way to do this or i should write a code? On Thu, Aug 20, 2009 at 5:43 PM, Ümit Uzun umituzu...@gmail.com wrote: Hi Ufuk; Compress word doesn't define your expected operation very well. This operation's name is Mipmapping. You should generate automatic mipmapping for your texture in runtime and the you can choose any resolution you have created to use your program. Regards. Ümit Uzun 2009/8/20 Ufuk ufuk@gmail.com is there any function that compress image in osg? for example i have an 256x256 image and i want to compress it to 128x128 or 64x64... i checked for osg::Image::scaleImage() but it did not change the resolution.. maybe i did something wrong? Here is the code: /// void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string filename ) { osg::ref_ptrosg::Image cImage = new osg::Image(*image); cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); osgDB::writeImageFile(*image, filename); } /// -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compress image
actually i just want to have a scale code of image.. half and quarter resolution would be enough for me.. i wanted to scale them when i create terrain. i have a terrain editor and viewer which are 2 separate programs. on editor, in saving process, i want to store lower resolution textures too and i wanted to create in my program. my terrain viewer program will load all textures and use low resolution textures for pages which are far away from the camera.. i don't want to use .dds because in terrain editor, user can use any texture he wants. so i don't want to give up texture selection dynamism here.. i can't limit users just with my textures which are selected before. On Thu, Aug 20, 2009 at 5:58 PM, Ümit Uzun umituzu...@gmail.com wrote: Hi Ufuk; If you want to create mippaped images on your disk instead of programmaticaly. I suggest you to use GIMP to mipmap(rescale each different resolution image separately) and when you need you can call related resolution image :) Is this your expected or you want to create one image which has all resoluted images in it? If you want kind of this operation you can use dds format. But I don't know osg does support reading mipmapped dds format. Regards. Ümit Uzun 2009/8/20 Ufuk ufuk@gmail.com Hi Ümit,yes, i need mipmapping but i want to store these mipmapped textures on disk. i dont want so many calculations on rendering... so i wanted to store these images on disk. do you know a way to do this or i should write a code? On Thu, Aug 20, 2009 at 5:43 PM, Ümit Uzun umituzu...@gmail.com wrote: Hi Ufuk; Compress word doesn't define your expected operation very well. This operation's name is Mipmapping. You should generate automatic mipmapping for your texture in runtime and the you can choose any resolution you have created to use your program. Regards. Ümit Uzun 2009/8/20 Ufuk ufuk@gmail.com is there any function that compress image in osg? for example i have an 256x256 image and i want to compress it to 128x128 or 64x64... i checked for osg::Image::scaleImage() but it did not change the resolution.. maybe i did something wrong? Here is the code: /// void simUtil::SimImageUtils::scaleAndSaveImage( osg::Image* image, float scaleFactor, const std::string filename ) { osg::ref_ptrosg::Image cImage = new osg::Image(*image); cImage-scaleImage(image-s() * scaleFactor, image-t() * scaleFactor, image-r() * scaleFactor); osgDB::writeImageFile(*image, filename); } /// -- Ufuk ___ 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 -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Reference count catcher?
i have an osg::Geometry. i store it in a class with ref_ptrwhen i delete it, i expect it to be deleted. in debug, i saw that the reference count is 2 before this destructor. even if i set this value to null, there reference count remains 1. so it is not deleting... what i want to ask is, how can i find who stores reference of my geometry. someone stores and increments the reference count without my information... do you know a way of doing this? i just want to be informed when my geometry reference count is increased so that i can find the memory leak in my project. -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Ismail,thanks for the advice.. i think what you tell probably works but it is very long process... i already thought this but i wanted to try my chance here for an easier way.. these recompiling stuff is not easy for me now... anyway there should be an easier way? if i cant find an easier way, i definitely try what you have said.. On Wed, Aug 19, 2009 at 3:06 PM, Ismail Pazarbasi pazarb...@gmail.comwrote: 2009/8/19 Ufuk ufuk@gmail.com: i have an osg::Geometry. i store it in a class with ref_ptr when i delete it, i expect it to be deleted. in debug, i saw that the reference count is 2 before this destructor. even if i set this value to null, there reference count remains 1. so it is not deleting... what i want to ask is, how can i find who stores reference of my geometry. someone stores and increments the reference count without my information... do you know a way of doing this? i just want to be informed when my geometry reference count is increased so that i can find the memory leak in my project. -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Ufuk, I don't know whether there already is a solution, but I'd suggest you to: 1. Add virtual qualifier before osg::Referenced::ref method: inline virtual void ref() const; 2. Rebuild OSG 3. override this method in your custom Geometry class class MyGeometry : public osg::Geometry { public: inline virtual void ref() const { osg::Geometry::ref(); } }; 4. Place breakpoint to that method and see callers. You can do the same for unref method as well. I haven't tested this but seems like to give you some hints. Ismail ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Daniel, Set a watchpoint on the memory address of the _refCount member of this particular geometry object. your idea seems very good but i don't know how to watch a specific memory address in visual studio. if you know could you tell me because i could not find. Hi Ümit, actually i have a terrain. terrain has a geode and geode has a geometry. i create geometry = refCount = 1 i add it to geode = refCount = 2 i add geode to scene = refCount = 2 application runs.. i see terrain on runtime or when i want to delete, i check geometry refcount and see refCount = 3 i remove geometry from geode = refCount = 2 i set my osg::ref_ptr to NULL =refCount = 1 and my geometry did not deleted... when should it be deleted?? On Wed, Aug 19, 2009 at 3:46 PM, Ümit Uzun umituzu...@gmail.com wrote: Hi Ufuk; As I know, If you create a new object with using ref_ptr, object's default ref_ptr should be initialized to 1. And after you have attached it to your scene, ref_ptr count gets 2. And after you delete your geometry from your scene graph ref count gets 1 again. And then this ref_ptr object will be deleted automatically when intelligent ref_ptr decided to it is unneccessary some times later. And then it will be deleted automaticly. Be cool. ref_ptr's target is counting pointer usage and finding unneccesary pointers. Regards. Ümit Uzun 2009/8/19 Ufuk ufuk@gmail.com Hi Ismail,thanks for the advice.. i think what you tell probably works but it is very long process... i already thought this but i wanted to try my chance here for an easier way.. these recompiling stuff is not easy for me now... anyway there should be an easier way? if i cant find an easier way, i definitely try what you have said.. On Wed, Aug 19, 2009 at 3:06 PM, Ismail Pazarbasi pazarb...@gmail.comwrote: 2009/8/19 Ufuk ufuk@gmail.com: i have an osg::Geometry. i store it in a class with ref_ptr when i delete it, i expect it to be deleted. in debug, i saw that the reference count is 2 before this destructor. even if i set this value to null, there reference count remains 1. so it is not deleting... what i want to ask is, how can i find who stores reference of my geometry. someone stores and increments the reference count without my information... do you know a way of doing this? i just want to be informed when my geometry reference count is increased so that i can find the memory leak in my project. -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Ufuk, I don't know whether there already is a solution, but I'd suggest you to: 1. Add virtual qualifier before osg::Referenced::ref method: inline virtual void ref() const; 2. Rebuild OSG 3. override this method in your custom Geometry class class MyGeometry : public osg::Geometry { public: inline virtual void ref() const { osg::Geometry::ref(); } }; 4. Place breakpoint to that method and see callers. You can do the same for unref method as well. I haven't tested this but seems like to give you some hints. Ismail ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Gordon, i cant place a break point into osg::Referenced class. if i put i get every classes which are referenced. and since the compile time, i can not know the address of my geometry i cant add such an if. anyway it is the whole rebuild of osg library. if i venture this, i do the method that ismail has told before... it seems a better idea.. On Wed, Aug 19, 2009 at 4:30 PM, Tomlinson, Gordon gtomlin...@overwatch.textron.com wrote: err one way you could put a break point in the reference pointer class where the ref count gets increased you can make this a conditional with some like if the THIS pointer = the address of the object your looking at etc *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 *Ufuk *Sent:* Wednesday, August 19, 2009 7:50 AM *To:* OpenSceneGraph Users *Subject:* [osg-users] Reference count catcher? i have an osg::Geometry. i store it in a class with ref_ptr when i delete it, i expect it to be deleted. in debug, i saw that the reference count is 2 before this destructor. even if i set this value to null, there reference count remains 1. so it is not deleting... what i want to ask is, how can i find who stores reference of my geometry. someone stores and increments the reference count without my information... do you know a way of doing this? i just want to be informed when my geometry reference count is increased so that i can find the memory leak in my project. -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Daniel, thanks for link. i searched but all i found was normal debugging and breakpoints... it really useful for me. i did not know such an ability of visual studio. i will try to use this way... --- Hi Ümit, maybe you are right about being cool... i realized that the destructor of my geometry is called but it is called without my control.. it is deleted after a time. i still wonder who gets this geometry and release this. anyway it is not a big problem for me now.. thanks for all your answers... On Wed, Aug 19, 2009 at 4:38 PM, Daniel Trstenjak daniel.trsten...@science-computing.de wrote: if you know could you tell me because i could not find. google's your friend: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/0ce702d6-5428-4b9b-8113-7fa3afe5b66f -- Daniel Trstenjak Tel : +49 (0)7071-9457-264 science + computing ag FAX : +49 (0)7071-9457-511 Hagellocher Weg 73 mailto: daniel.trsten...@science-computing.de D-72070 Tübingen WWW : http://www.science-computing.de/ -- 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Reference count catcher?
Hi Ümit,thank you for your attention.. :) actually i didn't know that it is deleted on suitable time. i always expected it to be deleted when i set to NULL. it is good to learn something today :) thanks again... On Wed, Aug 19, 2009 at 5:01 PM, Ümit Uzun umituzu...@gmail.com wrote: Hi Ufuk; I am sure this working way is true, because Paul Martz had written a mail about rep_ptr's working mechanism and in this mail, he had talked about ref_ptr's automatic destruction in suitable time when realize related object's unnecessity for working program but I can't find this mail archieve ling to send you. Whatever, I am glad to solved at last :) Regards. Ümit Uzun 2009/8/19 Ufuk ufuk@gmail.com Hi Daniel, thanks for link. i searched but all i found was normal debugging and breakpoints... it really useful for me. i did not know such an ability of visual studio. i will try to use this way... --- Hi Ümit, maybe you are right about being cool... i realized that the destructor of my geometry is called but it is called without my control.. it is deleted after a time. i still wonder who gets this geometry and release this. anyway it is not a big problem for me now.. thanks for all your answers... On Wed, Aug 19, 2009 at 4:38 PM, Daniel Trstenjak daniel.trsten...@science-computing.de wrote: if you know could you tell me because i could not find. google's your friend: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/0ce702d6-5428-4b9b-8113-7fa3afe5b66f -- Daniel Trstenjak Tel : +49 (0)7071-9457-264 science + computing ag FAX : +49 (0)7071-9457-511 Hagellocher Weg 73 mailto: daniel.trsten...@science-computing.de D-72070 Tübingen WWW : http://www.science-computing.de/ -- 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 -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] isVertexBufferObjectSupported() ?
Hi, Actually i dont think it is about hardware or driver because i did a project similar to this with this hardware and it is still working on my computer. it returns true on isVertexBufferObjectSupported() but this project was made in like osg ~1.6. The function on Geometry was virtual void drawImplementation(State state) const; on osg1.6 but now it is virtual void drawImplementation(RenderInfo renderInfo) const; on 2.8 so do you think there could be other reasons? On Mon, May 4, 2009 at 5:52 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Ufuk, The OSG checks for support of extensions such as vertex buffer objects, and will osg::State is one class that does this, so if you are isVertexBufferObjectSupported() is returning false then wait for it there is very good chance that your OpenGL driver/hardware doesn't support vertex buffer objects. Robert. On Mon, May 4, 2009 at 3:45 PM, Ufuk ufuk@gmail.com wrote: Hi, i am trying to make a terrain editor. here i wanted to implement my own drawImplementation of geometry but i could not get manage. i always get state.isVertexBufferObjectSupported() as false... when i ignore this false, i got another problems.. i think my problem is this isVertexBufferObjectSupported(). i want to know that what makes it true or false. what should i do to get it as true??? -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] isVertexBufferObjectSupported() ?
Thanks Robert, i know that you cant know the problem without seeing the code :) i just want to know that when isVertexBufferObjectSupported() function returns true or false? to use this support should i enable something? anyway now i will try to make a simpler example, then maybe i could show you the codes.. thanks again... On Tue, May 5, 2009 at 11:48 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Ufuk, I really can't guess what might be wrong because I know absolutely nothing about your application, I simply don't have magically powers to divine this stuff. What I do know is that the vertex buffer objects support does usually work, others do not report problems with it, so there likely something quite specific about your setup that is introducing this problem. Try using standard examples based on osgViewer as a sanity test then work back to an test problem that more closely resembles how you use the OSG. Robert. On Tue, May 5, 2009 at 8:57 AM, Ufuk ufuk@gmail.com wrote: Hi, Actually i dont think it is about hardware or driver because i did a project similar to this with this hardware and it is still working on my computer. it returns true on isVertexBufferObjectSupported() but this project was made in like osg ~1.6. The function on Geometry was virtual void drawImplementation(State state) const; on osg1.6 but now it is virtual void drawImplementation(RenderInfo renderInfo) const; on 2.8 so do you think there could be other reasons? On Mon, May 4, 2009 at 5:52 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Ufuk, The OSG checks for support of extensions such as vertex buffer objects, and will osg::State is one class that does this, so if you are isVertexBufferObjectSupported() is returning false then wait for it there is very good chance that your OpenGL driver/hardware doesn't support vertex buffer objects. Robert. On Mon, May 4, 2009 at 3:45 PM, Ufuk ufuk@gmail.com wrote: Hi, i am trying to make a terrain editor. here i wanted to implement my own drawImplementation of geometry but i could not get manage. i always get state.isVertexBufferObjectSupported() as false... when i ignore this false, i got another problems.. i think my problem is this isVertexBufferObjectSupported(). i want to know that what makes it true or false. what should i do to get it as true??? -- Ufuk ___ 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 -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] isVertexBufferObjectSupported() ?
İsmail,Thanks for your answer, probably you are right because it is a qt application. maybe i could not set the context id. i think state.getContextID() does not match with the current context... i will check for it now.. if you know something about it please help me :) thanks again... :) On Tue, May 5, 2009 at 3:10 PM, Ismail Pazarbasi pazarb...@gmail.comwrote: Ufuk, bool isVertexBufferObjectSupported() const { return _isVertexBufferObjectSupportResolved?_isVertexBufferObjectSupported:computeVertexBufferObjectSupported(); } If you have seen the code that checks whether extension is supported: bool State::computeVertexBufferObjectSupported() const { _isVertexBufferObjectSupportResolved = true; _isVertexBufferObjectSupported = osg::isGLExtensionSupported(_contextID,GL_ARB_vertex_buffer_object); return _isVertexBufferObjectSupported; } there are two things that may go wrong, as far as I can see: 1. Context ID is not selected or not owned by current thread (see last OpenGL error) 2. Extension isn't supported To evaluate latter case, that is, that you certainly have the extension, you can write a simple test case or download OpenGL Extension Viewer application ( http://www.realtech-vr.com/glview/ ). To evaluate first case, well.. I don't know any better way but in my application, I have a screenshot operation. It's a GraphicsOperation that is added to the context. OpenGL graphics context will be selected and owned by that graphics thread when operation is running. Anywhere outside that thread (depending on threading model) may fail. To see what went wrong, check last OpenGL error after that call (which, too, may return an error if it isn't called from legal places). HTH Ismail On Tue, May 5, 2009 at 1:30 PM, Ufuk ufuk@gmail.com wrote: Thanks Robert, i know that you cant know the problem without seeing the code :) i just want to know that when isVertexBufferObjectSupported() function returns true or false? to use this support should i enable something? anyway now i will try to make a simpler example, then maybe i could show you the codes.. thanks again... On Tue, May 5, 2009 at 11:48 AM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Ufuk, I really can't guess what might be wrong because I know absolutely nothing about your application, I simply don't have magically powers to divine this stuff. What I do know is that the vertex buffer objects support does usually work, others do not report problems with it, so there likely something quite specific about your setup that is introducing this problem. Try using standard examples based on osgViewer as a sanity test then work back to an test problem that more closely resembles how you use the OSG. Robert. On Tue, May 5, 2009 at 8:57 AM, Ufuk ufuk@gmail.com wrote: Hi, Actually i dont think it is about hardware or driver because i did a project similar to this with this hardware and it is still working on my computer. it returns true on isVertexBufferObjectSupported() but this project was made in like osg ~1.6. The function on Geometry was virtual void drawImplementation(State state) const; on osg1.6 but now it is virtual void drawImplementation(RenderInfo renderInfo) const; on 2.8 so do you think there could be other reasons? On Mon, May 4, 2009 at 5:52 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Ufuk, The OSG checks for support of extensions such as vertex buffer objects, and will osg::State is one class that does this, so if you are isVertexBufferObjectSupported() is returning false then wait for it there is very good chance that your OpenGL driver/hardware doesn't support vertex buffer objects. Robert. On Mon, May 4, 2009 at 3:45 PM, Ufuk ufuk@gmail.com wrote: Hi, i am trying to make a terrain editor. here i wanted to implement my own drawImplementation of geometry but i could not get manage. i always get state.isVertexBufferObjectSupported() as false... when i ignore this false, i got another problems.. i think my problem is this isVertexBufferObjectSupported(). i want to know that what makes it true or false. what should i do to get it as true??? -- Ufuk ___ 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users
[osg-users] isVertexBufferObjectSupported() ?
Hi,i am trying to make a terrain editor. here i wanted to implement my own drawImplementation of geometry but i could not get manage. i always get state.isVertexBufferObjectSupported() as false... when i ignore this false, i got another problems.. i think my problem is this isVertexBufferObjectSupported(). i want to know that what makes it true or false. what should i do to get it as true??? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] cannot set child stateset in pagedLOD?
Hi, i have an .osg file which is like this: PagedLOD { nodeMask 0x cullingActive TRUE Center 512 512 0 Radius 724.077 RangeMode DISTANCE_FROM_EYE_POINT RangeList 5 { 1448.15 5792.62 0 1448.15 0 1448.15 0 1448.15 0 1448.15 } NumChildrenThatCannotBeExpired 0 FileNameList 5 { ter_0_0_0.ive ter_1_0_0.osg ter_1_1_0.osg ter_1_0_1.osg ter_1_1_1.osg } num_children 0 } and every .osg file which is in this file is like this file. they have 1 ive file and 4 osg files. by this method, we are loading child nodes in paging. here i want to render all of these in a shader. So i set the parent node stateSet but childs does not effect :( do you have any idea why i cant set the child node's stateset by changing the stateset of parent? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NightVision (Green and Blurry?)
Thanks to all...i will check spaceMonkey and osgPPU and Patrick, i will wait for your openEOIR. i am very curious about your project. 2009/3/24 Patrick Castonguay pcastong...@rogers.com With ref to osgPPU, I have use it to create a Infra-Red / BlackWhite / Color basic camera operator training prototype (which I name openEOIR, I should release the code next month or so on source forge) and it worked really well and was easy to get going with the RenderToTexture (It has great examples)... Cheers *Patrick * -- 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 -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] NightVision (Green and Blurry?)
Hi,I want to render all the scene in night vision mode. i read the previous posts but i could not find the way of rendering scene in a bit green and blurry. actually i also need to render light sources to much bright but i am not sure if it can be done? do you know any idea how can i do this? if there any of you did such a thing, please help me? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] about osgCuda
Hi,i read the topic about osgCuda. I am happy to hear that someone is working on merging these projects. i am also trying to do a project with cuda on osg. anyway i got so many build problems.. when i include something, i got another errors.. so do you have any sample projects or any other start points to share in this topic? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Mirrored camera
Hi Joakim, in examples osgcamera, in function: void multipleWindowMultipleCameras(osgViewer::Viewer viewer, bool multipleScreens) i tried this code sample: if (i != 2) viewer.addSlave(camera.get(), osg::Matrix::scale(aspectRatioScale, 1.0, 1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() ); else viewer.addSlave(camera.get(), osg::Matrix::scale(-1.0 * aspectRatioScale, 1.0, 1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() ); camera which has id 2 become mirrored. is it something that you want? On Mon, Mar 2, 2009 at 4:46 PM, Joakim Simonsson joa...@autosim.no wrote: On Mon, 02 Mar 2009 15:37:07 +0100, Mathias Fröhlich m.froehl...@science-computing.de wrote: Hi, On Monday 02 March 2009 15:24, Joakim Simonsson wrote: Is it possible to use two cameras, where one is mirrored, that share the same scene? You should be able to have that attached either to the camera itself, the mirrored one (is this true, or are the StateSets at the camera something special - I dont remember by heart?). I tried to attach that stateattribute to the mirrored camera only. But it does not seem to work. Or attach a group to the camera that is not shared , apply that state at this group and attach the shared graph to those two groups. I'll go for the group approach. Thanks for your help. -- Joakim ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Model refrences to another model?
Hi again, i also recognized that when i put all the data into \bin directory, i can load all models but if i give the path of models it does not load.. should i have a data directory or how should i set this? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Model refrences to another model?
Hi,i have a question about loading models. i was checking the trian3d (http://www.triangraphics.de/index.php?l=eng) and there are some models that they produced. These terrain models has one master model which references to child of this model. It also includes some level of details. actually i am asking this question because i have not seen such a thing before. (probably ignorance of me) and i searched it in the mail group but i could not find any thing about it or i do not know how to search. anyway, when i loaded the master model, child models should be loaded automatically when needed but i could not do this. Do you know any thing about this? should i do some extra thing to load other models? i downloaded models from the address: http://www.triangraphics.de/index.php?1=Downloadl=eng i hope it is not so weird question... thanks... -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] need tagged attributes of terrain?
Hi, i need a data format that provides me tagged attribute values of a terrain like if it is grass, sand, gravel or asphalt. i have to do a vehicle simulator that will driven on the terrain. Here i do not know how should i store the terrain. If i store the terrain as a model, then which formats do you suggest for this tagged values? or do you have any other ideas about this? -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multi camera
Hi, i am trying to apply multi camera on my project. I am referencing Examples osgcamera. Here i did almost the same with your examples but there are few changes. Maybe this changes causes problems because in your examples runs in 60fps even there are 6 windows. My fps is 60fps/numberOfWindows :( so i want to ask some questions about this. Here is my code about multi window: void MyApplication::multipleWindowMultipleCameras() { const int numberOfWindows = 4; osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); unsigned int screenWidth, screenHeight; wsi-getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), screenWidth, screenHeight); double aspectRatioScale = (double)numberOfWindows / 2; double translate_x = double(numberOfWindows) - 1; simBase::SimCamera* camera; //SimCamera encapsulates osgCamera. for (int i = 0; i numberOfWindows ; i++, translate_x -= 2.0) { if (i == 0) { camera = getCamera(); //myApplication main camera. } else { camera = new simBase::SimCamera(); //new camera which shows other parts of scene. } osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-screenNum = 0; traits-x = (i * screenWidth) / numberOfWindows; traits-y = 0; traits-width = screenWidth/numberOfWindows - 1; traits-height = screenHeight; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::Camera* osgCamera = camera-getOSGCamera(); osgCamera-setGraphicsContext(gc.get()); osgCamera-setViewport(new osg::Viewport(0,0, screenWidth / numberOfWindows, screenHeight)); GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT; osgCamera-setDrawBuffer(buffer); osgCamera-setReadBuffer(buffer); simBase::SimView* view = getView(); //SimView encapsulates osgViewer::View. if (i != 0) //if i apply this process to main camera, then i see nothing on the scene. So i disabled this for first camera. view-addSlave(camera, osg::Matrix::scale(aspectRatioScale, 1.0, 1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() ); } } One important distance here is: i use osgViewer::View directly. I dont use osgViewer::Viewer. and MyApplication has a osgViewer::CompositeViewer. Even if i call the function as getCompositeViewer()-getView(0)-addSlave(osgCamera, osg::Matrix::scale(aspectRatioScale, 1.0, 1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() ); So i wonder, is it really that much different to use CompositeViewer or Viewer. Our design looks like a bit Delta3D (maybe you know) so i wanted to get some advices about this.. I wanted to know if Viewer has capability show multiscreen better than CompositeViewer or something else... -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Multiple GPU
Hi, I have to do a simulation project which needs 8 screens. This system likes a dome. so i want to ask few questions about this: 1) i want to use multiple gpu's. So is there a limit on number of gpu's on a pc? i saw 4 gpu's on a pc and every gpu has 2 outputs. can i render 8 screen with viewer? 2) how can i set which gpu render which screen. is there an auto management system in viewer? if i have screens which have resolutions like 8x1280x1024 or 4x2560x1024 or any other combination of this, should i do an extra thing for this? 3) do you think i will have a critical frame rate problem if i render 8 screens. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Multiple GPU
Hi, Thank you so much for your answers. :) i will research and try your advices. I wanted to learn where to start. i will let you know what i have done about this. thanks again :) -- Ufuk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org