[osg-users] [3rdparty] Frame Rate Decay w/ SilverLining Integration
Greetings, Sorry for the wall-of-text. I am working on a really thorny issue, and I want to include as much information as possible. I am not sure that this is necessarily an OSG-related bug, but I was wondering if there is anyone here who can provide some insight anyway, because I can get the bug to appear/disappear by changing certain OSG settings, but I have no idea why. Basically, we have an OSG-based app (v. 2.8.3) that is integrated with SilverLining for all of our atmospheric stuff. The problem is that, on some computers, we are seeing a frame rate decay. That is, the frame rate will start off high (180fps or so), and the steadily decrease at a rate of about 2fps/sec. So after 30 seconds, it's running at 120fps. After a minute, it's running at 60fps. And so on. Note: this is only happening on a couple of computers. We've had an opportunity to test this app on 6 different computers. So far, the problem has shown up on 2 of them. On those two computers, the problem only shows up under the following conditions: 1. I'm using SilverLining, AND 2. I'm using the SingleThreaded model, OR the app uses render-to-texture. (the render-to-texture is done by attaching an osg::Texture2D to an osg::Camera, set to PRE_RENDER with a FRAME_BUFFER_OBJECT render target implementation, which is then added to the scene graph) So, if I remove the SilverLining integration, the problem goes away. However, SilverLining in of itself is not a sufficient cause. I know this because I can run a simple app, like the OSG 2.x sample that ships with the SilverLining SDK, and the problem does not appear. However, if I add a simple RTT camera to that sample, the problem shows up. Also, if I set the threading model to SingleThreaded, the problem shows up whether there's any RTT in the scene or not. In our own app, the problem goes away if I use a non-SingleThreaded model AND I disable any features that use RTT (osgShadow, mirrors, etc.). There might be other conditions that cause the problem to show up, but if so, I haven't found them. And again, this only happens on two of the computers, out of the six that we've had an opportunity to try (we'll have an opportunity to test on more computers soon). Part of what makes this bug so devious is that it doesn't happen on every computer, and I'm guessing that reduces my chance of finding someone who has already encountered it and solved it. =P Another interesting fact is, if I change the threading model at runtime (using the 'm' key, thanks to the ThreadingHandler), the frame rate Resets, and then starts decaying again. In other words, the app will start at 180fps or so, and then decay (after a minute or so) to 30fps. Then, if I hit the 'm' key to change to a different threading model (doesn't matter which), the frame rate shoots back up to 180fps and then starts decaying again. I can do this over and over again by hitting the 'm' key. Tomorrow, I'll try to delve into the depths of the OSG and SilverLining code to see if I can find the problem. In the meantime, I would feel silly if I didn't at least throw a couple of messages out there and ask if someone else has already encountered this. Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39067#39067 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Flat Database Generation in Meters really shocked me when i load it to my osg application..!!!
Hi Shayne, Hi Glenn, Thanks for ur kind replies.. Shayne, As you know MyTerrain.tif file projection info was; Geographic ( Latitude / Longitude ) [N:36, E128] [N:38, E130] is in Utm Zone 52 Datum : WGS84 Unit : Arc degrees. i tried to reproject MyTerrain.tif file using ur gdalwarp command like this.. gdalwarp -s_srs proj=latlong +datum=WGS84 -t_srs proj=utm +zone=52 +datum=WGS84 MyTerrain.tif MyTerrainUtm.tif command prompt displayed such an error; ERROR 1 : Translating source or target SRS failed: proj=latlong +datum=WGS84 Is gdalwarp command true in terms of parameters? And one more question.. Should i run gdalwarp command for each of my dted-2 files which have Geographic projection before using osgdem? Thanks a lot, Atilla. S2LR wrote: Try using the following to reproject your data... gdalwarp -s_srs proj=latlong +datum=WGS84 -t_srs proj=utm +zone=11 +datum=WGS84 infile outfile Do this before using osgdem on your data files. UTM zone selection will be dependent upon where your lat/lon is... -Shayne -Original Message- From: [mailto:] On Behalf Of Atilla Selem Sent: Thursday, May 05, 2011 11:09 AM To: Subject: Re: [vpb] Flat Database Generation in Meters reallyshocked me when i load it to my osg application..!!! Hi Glenn, Thanks for the tip.. but i really need to know, Where should i do reprojection? In my dted-2 files and/or in my GeoTiff.file (since their projections are both Geographic - Lat/Lon) before executing osgdem? Or should i do re-scaling or whatever after i load terrain in osg application? And What tool or command option should i use to reproject to UTM? thanks in advance.. Atilla. Glenn Waldron wrote: Atilla,osgdem is creating your model in what's called a plate carre projection -- in which degrees are simply reinterpreted as meters. That is why your 2x2 degree cell is appearing as 2x2 meters. You need to reproject into a proper projected spatial reference system (like UTM) to get the correct extents. Check the bottom of this page for tips: http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem) Glenn Waldron / Pelican Mapping / @glennwaldron On Thu, May 5, 2011 at 12:25 PM, Atilla Selem () wrote: Hi, i have tried to generate a terrain (.ive) database using osgdem commandline options in order to buid a flat database where coordinates are in meters. After successfull generation i put that terrain in my osg application and really shocked! Before telling you what i saw as the output let me tell you my inputs. - i have four Dted-2 elevation file, - i have one GeoTiff image which is successfully mapped on dted files. - Dteds are starting (from 36N, 128E to 38N, 130E). So there are 4 1x1 degree cells [ Total size is 2x2]. - GeoTiff image also extends from 36N, 128E to 38N, 130E. So it covers [2x2] elevation file without no problem. Dted and Image Coordinate Systems are: Geographic ( Latitude / Longitude ) Datum : WGS84 Unit : Arc degrees. after putting dteds and image in seperate folders ( MyDted, MyImage ) i executed the following vpb command to generate my flat database. - osgdem -t MyDted -d MyImage -l 8 -v 0.1 -o MyTerrain_Flat.ive after executig above line and loading Terrain_Flat.ive on my osg application it was really difficult to find where is MyTerrain_Flat.ive on my view. When i zoom in What i saw was a 2x2 meter flat database in osg size. !!!It was located on x = 128 , y = 36 on my view according to ( 0,0,0) of my scene!!! Real size of Dteds of Image was 178 km in Easting and 221 km in Northing.. i have checked size and everythings was ok with Dted and Image. Now the question is 1 - Is there a problem with vpb when creating flat database in meters? 2- Have i missed a command line option? 3- Why is the generated terrain covers 2x2 meters although it is 178 x 221 km in real size? 4- Why it is located in x = 128 , y = 36 ? Those were Lower Left Lat/Lon coordinates of dteds and image file? 4- Isn't it possible to generate real size flat terrains in meters in x,y,z using vpb? Any help is really appreciated... ... Thank you! Cheers, Atilla -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39045#39045 (http://forum.openscenegraph.org/viewtopic.php?p=39045#39045) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Read this topic online here:
Re: [osg-users] [3rdparty] Frame Rate Decay w/ SilverLining Integration
Hi Knarf, what Silverlining do you use? the most vurrent ( 2.15) ? What is your system? Especially your graphics hardware? Nvidia oder AMD? I use Silverlining in osgVisual and do not have your described problem. Maybe look at my silverlining integration and at the important integration parts (initialize, sky_drawable and cloud_drawable); Good luck! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39071#39071 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi, On Fri, May 6, 2011 at 3:24 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: This can actually be handled automatically with the right usage of FindOSG. But I agree that it's not always obvious how to do that. When you start writing tons of ifs for each configuration, it's a clear sign that you're not using CMake to its full potential. Yes. That is *exactly* the point :) I'll have a look at it tomorrow morning. Thank you very much. I really appreciate it. -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] lazy readNodeFile
Hi All, I implemented a class that embeds an osg::Group. The real graphics for my object is loaded from a file with a readNodeFile() call and the resulting node is set as child of the osg:Group. Now I would like the readNodeFile() is called just when it is needed, that means when the viewer shows the object. Is there something ready in the osg libs to do so? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39073#39073 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] lazy readNodeFile
Hi, Maybe the ReadNodeFileCallback can help you. It is used by the DatabasePager, so you can manage what is done for each readNodeFile call. Or maybe making your own node node as PagedLOD which load the file only when requested... Or playing with UpdateCallback... Sorry this is not a real answer but maybe it can help you. Regards, Vincent. Le 06/05/2011 09:45, Gianni Ambrosio a écrit : Hi All, I implemented a class that embeds an osg::Group. The real graphics for my object is loaded from a file with a readNodeFile() call and the resulting node is set as child of the osg:Group. Now I would like the readNodeFile() is called just when it is needed, that means when the viewer shows the object. Is there something ready in the osg libs to do so? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39073#39073 ___ 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] stats issue with svn
Hi Tom, I have no idea I am afraid, I have seen the jumping as you describe. One thing to try is when its jumping or the framerate is choppy, press m and change the threading mode, does the choppiness go away? It could be the stats are showing correct and there is something tying up the GPU when first launched, its out my league though :) My system is quite quick so it's hard to tell if it's actually tying up the GPU or just a stats computation issue. Regards Martin Naylor -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tom Pearce Sent: 05 May 2011 17:40 To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] stats issue with svn Martin, J-S, Do you happen to know if this issue occurs only when the stats are enabled, or if it also occurs in the viewer without the stats displayed? I ask because I've never actually used the stats functionality, but sometimes when we launch our application, the graphics appear lower quality (as in occasional jumpiness) but other times this problem is gone or at least barely noticeable. I'm just curious if this might be the same issue. Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39048#39048 ___ 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] lazy readNodeFile
Thanks Vincent for the fast reply. I give a look at what you suggested. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39076#39076 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] lazy readNodeFile
Hi, maybe also ProxyNode is what you need.. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39077#39077 ___ 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 All, Paul, I think I've done some of the benchmark you're referring to on my end right before starting this thread =) In my example I replicate the same geometric primitive many times. The geometric object is a little cube counting 40 vertex and 66 triangles all rendered as a single drawElements in batch. I'm using a very basic toon shader to render them, passing vertices, normals and a vec4 attribute array. Here's what I got when I test with 20.000 instances of the primitive when they are all in the view frustum, my box is Win7, i7 920 processor, nVidia 285GTX: 1) 20.000 separate drawables, each with its own VBO assigned. CULL: 11ms, DRAW: ~40ms, GPU: ~37ms Stats are very unstable with this scenario, even when I don't move and with all of the threading models. 2) 20.000 separate drawables, sharing underneath the same VBO and EBO (at least I hope I'm doing it the right way, check the code in my previous post) CULL: ~8ms, DRAW: ~36ms, GPU: ~35ms 3) A single geode+geometry in which I combine all of the instances, rendered in a single VBO + EBO CULL: 0.04ms, DRAW: 0.18ms, GPU: ~4.5ms Stats very stable, no differences among threading models. With this scenario the fragment opeations becomes the bottleneck when I look at the scene from a viewpoint that cause all the geometries to be rendered almost back to front, so that nothing is culled nor discarded by z test. So scenario 3 provides a huge boost as expected, while the difference between 1 and 2 is not as evident as I had hoped... I'll see if I'm able to to patch the osg code to achive what Robert suggests. Thanks, Ricky On Thu, May 5, 2011 at 20:47, Robert Osfield robert.osfi...@gmail.comwrote: HI All, Current the OSG does unbind VBO's at the end of osg::Geometry::drawImplementation(..) so that VBO and EBO state doesn't leak into adjoining Drawables. If an implementation is known to only use VBO's, with no display lists then potentially we could not bother with the unbind at the end of Geometry::drawImplemenation() and use lazy state updating. Robert. ___ 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 Ricky, Given you have 20,000 instances their will and cull and draw dispatch bottleneck. Sharing VBO's won't really share this much. The big elephant in the room is the number of seperate objects to traverse in the cull and draw traversals and the number of seperate GL calls that will have to be made. As you've found batching the data ovoids these bottlenecks and is certainly the way forward. Robert. On Fri, May 6, 2011 at 9:49 AM, Riccardo Corsi riccardo.co...@kairos3d.it wrote: Hi All, Paul, I think I've done some of the benchmark you're referring to on my end right before starting this thread =) In my example I replicate the same geometric primitive many times. The geometric object is a little cube counting 40 vertex and 66 triangles all rendered as a single drawElements in batch. I'm using a very basic toon shader to render them, passing vertices, normals and a vec4 attribute array. Here's what I got when I test with 20.000 instances of the primitive when they are all in the view frustum, my box is Win7, i7 920 processor, nVidia 285GTX: 1) 20.000 separate drawables, each with its own VBO assigned. CULL: 11ms, DRAW: ~40ms, GPU: ~37ms Stats are very unstable with this scenario, even when I don't move and with all of the threading models. 2) 20.000 separate drawables, sharing underneath the same VBO and EBO (at least I hope I'm doing it the right way, check the code in my previous post) CULL: ~8ms, DRAW: ~36ms, GPU: ~35ms 3) A single geode+geometry in which I combine all of the instances, rendered in a single VBO + EBO CULL: 0.04ms, DRAW: 0.18ms, GPU: ~4.5ms Stats very stable, no differences among threading models. With this scenario the fragment opeations becomes the bottleneck when I look at the scene from a viewpoint that cause all the geometries to be rendered almost back to front, so that nothing is culled nor discarded by z test. So scenario 3 provides a huge boost as expected, while the difference between 1 and 2 is not as evident as I had hoped... I'll see if I'm able to to patch the osg code to achive what Robert suggests. Thanks, Ricky On Thu, May 5, 2011 at 20:47, Robert Osfield robert.osfi...@gmail.com wrote: HI All, Current the OSG does unbind VBO's at the end of osg::Geometry::drawImplementation(..) so that VBO and EBO state doesn't leak into adjoining Drawables. If an implementation is known to only use VBO's, with no display lists then potentially we could not bother with the unbind at the end of Geometry::drawImplemenation() and use lazy state updating. Robert. ___ 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] large VBOs for multiple Drawables
Hi Robert, thank you for your advice, but I used 20.000 only for benchmarking purposes, I'll balance better the scenegraph in the real application. Even so, with the scenario number 2, I was hoping to achieve performances closer to scenario 3 than 1, as the stats scale quite in linear way with smaller number of drawables. Do you think the approach you suggest, avoiding explicit buffer unbind, would provide some benefit? I also have another question: when assigning vertex attributes and using VBO, I've met some issues using methods Geometry::setNormal/ColorArray and retrieving the related attributes with gl_Normal/Color in shaders, while everything works smooth if I assign and bind specific attribute indices. What is the reason behind it? Thank you, Ricky On Fri, May 6, 2011 at 11:29, Robert Osfield robert.osfi...@gmail.comwrote: Hi Ricky, Given you have 20,000 instances their will and cull and draw dispatch bottleneck. Sharing VBO's won't really share this much. The big elephant in the room is the number of seperate objects to traverse in the cull and draw traversals and the number of seperate GL calls that will have to be made. As you've found batching the data ovoids these bottlenecks and is certainly the way forward. Robert. On Fri, May 6, 2011 at 9:49 AM, Riccardo Corsi riccardo.co...@kairos3d.it wrote: Hi All, Paul, I think I've done some of the benchmark you're referring to on my end right before starting this thread =) In my example I replicate the same geometric primitive many times. The geometric object is a little cube counting 40 vertex and 66 triangles all rendered as a single drawElements in batch. I'm using a very basic toon shader to render them, passing vertices, normals and a vec4 attribute array. Here's what I got when I test with 20.000 instances of the primitive when they are all in the view frustum, my box is Win7, i7 920 processor, nVidia 285GTX: 1) 20.000 separate drawables, each with its own VBO assigned. CULL: 11ms, DRAW: ~40ms, GPU: ~37ms Stats are very unstable with this scenario, even when I don't move and with all of the threading models. 2) 20.000 separate drawables, sharing underneath the same VBO and EBO (at least I hope I'm doing it the right way, check the code in my previous post) CULL: ~8ms, DRAW: ~36ms, GPU: ~35ms 3) A single geode+geometry in which I combine all of the instances, rendered in a single VBO + EBO CULL: 0.04ms, DRAW: 0.18ms, GPU: ~4.5ms Stats very stable, no differences among threading models. With this scenario the fragment opeations becomes the bottleneck when I look at the scene from a viewpoint that cause all the geometries to be rendered almost back to front, so that nothing is culled nor discarded by z test. So scenario 3 provides a huge boost as expected, while the difference between 1 and 2 is not as evident as I had hoped... I'll see if I'm able to to patch the osg code to achive what Robert suggests. Thanks, Ricky On Thu, May 5, 2011 at 20:47, Robert Osfield robert.osfi...@gmail.com wrote: HI All, Current the OSG does unbind VBO's at the end of osg::Geometry::drawImplementation(..) so that VBO and EBO state doesn't leak into adjoining Drawables. If an implementation is known to only use VBO's, with no display lists then potentially we could not bother with the unbind at the end of Geometry::drawImplemenation() and use lazy state updating. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Manual perspective distortion?
Dear OSG Forum readers, as we recently installed a multi-projector-based viewing screen I am currently working on its calibration. I managed to fix most of the displaying issues so far; however, one issue remains that I am quite unsure of how to approach it. Due to the mounting of the projectors in relation to the viewing screen, the projected image is distorted in a way that the projected image no longer resembles a rectangele but a trapezium. To give you a better understanding of the situation, I made a small sketch to visualise the problem (compare attachment). The grey area is the projection area, while the blue frame resembles the area displayed by the projector. As can be seen in the image, whilst the left and bottom corners are quite well aligned, the upper right corner flees the projection area. Since the mounting of the projectors cannot be changed or adjusted further, I have to solve the problem on software side. I was thinking of somehow manually creating a perspective distortion matrix, such that I can move that corner so it fits in the projection area. However, I am a bit lost how to do that. Is there anyone who could point me into the direction of how such a matrix could be created and what matrix to use at all? Intuitively, I've searched a bit in the direction of a projetion matrix, but couldn't quite find the right way to do it yet! Anyways, thank you very much in advance for reading :) Best regards, Alexander -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39083#39083 attachment: distorted-projection.png___ 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
You usually want to create GL batches that are as large as possible. 10 draw calls of 100 elements will be slower than 1 draw call of 1000 elements. Something else I have noticed a little while ago was that the stateset processing engine of OSG might be slow. One thing I have been surprised with was the performance with a scene graph containing just empty statesets on drawables vs. no stateset at all. Just having empty statesets decreases perf quite a bit, eg. just by calling getOrCreateStateSet. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39084#39084 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] lazy readNodeFile
I gave a look at PagedLOD and ProxyNode classes and the second one seems what I need. But unfortunately I don't understand the logic behind the loading. Moreover even if I set LoadingExternalReferenceMode the to LOAD_IMMEDIATELY the file is not really loaded immediately. Which are the events that cause the file loading? Is here a way to force the loading? Basically my scenario is as follows. A piece of code should be able to create instances of my class setting also the external file for the real graphic but I don't want the graphic to be loaded at this point. In fact the code should only generate an object herarchy to be stored in an xml file. Another piece of code that reads the xml is able visualize the graphic, and so load it first. Maybe playing with the UpdateCallback would be more appropriate in this case? Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39085#39085 ___ 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 Ricccardo, On Fri, May 6, 2011 at 10:53 AM, Riccardo Corsi riccardo.co...@kairos3d.it wrote: Do you think the approach you suggest, avoiding explicit buffer unbind, would provide some benefit? It's unlikely to make a big difference as it's only one small part of all the operations being done in the draw traversal. I also have another question: when assigning vertex attributes and using VBO, I've met some issues using methods Geometry::setNormal/ColorArray and retrieving the related attributes with gl_Normal/Color in shaders, while everything works smooth if I assign and bind specific attribute indices. What is the reason behind it? No clue what might be amiss, there is far too little information to go on to know. I haven't personally seen problems with using setNormalArray/setColorArray when using shaders, perhaps there is somethin unusual you are doing. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compile osg in 32 Bit
Hi, Unfortunately there is no file flags.make in my OpenSceneGraph folder:/ Thank you! Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39088#39088 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compile osg in 32 Bit
Martin Haffner writes: Hi, Unfortunately there is no file flags.make in my OpenSceneGraph folder:/ Not in the OSG source folder, but in your build folder. Anyway, just compile with the VERBOSE environment variable to see how it is going. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Flat Database Generation in Meters really shocked me when i load it to my osg application..!!!
Hi Glenn, i have reprojected MyTerrainImage.tif from GCS ( Geographic coordinate system ) to UTM using GlobalMapper successfully, Should i re-project Dted-2 Elevation files to UTM projection as well? İf so; Should i use osgdem command like this; osgdem --cs +proj=utm +zone=52 -d MyDteds - MyImage -o... or without --cs and projection info ( since they are already projected) osgdem -d MyDteds - MyImage -o... ??? thx, atilla. Glenn Waldron wrote: I recommend reprojecting them first. You can use gdalwarp, or a tool like Global Mapper. You may also want to investigate osgEarth as an alternative approach to doing terrain with OSG. Glenn Waldron / Pelican Mapping / @glennwaldron On Thu, May 5, 2011 at 1:08 PM, Atilla Selem () wrote: Hi Glenn, Thanks for the tip.. but i really need to know, Where should i do reprojection? In my dted-2 files and/or in my GeoTiff.file (since their projections are both Geographic - Lat/Lon) before executing osgdem? Or should i do re-scaling or whatever after i load terrain in osg application? And What tool or command option should i use to reproject to UTM? thanks in advance.. Atilla. Glenn Waldron wrote: Atilla,osgdem is creating your model in what's called a plate carre projection -- in which degrees are simply reinterpreted as meters. That is why your 2x2 degree cell is appearing as 2x2 meters. You need to reproject into a proper projected spatial reference system (like UTM) to get the correct extents. Check the bottom of this page for tips: http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem) (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem)) Glenn Waldron / Pelican Mapping / @glennwaldron On Thu, May 5, 2011 at 12:25 PM, Atilla Selem () wrote: Hi, i have tried to generate a terrain (.ive) database using osgdem commandline options in order to buid a flat database where coordinates are in meters. After successfull generation i put that terrain in my osg application and really shocked! Before telling you what i saw as the output let me tell you my inputs. - i have four Dted-2 elevation file, - i have one GeoTiff image which is successfully mapped on dted files. - Dteds are starting (from 36N, 128E to 38N, 130E). So there are 4 1x1 degree cells [ Total size is 2x2]. - GeoTiff image also extends from 36N, 128E to 38N, 130E. So it covers [2x2] elevation file without no problem. Dted and Image Coordinate Systems are: Geographic ( Latitude / Longitude ) Datum : WGS84 Unit : Arc degrees. after putting dteds and image in seperate folders ( MyDted, MyImage ) i executed the following vpb command to generate my flat database. - osgdem -t MyDted -d MyImage -l 8 -v 0.1 -o MyTerrain_Flat.ive after executig above line and loading Terrain_Flat.ive on my osg application it was really difficult to find where is MyTerrain_Flat.ive on my view. When i zoom in What i saw was a 2x2 meter flat database in osg size. !!!It was located on x = 128 , y = 36 on my view according to ( 0,0,0) of my scene!!! Real size of Dteds of Image was 178 km in Easting and 221 km in Northing.. i have checked size and everythings was ok with Dted and Image. Now the question is 1 - Is there a problem with vpb when creating flat database in meters? 2- Have i missed a command line option? 3- Why is the generated terrain covers 2x2 meters although it is 178 x 221 km in real size? 4- Why it is located in x = 128 , y = 36 ? Those were Lower Left Lat/Lon coordinates of dteds and image file? 4- Isn't it possible to generate real size flat terrains in meters in x,y,z using vpb? Any help is really appreciated... ... Thank you! Cheers, Atilla -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39045#39045 (http://forum.openscenegraph.org/viewtopic.php?p=39045#39045) (http://forum.openscenegraph.org/viewtopic.php?p=39045#39045 (http://forum.openscenegraph.org/viewtopic.php?p=39045#39045)) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
Re: [osg-users] Compile osg in 32 Bit
Hi Martin, As far as I know is more a gcc + cmake problem that OSG problem itself. What I do when I want build with cmake and 32 bits in my 64 bits box is: $ cd osg-svn $ mkdir build $ cd build $ export CFLAGS=-m32 $ export CXXFLAGS=-m32 $ cmake .. -D (whatever you need here) If you already have an out-of-source build (or in-source) you need to delete CMakeCache.txt and redo cmake. CMake automatically will check exported CFLAGS and CXXFLAGS. The problem once you have 32bits building is to have all OSG dependencies you need in 32 bits.. this could be a little bit pain. Hope this helps. Rafa. 2011/5/6 Alberto Luaces alua...@udc.es: Martin Haffner writes: Hi, Unfortunately there is no file flags.make in my OpenSceneGraph folder:/ Not in the OSG source folder, but in your build folder. Anyway, just compile with the VERBOSE environment variable to see how it is going. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Manual perspective distortion?
Hi Alexander In our 3-channel setup we use a per pixel distortion. In a rgb image we store the distortion. It is stored for every pixel encoded in the R,G and B value. You can take a look on my solution on osgvisual.org If you have a solution for your analytic distortion, please let me know. Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39087#39087 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp: CMake build
Hi Farshid, Thanks, I will go ahead and add these to the trunk. Thanks for that. I am going to keep the existing Visual Studio projects though. The existing projects can be used for both 32 and 64-bit builds. I even wrote a Python script in the Setup folder that automates building the Visual Studio projects for each version/platform and creates the installer. It's very easy to do the same with the CMake-generated projects. You just generate projects for both architectures (can also be done from a batch file or script) and build both from the script the same way you build the current solution files. I think keeping one set of build files is simpler in maintenance, but it's up to you. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Need Efficient mesh data structures
Hi, I have used Triangle, a thin C++ library for generating TINs in 2D. I used it when I develop Pathfinding algorithm in Hierarchical graphs. It generates constrained/non-constrained Delaunay triangles, ... Thank you! Cheers, Yonas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39080#39080 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Please test svn/trunk in prep for next dev release
Hi All, I would like to make another dev release, if possible today, that wraps up various submissions and my work on resolving code issues reported by Coverity. I've tested Linux, so probably don't need to much testing here, but Windows and OSX it'd be very useful to have feedback on. Thanks in advance, Robert. ___ 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
On 5/6/2011 4:05 AM, Fred Smith wrote: You usually want to create GL batches that are as large as possible. 10 draw calls of 100 elements will be slower than 1 draw call of 1000 elements. Something else I have noticed a little while ago was that the stateset processing engine of OSG might be slow. One thing I have been surprised with was the performance with a scene graph containing just empty statesets on drawables vs. no stateset at all. Just having empty statesets decreases perf quite a bit, eg. just by calling getOrCreateStateSet. osgWorks.google.com contains the CountStateSets visitor, which will remove empty StateSets, just for this reason. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Robert, in about 1-1.5 hours I can start to compile OSG and report back to you. I'll do compile testing (what else ;)) and simple osgViewer testing. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39094#39094 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fine-grained render ordering
Sergey, Thanks, that's been very helpful. I have some other questions though: suppose you have a graph with camera C, a child of sibling cameras A B, e.g. A - C B - C Will C be rendered twice? If so, how would one make C render first, then render each of A, B with the output textures of C? Would it work to make C a child of A only, with A PRE_RENDER and B POST_RENDER? Thanks, Craig On Tuesday, May 3, 2011 at 2:30 AM, Sergey Polischuk wrote: Sent incomplete message by accident :) Example : camera1 - camera2(prerender) - camera4(prerender) - camera3(postrender) render order will be camera4 (rendered first), camera2, camera3, camera1(rendered last) Cheers, Sergey. 03.05.2011, 11:28, Sergey Polischuk pol...@yandex.ru: Hi, Craig When you have nested cameras they work like nested render stages. All cameras under another camera node will render just before or just after (depending on render order set on camera) rendering parent camera. With that in mind you can build hierarchy that suits your purposes. Example : camera1 - camera2 02.05.2011, 16:17, Craig S. Bosma craig.bo...@gmail.com;: Will the same technique work with a third camera C? Sent from my iPhone On Apr 28, 2011, at 11:06 AM, Sergey Polischuk pol...@yandex.ru wrote: Hi, Craig In your example, put camera A as child of B with render order on camera A set to prerender. Cheers, Sergey. 27.04.2011, 18:38, Craig S. Bosma craig.bo...@gmail.com: Robert, Thanks for pointing out the TraversalOrderBin, I wasn't aware of that. However, I'm still a little unclear on how that might help for my use. Suppose I have a scene with with a root Group node and two child Camera Nodes, A and B. Suppose both render to a texture via FBO, and that B needs A's texture output. If I put the root node in the TraversalOrderBin, would that guarantee that camera A is rendered completely before camera B? What if A instead were a child of B? Thanks, Craig On Tuesday, April 26, 2011 at 5:01 AM, Robert Osfield wrote: Hi Craig, The best way to manage render bin is vis State::setRenderBinDetails(), and in the 2.9.x dev series you can now select a render bin that sorts on traversal order of a subgrpah which makes some techniques easier - use the RenderBin string TraversalOrderBin to select this bin. If you want to create and chain RenderStages then using an osg::Camera in the scene graph is often one of the best ways to do this, and use the Camera::setRenderOrder(..) to control the order. You can also use a custom cull traversal callback to create RenderStage/RenderBin and assign these to the rendering backend, but this does require a greater knowledge of the internals of the rendering backend. Robert. On Fri, Apr 22, 2011 at 9:52 PM, Craig S. Bosma craig.bo...@gmail.com wrote: Hi, I'm working on a shader-driven graphics pipeline for an OSG-based app, and I want to better understand how I can better control the rendering order. I want to render my initial scene to several texture targets, with opaque and transparent objects handled separately. Currently I do this using node masks, but from this thread (http://forum.openscenegraph.org/viewtopic.php?t=2374) it seems like it would be better to use renderbin/renderstages. I have several more post-processing stages to follow, so I'm convinced that's the way to go for me to have full control over the pipeline. I've dug into the source for SceneView, RenderBin, RenderStage, etc. but it's not obvious to me how to shift objects from one bin to another (aside from setRenderBinDetails), or how to add stages that form a dependency chain. If anyone has examples or general advice on where to look, I'd be glad to hear it. Thanks, Craig ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org
Re: [osg-users] Please test svn/trunk in prep for next dev release
On 5/6/2011 7:20 AM, Robert Osfield wrote: Hi All, I would like to make another dev release, if possible today, that wraps up various submissions and my work on resolving code issues reported by Coverity. I've tested Linux, so probably don't need to much testing here, but Windows and OSX it'd be very useful to have feedback on. Would it be helpful for me to post links to the OSX and Win binary builds that started at midnight Colorado time? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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
[osg-users] Add A Function getRefFromObjectCache(const std::string fileName) ?
HI,all When writing a osgDB::ReadFileCallback, We need know if therewas someobject existed in the Registry's object cacheonsometime. Usualy, We call osgDB::Registry::instance()-getFromObjectCache to do this. Example: osg::Object * obj = osgDB::Registry::instance()-getFromObjectCache (); if(obj) { doSomething(); } else { doOtherthing(); } When using this in multithread environment , it is not thread safe: obj maybebe deleted before getFromObjectCache return. So , Do We needadd a function osg::refOjbect getRefFromObjectCache(conststd::stringfileName ) for osgDB::Registry? Thankyou! Cheers, lilinx---卡巴斯基,价值非凡的安全保护 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Farshid, OK. The different ways you mention above, are they all currently supported by OSGExp? Meaning, the material name is exported? The object properties field is exported as descriptions you say? (I haven't gone through the code to OSGExp yet) Yes, all the methods I described are supported by the existing exporter. Question then, where do I go in Max to set these kinds of tags? Can you give me an example of what your artist would do to say that a given object (or a given material) has a normal map? Have you perhaps not seen this question? I would like to take the same approach as you as much as possible... Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Just jumping into this thread, I admit that I haven't read it all the way through, so hopefully this is relevant. What I have done to support things like specular maps and bump maps in models exported from Maya is to modify the dae loader found to support the extra tags that are added to the Collada file from OpenCollada exporter The OpenCollada exporter will add a bump tag to the dae file and also export a spec map to the specular material. Obviously this doesn't export shaders etc, so there still a bit of manual setup but it's a start. If you'd like the source changes I'm happy to let you have them. K. On 6 May 2011 15:11, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.comwrote: Hi Farshid, OK. The different ways you mention above, are they all currently supported by OSGExp? Meaning, the material name is exported? The object properties field is exported as descriptions you say? (I haven't gone through the code to OSGExp yet) Yes, all the methods I described are supported by the existing exporter. Question then, where do I go in Max to set these kinds of tags? Can you give me an example of what your artist would do to say that a given object (or a given material) has a normal map? Have you perhaps not seen this question? I would like to take the same approach as you as much as possible... Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.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] Animate a 3D model using osg::Animation and bvh plugin
Hi, I would like to use osg_bvh plugin and osg:animation to animate a 3D model that has DOFTransform nodes. But i don't understand how use osgAnimation::Skeleton, osgAnimation::Animation, osgAnimation::BasicAnimationManager, osgAnimation::Bone. To animate a single DofTransform nodes inside model (i.e. head) i traverse 3D model, but how can i get information by bvh? I use : osg::Node* loadedModel = osgDB::readNodeFile(SimpleWalk.bvh); but i don't know how to get information about head rotation. Moreover, if i don't use osgAnimation Classes, i can set hpr bvh info to each DofTransform ... but it could be an hard work. I suppose that it could be more simpler using osganimation. Could you give me some suggestions? Thank you! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39103#39103 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Flat Database Generation in Meters reallyshocked me when i load it to my osg application..!!!
Try omitting the s_srs portion of the gdalwarp command to see if that makes any difference. I believe dted files will need to be reprojected as well since VPB builds the database using the source data coordinate system. -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Atilla Selem Sent: Friday, May 06, 2011 12:39 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] [vpb] Flat Database Generation in Meters reallyshocked me when i load it to my osg application..!!! Hi Shayne, Hi Glenn, Thanks for ur kind replies.. Shayne, As you know MyTerrain.tif file projection info was; Geographic ( Latitude / Longitude ) [N:36, E128] [N:38, E130] is in Utm Zone 52 Datum : WGS84 Unit : Arc degrees. i tried to reproject MyTerrain.tif file using ur gdalwarp command like this.. gdalwarp -s_srs proj=latlong +datum=WGS84 -t_srs proj=utm +zone=52 +datum=WGS84 MyTerrain.tif MyTerrainUtm.tif command prompt displayed such an error; ERROR 1 : Translating source or target SRS failed: proj=latlong +datum=WGS84 Is gdalwarp command true in terms of parameters? And one more question.. Should i run gdalwarp command for each of my dted-2 files which have Geographic projection before using osgdem? Thanks a lot, Atilla. S2LR wrote: Try using the following to reproject your data... gdalwarp -s_srs proj=latlong +datum=WGS84 -t_srs proj=utm +zone=11 +datum=WGS84 infile outfile Do this before using osgdem on your data files. UTM zone selection will be dependent upon where your lat/lon is... -Shayne -Original Message- From: [mailto:] On Behalf Of Atilla Selem Sent: Thursday, May 05, 2011 11:09 AM To: Subject: Re: [vpb] Flat Database Generation in Meters reallyshocked me when i load it to my osg application..!!! Hi Glenn, Thanks for the tip.. but i really need to know, Where should i do reprojection? In my dted-2 files and/or in my GeoTiff.file (since their projections are both Geographic - Lat/Lon) before executing osgdem? Or should i do re-scaling or whatever after i load terrain in osg application? And What tool or command option should i use to reproject to UTM? thanks in advance.. Atilla. Glenn Waldron wrote: Atilla,osgdem is creating your model in what's called a plate carre projection -- in which degrees are simply reinterpreted as meters. That is why your 2x2 degree cell is appearing as 2x2 meters. You need to reproject into a proper projected spatial reference system (like UTM) to get the correct extents. Check the bottom of this page for tips: http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem) Glenn Waldron / Pelican Mapping / @glennwaldron On Thu, May 5, 2011 at 12:25 PM, Atilla Selem () wrote: Hi, i have tried to generate a terrain (.ive) database using osgdem commandline options in order to buid a flat database where coordinates are in meters. After successfull generation i put that terrain in my osg application and really shocked! Before telling you what i saw as the output let me tell you my inputs. - i have four Dted-2 elevation file, - i have one GeoTiff image which is successfully mapped on dted files. - Dteds are starting (from 36N, 128E to 38N, 130E). So there are 4 1x1 degree cells [ Total size is 2x2]. - GeoTiff image also extends from 36N, 128E to 38N, 130E. So it covers [2x2] elevation file without no problem. Dted and Image Coordinate Systems are: Geographic ( Latitude / Longitude ) Datum : WGS84 Unit : Arc degrees. after putting dteds and image in seperate folders ( MyDted, MyImage ) i executed the following vpb command to generate my flat database. - osgdem -t MyDted -d MyImage -l 8 -v 0.1 -o MyTerrain_Flat.ive after executig above line and loading Terrain_Flat.ive on my osg application it was really difficult to find where is MyTerrain_Flat.ive on my view. When i zoom in What i saw was a 2x2 meter flat database in osg size. !!!It was located on x = 128 , y = 36 on my view according to ( 0,0,0) of my scene!!! Real size of Dteds of Image was 178 km in Easting and 221 km in Northing.. i have checked size and everythings was ok with Dted and Image. Now the question is 1 - Is there a problem with vpb when creating flat database in meters? 2- Have i missed a command line option? 3- Why is the generated terrain covers 2x2 meters although it is 178 x 221 km in real size? 4- Why it is located in x = 128 , y = 36 ? Those were Lower Left Lat/Lon coordinates of dteds and image file? 4- Isn't it possible to generate real size flat terrains in meters in x,y,z using vpb? Any help is really appreciated... ... Thank you!
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Chris, On Fri, May 6, 2011 at 3:03 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: Would it be helpful for me to post links to the OSX and Win binary builds that started at midnight Colorado time? If you have nightly build running could you possible set them up to post build reports to cdash.openscenegraph.org, I can then monitor the builds. Yesterday I checked in one change that broke the build and an overnight build posted to cdash highlighted this problem which I fixed first thing this morning, so it's a system that is pretty effective. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test svn/trunk in prep for next dev release
On 5/6/2011 10:14 AM, Robert Osfield wrote: If you have nightly build running could you possible set them up to post build reports to cdash.openscenegraph.org, I can then monitor the builds. Yesterday I checked in one change that broke the build and an overnight build posted to cdash highlighted this problem which I fixed first thing this morning, so it's a system that is pretty effective. We're working towards that goal, but we don't have CDash reporting done yet. I can tell you it appears that the builds went fine last night, but I didn't look to see when they ran versus when you last checked in code. Robert. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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
Re: [osg-users] Please test svn/trunk in prep for next dev release
On 5/6/2011 10:16 AM, Chris 'Xenon' Hanson wrote: I can tell you it appears that the builds went fine last night, but I didn't look to see when they ran versus when you last checked in code. Actually, I'm wrong: 12D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(700): error C2664: 'osgDB::TemplateSerializerP::TemplateSerializer(const osgDB::TemplateSerializerP )' : cannot convert parameter 1 from 'const char *' to 'const osgDB::TemplateSerializerP ' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 Reason: cannot convert from 'const char *' to 'const osgDB::TemplateSerializerP' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 No constructor could take the source type, or constructor overload resolution was ambiguous 12 D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(699) : while compiling class template member function 'osgDB::ListSerializerC,P::ListSerializer(const char *,const std::vector_Ty (__cdecl osg::ClipNode::* )(void) const,void (__cdecl osg::ClipNode::* )(const P ))' 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList, 12 _Ty=osg::ref_ptrosg::ClipPlane 12 ] 12 ClipNode.cpp(11) : see reference to class template instantiation 'osgDB::ListSerializerC,P' being compiled 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList 12 ] This is happening with both VS2008 and VS2010. Is this what you already saw and fixed? Robert. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Chris, That's the build problem that I spotted from cdash and fixed this morning ;-) Cheers, Robert. On Fri, May 6, 2011 at 5:35 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: On 5/6/2011 10:16 AM, Chris 'Xenon' Hanson wrote: I can tell you it appears that the builds went fine last night, but I didn't look to see when they ran versus when you last checked in code. Actually, I'm wrong: 12D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(700): error C2664: 'osgDB::TemplateSerializerP::TemplateSerializer(const osgDB::TemplateSerializerP )' : cannot convert parameter 1 from 'const char *' to 'const osgDB::TemplateSerializerP ' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 Reason: cannot convert from 'const char *' to 'const osgDB::TemplateSerializerP' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 No constructor could take the source type, or constructor overload resolution was ambiguous 12 D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(699) : while compiling class template member function 'osgDB::ListSerializerC,P::ListSerializer(const char *,const std::vector_Ty (__cdecl osg::ClipNode::* )(void) const,void (__cdecl osg::ClipNode::* )(const P ))' 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList, 12 _Ty=osg::ref_ptrosg::ClipPlane 12 ] 12 ClipNode.cpp(11) : see reference to class template instantiation 'osgDB::ListSerializerC,P' being compiled 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList 12 ] This is happening with both VS2008 and VS2010. Is this what you already saw and fixed? Robert. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Kim, Just jumping into this thread, I admit that I haven't read it all the way through, so hopefully this is relevant. Of course, jump in whenever you want :-) What I have done to support things like specular maps and bump maps in models exported from Maya is to modify the dae loader found to support the extra tags that are added to the Collada file from OpenCollada exporter The OpenCollada exporter will add a bump tag to the dae file and also export a spec map to the specular material. Obviously this doesn't export shaders etc, so there still a bit of manual setup but it's a start. I had considered Collada, but I'd prefer to avoid using it because it's just another intermediate format that may be interpreted one way or another. I need to support the same content pipeline coming from either Maya or 3DSMax, and both the stock and the OpenCollada exporters for these software give different results (not only the extra tags are different but other things as well). Combined with the fact that OSG's Collada reader is involved in getting the data into OSG, it'll be hard to get the same results. I'm currently working on both the Maya and Max exporters to OSG format. It's 2 plugins to maintain, but if I can get the same results from both, at least I won't have an intermediate format and an import plugin to worry about, the data will be in native OSG format straight out of the content creation tool (Maya or Max). Still, thanks for your input, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Add A Function getRefFromObjectCache(const std::string fileName) ?
Hi Lilinx, Have a osg::ref_ptrosg::Object Registry::getRefFromObjectCache(std::sring) method is a reasonable request, now added and checked into svn/trunk. I also added a getRefFromArchiveCache() as well. For older versions of the OSG you can simply use a ref_ptrObject in your own code rather than a C pointer. This still leaves potential for an object to go out of scope while being passed back, but this condition will be a very small window that is unlikely to trip apps up too readily. Robert. On Fri, May 6, 2011 at 3:08 PM, xll lil...@21cn.com wrote: HI,all When writing a osgDB::ReadFileCallback, We need know if there was someobject existed in the Registry's object cache on sometime. Usualy, We call osgDB::Registry::instance()-getFromObjectCache to do this. Example: osg::Object * obj = osgDB::Registry::instance()-getFromObjectCache (); if(obj) { doSomething(); } else { doOtherthing(); } When using this in multithread environment , it is not thread safe: obj maybe be deleted before getFromObjectCache return. So , Do We need add a function osg::refOjbect getRefFromObjectCache(const std::string fileName ) for osgDB::Registry? Thank you! Cheers, lilinx --- 卡巴斯基,价值非凡的安全保护 ___ 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] Please test svn/trunk in prep for next dev release
Hi Robert, Building now for MacOSX and for Android(ndk-r5b).. I will tell you something if I find any problem. Cheers, Rafa. 2011/5/6 Robert Osfield robert.osfi...@gmail.com: Hi Chris, That's the build problem that I spotted from cdash and fixed this morning ;-) Cheers, Robert. On Fri, May 6, 2011 at 5:35 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: On 5/6/2011 10:16 AM, Chris 'Xenon' Hanson wrote: I can tell you it appears that the builds went fine last night, but I didn't look to see when they ran versus when you last checked in code. Actually, I'm wrong: 12D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(700): error C2664: 'osgDB::TemplateSerializerP::TemplateSerializer(const osgDB::TemplateSerializerP )' : cannot convert parameter 1 from 'const char *' to 'const osgDB::TemplateSerializerP ' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 Reason: cannot convert from 'const char *' to 'const osgDB::TemplateSerializerP' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 No constructor could take the source type, or constructor overload resolution was ambiguous 12 D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(699) : while compiling class template member function 'osgDB::ListSerializerC,P::ListSerializer(const char *,const std::vector_Ty (__cdecl osg::ClipNode::* )(void) const,void (__cdecl osg::ClipNode::* )(const P ))' 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList, 12 _Ty=osg::ref_ptrosg::ClipPlane 12 ] 12 ClipNode.cpp(11) : see reference to class template instantiation 'osgDB::ListSerializerC,P' being compiled 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList 12 ] This is happening with both VS2008 and VS2010. Is this what you already saw and fixed? Robert. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi J-S, On Fri, May 6, 2011 at 3:49 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Here are the changes I have made to maya2osg. 1. I have modified the CMake config so it will use the OSG release and debug versions correctly. 2. I made the Maya install directory user-visible because it might not be in Program Files... It is settable at install time. 3. I set the debug, release with debug info and min size release postfixes to empty so that you can compile/install either version and Maya will load it correctly (by default they are d, rd and s). 4. I removed the CONFIG_PROJECT macro since it was now being used only for OpenGL (since FindOSGHelper does all the work for OSG). 5. I aded the possibility for parallel building on MSVC. On my 8 core it builds much quicker :-) 6. The only code change is that I added .get() where needed so the plugin would compile when OSG is built with OSG_REF_PTR_IMPLICIT_CONVERSION disabled. Thank you very much. They are submitted to svn/trunk. Now the CMake script works like a charm. I hope to port it to Linux next monday. Now in VS debug mode works like a charm, did you finally manage to debug Maya and Maya2OSG from VS? I noticed that you've made changes to fix the normal mapping, but for me the plugin seems to make Maya crash when I press the Export button. I tried to debug the crash, but the plugin built in debug doesn't crash... And in release with debug symbols, the crash doesn't seem to happen in the plugin itself, because I don't get a coherent stack trace. I'm assuming you tested your change and it doesn't crash for you, so it's probably something specific to my setup. I'll let you know when I have more information. Actually, I didn't change anything there yet. It was Peter who submitted some changes related with the bumpmapping problems we detected. It was an UI option that accidentally disappeared that allowed to enable/disable bumpmapping export. I also noticed a bug in this code that make the plug-in crash when the bump texture cannot be loaded. It is already fixed, but I don't think it is the same problem you're finding. I am still working on all these and haven't reviewed yet all the changes in the last months that could cause the bump problems. However, if you can send me the scene that is crashing on your system, in case it is not too complex, I can test directly with it. Regards, -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi all, Here it is. Argh, I didn't realize how big that was. I got a message from the list saying it awaited moderator approval, you can safely refuse it, I'll send it to Javier directly. Sorry, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi J-S, On Fri, May 6, 2011 at 7:02 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: 1. Named the osg::Light according to the MFnLight/MFnSpotLight name (i.e. if the light's MatrixTransform is directionalLight1, then the osg::Light will be directionalLightShape1) 2. Blinn materials will be shaded like Phong, with an empirical conversion of the eccentricity to an OpenGL shininess value. I haven't found any good online sources on converting the value (and the Maya doc was no help either), so I came up with my own conversion after a bit of experimentation in a spreadsheet... Seems to give roughly the right curve in specular highlight. If we can get a better conversion later I'm all for it. 3. The file connected to a Bump2d node would be converted to a tangent space normal map with the bump2normal() function. Our normal map textures are already tangent space normal maps, so they need no conversion (and converting them gave really bad results). The Bump2d node has a setting called Use As: Bump / Tangent Space Normals / Object Space Normals. I think that if the setting is not set to Bump, there should be no conversion done. So I did that, I hope you agree (or if there's some other way to do that let me know). Thank you for the changes. They are already submitted to svn/trunk. The Blinn shader was something in my to-do list. I wanted to do some research to discover what computations does Maya for it. Now we have a first approximation :) However, I don't know if it is working I saw your change in bump2normal.cpp, but it didn't help. I'm still getting a crash only in release build of the plugin, after pressing Export. I'll probably put in some prints to try and track it down, since the debug version of the plugin doesn't crash. Don't worry about it. By the way, I tested the file you sent me with tangent space normal maps, and worked OK. At least nobody crashed. The mapping is a bit weird however, but I suppose it is just a test to see if it is working. I can send you a snapshot if you want. Regards, -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
On Fri, May 6, 2011 at 7:41 PM, Javier Taibo javier.ta...@gmail.com wrote: research to discover what computations does Maya for it. Now we have a first approximation :) However, I don't know if it is working ^ Please, ignore this line. It should not be there X-D -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Robert, Builds and works fine with my application on MacOSX, The build is also fine on android. Rafa. 2011/5/6 Rafa Gaitan rafa.gai...@gmail.com: Hi Robert, Building now for MacOSX and for Android(ndk-r5b).. I will tell you something if I find any problem. Cheers, Rafa. 2011/5/6 Robert Osfield robert.osfi...@gmail.com: Hi Chris, That's the build problem that I spotted from cdash and fixed this morning ;-) Cheers, Robert. On Fri, May 6, 2011 at 5:35 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: On 5/6/2011 10:16 AM, Chris 'Xenon' Hanson wrote: I can tell you it appears that the builds went fine last night, but I didn't look to see when they ran versus when you last checked in code. Actually, I'm wrong: 12D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(700): error C2664: 'osgDB::TemplateSerializerP::TemplateSerializer(const osgDB::TemplateSerializerP )' : cannot convert parameter 1 from 'const char *' to 'const osgDB::TemplateSerializerP ' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 Reason: cannot convert from 'const char *' to 'const osgDB::TemplateSerializerP' 12 with 12 [ 12 P=osg::ClipNode::ClipPlaneList 12 ] 12 No constructor could take the source type, or constructor overload resolution was ambiguous 12 D:\OSG\trunk_vs10_x64_debug\src\OSG\trunk\build\product\include\osgDB/Serializer(699) : while compiling class template member function 'osgDB::ListSerializerC,P::ListSerializer(const char *,const std::vector_Ty (__cdecl osg::ClipNode::* )(void) const,void (__cdecl osg::ClipNode::* )(const P ))' 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList, 12 _Ty=osg::ref_ptrosg::ClipPlane 12 ] 12 ClipNode.cpp(11) : see reference to class template instantiation 'osgDB::ListSerializerC,P' being compiled 12 with 12 [ 12 C=MyClass, 12 P=osg::ClipNode::ClipPlaneList 12 ] This is happening with both VS2008 and VS2010. Is this what you already saw and fixed? Robert. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia -- Rafael Gaitán Linares Instituto de Automática e Informática Industrial http://www.ai2.upv.es http://gvsig3d.blogspot.com Ciudad Politécnica de la Innovación Universidad Politécnica de Valencia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Javier, Thank you for the changes. They are already submitted to svn/trunk. Great, thanks. Can you please replace the filetexture.cpp by this one as it's the behavior I think we want - if the Use As: field is anything OTHER than Bump, don't convert bump2normal. The Blinn shader was something in my to-do list. I wanted to do some research to discover what computations does Maya for it. Now we have a first approximation :) Yep, and we can easily replace the calculation I did with anything else. By the way, I tested the file you sent me with tangent space normal maps, and worked OK. At least nobody crashed. The mapping is a bit weird however, but I suppose it is just a test to see if it is working. I can send you a snapshot if you want. No, I know the mapping is weird, I didn't do anything for that (I just wanted to have something to test with). Weird (good) that it doesn't crash for you. I'll continue testing... J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] Frame Rate Decay w/ SilverLining Integration
Hi Zonk, The basic configuration for the two computers that are having this problem are: 1) Intel Xeon 5405 2.0GHz CPU, 4GB RAM, Nvidia GeForce X260 GPU 896MB 2) Intel Core i7 2.79GHz, 4GB RAM, Nvidia 9800GT 512MB I'm personally running on a machine with an Intel Xeon 5410 (2.33GHz), 4GB RAM, NVIDIA GeForce 9800 GT 512MB. However, the problem doesn't show up on my computer. So, I'm not sure if the video card is to blame, because I use the same video card as one of the problem computers. Zonk, do you have RTT in your demo by chance? If so, would you mind if I took a look at it? Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39119#39119 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Javier, Great, thanks. Can you please replace the filetexture.cpp by this one as it's the behavior I think we want - if the Use As: field is anything OTHER than Bump, don't convert bump2normal. Sorry I forgot the file, here it is. BTW, it's fine to leave my e-mail in the AUTHORS file. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ /** Maya2OSG - A toolkit for exporting Maya scenes to OpenSceneGraph Copyright (C) 2010 Javier Taibo javier.ta...@gmail.com This file is part of Maya2OSG. Maya2OSG is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Maya2OSG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Maya2OSG. If not, see http://www.gnu.org/licenses/. */ #include filetexture.h #include shadingnetwork.h #include bump2normal.h #include ../texture.h #include ../shader.h #include ../config.h #include ../common.h #include maya/MFnDependencyNode.h #include maya/MPlugArray.h #include osgDB/FileNameUtils #include sstream /** * Constructor */ FileTexture::FileTexture( const MObject shading_node, ShadingNetwork shading_network ) : ShadingNode( shading_node, shading_network ) { } /** * Get the GLSL Codeblock for a plug */ ShadingNode::CodeBlock FileTexture::getCodeBlock( const std::string plug_name ) { CodeBlock code_block; std::string variable_name; MFnDependencyNode dn(_mayaShadingNode); std::string maya_tex_name = dn.name().asChar(); // Check the plug name. Supported ones: outColor, outTransparency, outAlpha if ( plug_name == outColor || plug_name == outTransparency || plug_name == outAlpha ) { std::string maya_tex_name_clean = maya_tex_name; hygienizeName( maya_tex_name_clean ); variable_name = sn_filetexture_ + maya_tex_name_clean + _output; MPlugArray remote_plugs; Shader::getPlugConnectedFromChannel(_mayaShadingNode, plug_name, remote_plugs); bool is_bump = false; bool convert_bump = false; if ( Config::instance()-getEnableBumpMapping() ) { for ( int i=0 ; !is_bump i remote_plugs.length() ; i++ ) { std::string remote_plug_name = remote_plugs[i].partialName(false, false, false, false, false, true).asChar(); bool has_Fn_kBump = remote_plugs[i].node().hasFn(MFn::kBump); if ( remote_plug_name == bumpValue has_Fn_kBump ) { is_bump = true; // If the bump used is already a tangent space normal map, no conversion is needed. MFnDependencyNode bumpNode(remote_plugs[i].node()); MPlug plug_bumpInterp; plug_bumpInterp = bumpNode.findPlug(bumpInterp); // bumpInterp values: 0 = Bump, 1 = Tangent Space Normals, 2 = Object Space Normals int bumpInterp = 0; plug_bumpInterp.getValue(bumpInterp); convert_bump = (bumpInterp == 0); // Convert only if used as Bump break; } } } std::string filename_nm; if ( is_bump convert_bump) { MPlug plug_filename; MString texname; plug_filename = dn.findPlug(fileTextureName); plug_filename.getValue(texname); // This texture is used as a bump (height) map, we should convert it to a normal map std::string filename_orig = texname.asChar(); // Convert bump map (height map) to normal map filename_nm = bump2Normal( filename_orig ); } // If variable not available, we compute them if ( ! variableIsAvailable(variable_name) ) { int tc_set_unit = _shadingNetwork.getTexturingConfig().getTCSet( maya_tex_name ); int texture_unit = _shadingNetwork.getTexturingConfig().getTextureUnit( maya_tex_name ); std::stringstream ss_sampler_name; ss_sampler_name tex texture_unit _ maya_tex_name_clean; std::string sampler_name = ss_sampler_name.str(); // Set the texture in the stateset osg::ref_ptrosg::Texture2D tex; if ( is_bump
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Rafa, On Fri, May 6, 2011 at 6:57 PM, Rafa Gaitan rafa.gai...@gmail.com wrote: Builds and works fine with my application on MacOSX, The build is also fine on android. That's great to hear. It'll take me a while to come to terms with build is also fine on Android... never thought in the early days of the OSG that it'd run in such a small form factor ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test svn/trunk in prep for next dev release
Hi Robert, it compiles and works great on win7 64b bit, VS2008 Sp1, Qt 4.7.2 in 32 and 64 bit. Four your information, I got the following compile warnings: Warnung 1 warning C4611: Interaktion zwischen '_setjmp' und C++-Objektlöschung ist nicht portabel d:\OpenSceneGraph\OpenSceneGraph-2.9.14_x86\src\osg\glu\libtess\tess.cpp 505 osg Warnung 122 warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _fileno. See online help for details. d:\OpenSceneGraph\OpenSceneGraph-2.9.14_x86\src\osgPlugins\zip\unzip.cpp 191 Plugins zip Warnung 123 warning C4996: 'getcwd': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getcwd. See online help for details. d:\OpenSceneGraph\OpenSceneGraph-2.9.14_x86\src\osgPlugins\zip\unzip.cpp 3931Plugins zip Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39123#39123 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] Frame Rate Decay w/ SilverLining Integration
Hi knarf, yes I have RTT because I apply a distortion on the rendred texture before the final output. osgVisual is open source, take a look at osgvisual.org, the modul is called sky_silverlining Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39124#39124 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Manual perspective distortion?
If I understand you correctly, you want to tweak the viewing frustum? You should be able to rotate and scale (move in and out) the clipping planes of an asymmetric viewing frustum (projection matrix) so that the four sides of intersection with the near clipping plane form a general quadrilateral. This should allow you to tune to the area of projection that you're interested in. -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Alexander Dieterle Sent: Friday, May 06, 2011 3:59 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Manual perspective distortion? Dear OSG Forum readers, as we recently installed a multi-projector-based viewing screen I am currently working on its calibration. I managed to fix most of the displaying issues so far; however, one issue remains that I am quite unsure of how to approach it. Due to the mounting of the projectors in relation to the viewing screen, the projected image is distorted in a way that the projected image no longer resembles a rectangele but a trapezium. To give you a better understanding of the situation, I made a small sketch to visualise the problem (compare attachment). The grey area is the projection area, while the blue frame resembles the area displayed by the projector. As can be seen in the image, whilst the left and bottom corners are quite well aligned, the upper right corner flees the projection area. Since the mounting of the projectors cannot be changed or adjusted further, I have to solve the problem on software side. I was thinking of somehow manually creating a perspective distortion matrix, such that I can move that corner so it fits in the projection area. However, I am a bit lost how to do that. Is there anyone who could point me into the direction of how such a matrix could be created and what matrix to use at all? Intuitively, I've searched a bit in the direction of a projetion matrix, but couldn't quite find the right way to do it yet! Anyways, thank you very much in advance for reading :) Best regards, Alexander -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39083#39083 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
On Fri, May 6, 2011 at 8:29 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Javier, Great, thanks. Can you please replace the filetexture.cpp by this one as it's the behavior I think we want - if the Use As: field is anything OTHER than Bump, don't convert bump2normal. Sorry I forgot the file, here it is. Updated! Now bump mapping seems to be working fine again, btw... And I must apologize, I absolutely lied to you in the other message. Your scene crashes in Release mode. Just tested it on Debug only. My mistake! I don't know where the problem is... I'm taking a look at it. If I discover something I'll let you know... -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp: CMake build
Thanks! On Fri, May 6, 2011 at 6:58 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Farshid, Thanks, I will go ahead and add these to the trunk. A small change to make finding the OpenGL library cleaner. Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.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] Manual perspective distortion?
Just as a follow up, these links may also help you solve your problem. The last one may be of particular interest to your application... http://www.opengl.org/resources/code/samples/sig99/advanced99/notes/node 33.html http://catarina.udlap.mx/u_dl_a/tales/documentos/dsc/mora_l_ma/capitulo3 .pdf -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC Sent: Friday, May 06, 2011 1:54 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Manual perspective distortion? If I understand you correctly, you want to tweak the viewing frustum? You should be able to rotate and scale (move in and out) the clipping planes of an asymmetric viewing frustum (projection matrix) so that the four sides of intersection with the near clipping plane form a general quadrilateral. This should allow you to tune to the area of projection that you're interested in. -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Alexander Dieterle Sent: Friday, May 06, 2011 3:59 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Manual perspective distortion? Dear OSG Forum readers, as we recently installed a multi-projector-based viewing screen I am currently working on its calibration. I managed to fix most of the displaying issues so far; however, one issue remains that I am quite unsure of how to approach it. Due to the mounting of the projectors in relation to the viewing screen, the projected image is distorted in a way that the projected image no longer resembles a rectangele but a trapezium. To give you a better understanding of the situation, I made a small sketch to visualise the problem (compare attachment). The grey area is the projection area, while the blue frame resembles the area displayed by the projector. As can be seen in the image, whilst the left and bottom corners are quite well aligned, the upper right corner flees the projection area. Since the mounting of the projectors cannot be changed or adjusted further, I have to solve the problem on software side. I was thinking of somehow manually creating a perspective distortion matrix, such that I can move that corner so it fits in the projection area. However, I am a bit lost how to do that. Is there anyone who could point me into the direction of how such a matrix could be created and what matrix to use at all? Intuitively, I've searched a bit in the direction of a projetion matrix, but couldn't quite find the right way to do it yet! Anyways, thank you very much in advance for reading :) Best regards, Alexander -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39083#39083 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi J-S, jumping in to say hello, and sorry that I coudn't answer your post earlier. I'm student, and as Javier mentioned my time is very limitted these days and for the next two months. At Holiday time I contribute frequently, and I think this won't cahnge too soon. So for now this is it, I'll join discussions about topics regarding Animation/Character Export and the current Polygon Export. Cheers, PP -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39128#39128 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi, about the crash, I tried the file and it crashes on my system as well in release mode. The polygon Export creates a Log nemad Maya2OSG_Write.log, stored in the same directory of exported file. This might help a little. It exports the mesh as geometry, but than creashes. I guss in Shading stage, hope this helps a little, but can't dive deeper. Thank you! Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39130#39130 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
On Fri, May 6, 2011 at 7:11 AM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Question then, where do I go in Max to set these kinds of tags? Can you give me an example of what your artist would do to say that a given object (or a given material) has a normal map? Have you perhaps not seen this question? I would like to take the same approach as you as much as possible... Sorry, I must have missed the question. Regarding the various tagging approaches: 1) Adding prefix/suffix to image filename. I believe this is the easiest method. The filename will be applied to the exported osg::Image object. For example, you can append _[normal] to all normal map images. 2) Adding tags to the material name. Using the Material Editor in Max, you can set the name of a material to any arbitrary string. The name will be applied to the corresponding osg::StateSet and osg::Drawable object. I'm thinking of changing this so it is only applied to the osg::StateSet object. Using the previous example, you can append _[normal] to the material name to flag that it contains a normal map. 3) Modifying the object properties. I wouldn't recommend this technique for material related settings. We use it for node related settings. Right-click an object in the scene and select Object Properties. Select the User Defined tab and enter any mult-line string within the textbox. This gets exported as a description string of the corresponding osg::Node object. Let me know anything is unclear. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Looking at OSGExp and maya2osg (3dsmax and Maya export plugins)
Hi Javier, Now bump mapping seems to be working fine again, btw... Yes, I agree, when I run the plugin in Debug and get an output file as a result it works well. Thanks. And I must apologize, I absolutely lied to you in the other message. Your scene crashes in Release mode. Just tested it on Debug only. My mistake! I don't know where the problem is... I'm taking a look at it. If I discover something I'll let you know... Good, pardon the negativism but it's a relief that you're seeing the crash too now, at least it's not something totally trivial on my side :-) I've gotten pretty far debugging this in release with debug symbols. First it looked as if adding the shading node to the map (ShadingNetwork::registerShadingNode()) was causing it, but I debugged deeper and it's not that. If I comment out shadingnode.cpp line 67: plug.codeBlock = plug.connectedShadingNode-getCodeBlock( rp_name ); it doesn't crash anymore. In release with debug symbols it seems like the debugger sometimes gives bad information (for example sometimes the call stack looks whack, or a pointer will look invalid but will be ok) but it looks as if when rp_name is outColor it will crash shortly after. I'm sure that line is not the cause but the symptom, but maybe this info will help you debug it. So in short, if you place a breakpoint at the line I said above (shadingnode.cpp line 67), you'll be close to the site of the crash. Thanks in advance for looking into this, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org