Re: [osg-users] Compiler errors
Hi Robert, sorry for bothering you with a problem, obviously caused by my arrangement of sourcecode. The version is SVN HEAD of Friday 11:30 German time. The downloaded structure compiles fine. So it is definately MY problem. But I have to do it this way because it has to be integrated into my commercial distribution. Unfortunately I couldn't find a solution by just digging the sources and headers. There are so man Glyph definitions arround. Where is the definition finally located? Do I still have to include freetype when using osgQt? Thanks - Werner - Hi Werner, Are you able to build the OSG using Makefile? Which version of th OSG are you using? Robert. On Sun, Jan 30, 2011 at 2:37 PM, Werner Modenbach werner.modenb...@texion.eu wrote: Hi all, I get the following error in compilation on Linux: /osg/osgPlugins/freetype/FreeTypeFont.h:34: Error:‘Glyph’ in class ‘osgText::Font’ does not name a type I use a quite new svn version. But to be honest, I import most of the osg distribution structure into my project and buid it inside Qt Creator. So I think I'm missing some settings usually done in the ./configure part. The complete osg distribution builds fine with its own build scripts. Thanks - Werner - ___ 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] Compiler errors
Hi Werner, On Mon, Jan 31, 2011 at 9:55 AM, Werner Modenbach werner.modenb...@texion.eu wrote: The downloaded structure compiles fine. So it is definately MY problem. But I have to do it this way because it has to be integrated into my commercial distribution. Unfortunately I couldn't find a solution by just digging the sources and headers. There are so man Glyph definitions arround. Where is the definition finally located? You have the source code... a simple grep or inspection of the source would tell you that include/osgText/Glyph is where Glyph is declared. Do I still have to include freetype when using osgQt? freetype and the associated plugin isn't required if you use osgQt as it has it's only font implementation that supports 2D text. It doesn't support Text3D though for this you'll still need the freetype plugin. For examples of how to use Qt to provide fonts see the new osgqfont example. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] altitude in WGS84 coordinates
Hi, I created terrain from srtm30 hgt file and georeferenced (using gdal_warp with srs WGS84) google earth images. I got the terrain but the altitude seems not included in terrain. When I opened the osg file, I could see altitude is less than 1 which is not the actual. I don't know why? Can anybody tell the reason Please help Thank you! Cheers, Vijeesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36172#36172 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ANN] OSG tutorial updated
Very concise and educational, good work! -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgconv failed loading .dll
Petr Srom writes: Hi, I have problem convert .flt to .ive console debug output: USING: c:\Program Files\OpenSceneGraph-2.8.3\bin\osgPlugins-2.8.2\osgdb_ive.dll dynmaic library failed loading: osgPlugins-2.8.2\osgdb_ive.dll cmd osgoconv --plugins find all .dlls in c:\Program Files\OpenSceneGraph-2.8.3\bin\osgPlugins-2.8.2\ on the 2nd pc is sthe same OSG instalation and osgconv works fine ... in debug mode are the paths same PC1 and PC2: Env Variables - are the same cmd osgversion OpenSceneGraph Library 2.8.2 (both) cmd echo %OSG_ROOT% c:\Program Files\OpenSceneGraph-2.8.3 (both) start - run: osgviewer cow.osg - ok (both) Instalation on the 2nd PC: I have copied al from root directory c:\Program Files\OpenSceneGraph-2.8.3\ and add same env. variables. I see that there are mixed 2.8.2 and 2.8.3 references in your setup. Could be a problem of mixing binaries? DLLs from one version won't load plugins for the other. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 2.9.10 on iOS
Hi Alessandro, Am 28.01.11 18:31, schrieb Alessandro Terenzi: but I was still getting linking errors. The linker complied because it could not find both the Cocoa and OpenGL frameworks (note: I wrote OpenGL not OpenGLES, even though I checked only the GLES1 option in CMake). So I tried to remove them from the Other Linker Flags, but I was getting other errors because of references not found by imageio (but in CMake it was set quicktime not imageio), so I also removed imageio from the linker's flags. Quicktime is not supported for IOS, please use only imageio. It's a known problem, that the xcode-project built by cmake for the SimplevieweriPhone-example is not working right out of the box. You'll have to add the CoreGraphics-framework for the imageio-plugin. After all the above steps, I managed to build the application, but it crashes while it is starting, in the console I get: Program received signal: “EXC_BAD_ACCESS”. warning: Could not open fork matching current architecture for OSO archive /Users/alex/Desktop/Build/3rdParty-iOS/lib/libFreeType_iphone_universal.a warning: Could not open OSO file /Users/alex/Desktop/Build/3rdParty-iOS/lib/libFreeType_iphone_universal.a(ftinit.o) to scan for pubtypes for objfile /Users/alex/Desktop/Build/OpenSceneGraph-2.9.11-build-iOS/bin/osgViewerIPhone.app/osgViewerIPhone ...(and many copies of this last warning)... Sorry, can't comment that much about the freetype-issue. Try the simpleviewer-app without the freetype-plugin and -lib as a first step. The last thing I tried was to start from scratch but set CMake to use imageio and not quicktime but same runtime error (this solved some linking problems described above, but of course not the runtime crash). Am I suppose to use another version of freetype? AFAIK no, it's a universal-lib (i386 + arm) and had worked in the past. cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgOcean] Greetings, and a few bug.
Hi, I actually have been using osgOcean for a year now. Well, I actually use Delta 3D which uses OSG and in turn osgOcean. It's a pretty good library for rendering ocean, would be better if you can add atmospheric scattering using Mie and Rayleigh approximation for real time day-night situation. But beggars can't be chosers, right? :D Anyway I've found 2 bugs on osgOcean. One I still haven't been able to solve, that is the glare functionality. It seems like the glare would also affect the skybox and not only the ocean. I believe it's a shader issue when you are downsampling the rendered texture with glare. The other one is the FFTOceanSurface::getSurfaceHeightAt() method. It would crash from time to time due to negative tile_x and/or tile_y value whereas they are used to determine an index for vectors in OceanTile::normalBiLinearInterp() and OceanTile::biLinearInterp() function. I know that because I used the method quite a lot for determining a ship's transformation when there's a wave. Below is the fix for the said problem: Code: ... if (_oldFrame _mipmapData.size()) { const OceanTile data = _mipmapData[_oldFrame][0]; float tile_x = oceanX - ix * _tileResolution; float tile_y = oceanY - iy * _tileResolution; //++ BAWE-20101119: BUG FIX // Absolute value of dx dy tile_x = tile_x 0 ? tile_x : -tile_x; tile_y = tile_y 0 ? tile_y : -tile_y; //-- BAWE-20101119: BUG FIX if (normal != 0) { *normal = data.normalBiLinearInterp(tile_x, tile_y); } return data.biLinearInterp(tile_x, tile_y); } Thank you! Cheers, Bawenang -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36177#36177 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgOcean] [ASK] Need help for a shader related issue
Hi, This is my second post here. I split it here because I am actually confused about a shader related problem and I decided to post it here. I'm trying to implement a glow shader in osgOcean like the one explained at GPU Gems chapter 21 on NVIDIA's site (can't post the link because it looks like You must have 2 posts before you can post URL's/Links). On the page it was explained that we can use the alpha channel to determine the glow and brighteness of the glow of an object. So an alpha of 0.0 = glowing brightly, 0.5 = glowing not to brightly, 1.0 = not glowing / normal texture. However I see that the glare effect also uses alpha channel to determine which one to be glared. I see that in OceanScene::downsamplePass(), there are these lines in the fragment shader: Code: color = color*0.25;\n \n if(color.a = osgOcean_GlareThreshold) gl_FragColor = color;\n else\n gl_FragColor = vec4(0.0); \n So in a way you are determining which part glare should be implemented by their alpha channel, only reversed in this part. If the alpha is equal to or bigger than the threshold, it will be glared. So, what I'm confused of right now is how can I make a glow shader that won't collide with the glare shader, so maybe I can actually use them both at the same time? Thank you! Cheers, Bawenang PS: LOL! You must have 2 posts before you can post URL's/Links. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36178#36178 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] I am in a puzzle about the realization of osgOcean's 'Glare effect'
A noob trying to help a bit. Try looking at OceanScene::preRenderCull() method. You'll see that it's being used there to render the scene. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36179#36179 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP)to DrawElements(TRIANGLES)
Hi Wojtek, You probably know this but if not it may be other option for you. One can define restart index that works as terminator for triangle/quad strips (check GL_NV_primitive_restart extension) . So in practice multiple triangle strips can be separated by restart indices and put into one physical PrimitiveSet. Other option doing the same is adding 2 degenerated triangles (2 extra indices or vertices) linking end of prior strip with start of next strip. And you can use this trick on older boards in the same way as primitive terminator. Yes I knew about this, but thanks for refreshing my memory. It's another option to try. Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)
Hi Tim, That sucks. I'll take a look. OK, let me know what you find out. I was pretty surprised the optimizers would go out of bounds, as I've used them on a variety of models without problems (as I bet you have, and many others too). Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Optimizing scene structure and geometry
Hi Sergey, I've used gDEBugger tool for rendering optimizations, it have modes that turn off some features of rendering so you can determine what impacts framerate most (like it have modes which turns off all lights(fixed pipeline vertex lighting impact), replaces all textures with 2x2 textures(memory bandwith\texture cache impact), turn off all draw calls, turn off vertex\fragment shaders, turn off rasterization (fillrate speed impact), etc). This way you can get some broad vision on what's your main problem. If you have something similar in your tool - give it a shot. I've been using gDEBugger for a long time. It has helped find a few things, but recently it can't use the NVidia hardware counters in 256+ version drivers, so we only have access to some basic functionality. Still, it was gDEBugger that first tipped me off to the poor batching of geometry that we were doing - its Vertex Batches tab in the analysis window is useful, it groups batches in a given number of vertices and then tells you which percentage of batches send that number of vertices, for example you send 10% of your vertices with 68% of your batches. It also shows the number of given OpenGL calls, which also showed me that our skydome was sending a large number of small triangle strips which is also inefficient. So yes, I agree it's a good tool, but I really wish they would fix the problem with hardware counters in recent NVidia drivers (whether the problem is in the drivers or gDEBugger) so we could again use all this tool's capabilities. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting up matrices
Hello Mukund, r.makeRotate( rot += 10, osg::Vec3( 1., 0., 0. ) ); The angle should be in radians. I think your code above assumes it's in degrees. What are you expecting to see BTW? The camera might rotate around the scene's origin (since your view matrix has no translation), but what is in your scene? If your object is also at the scene origin, perhaps your camera ends up inside the object, and thus you don't see any rotation because you don't see any object (so you have no visual frame of reference to see if there's any rotation)? If you use the plain osgViewer, you will be able to use a camera manipulator. Using glut, if you want to use a camera manipulator, you need to make sure you're forwarding all events (keyboard, mouse) correctly from glut to the OSG event queue. Why do you insist on using glut to learn OSG? Using the plain viewer is even easier: int main(int argc, char** argv) { osg::Node* root = osgDB::readNodeFile(cow.osg); osgViewer::Viewer viewer; viewer.setSceneData(root); return viewer.run(); // or while(!viewer.done()) { viewer.frame(); } } Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Inheriting multiple classes
Hi Robert, Thanks for the reply. So in your case you simply add the Geode to the MarixTransform node and then the geode and all it's children then are transformed by it So, you mean this is fine? Code: osg::ref_ptrosg::MatrixTransform mt = new osg::MatrixTransform; mt-addChild(pyramidGeode); // pyramidGeode is a Geode pointer. Also, could you please comment on the code i pasted in my previous post? Parts of the model seem to vanish at one angle. Thanks, Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36185#36185 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] Greetings, and a few bug.
Hi Bawenang, Hi, I actually have been using osgOcean for a year now. Well, I actually use Delta 3D which uses OSG and in turn osgOcean. Excellent, we appreciate you using it! Progress has been slow in the past few months but we hope to be able to put a bit more time on it in the near future. It's a pretty good library for rendering ocean, would be better if you can add atmospheric scattering using Mie and Rayleigh approximation for real time day-night situation. But beggars can't be chosers, right? :D I think the skydome that osgOcean does is useful just for the demo app, its focus is really the ocean so adding effects in the sky would be an over-extension of the library's goal IMHO. Another library should do this. We use osgEphemeris for our skydome, it doesn't do scattering but gives a beautiful day and night sky (with accurate stars, moon and planets placement relative to the longitude/latitude/year/month/day/hour/minute/second you set). It would be possible to add scattering effects to that nodekit and in that case I think it would be appropriate. Anyway I've found 2 bugs on osgOcean. One I still haven't been able to solve, that is the glare functionality. It seems like the glare would also affect the skybox and not only the ocean. I believe it's a shader issue when you are downsampling the rendered texture with glare. I'll have to let Kim field any questions on the shaders as I didn't work on them (apart from fixing a few issues that prevented them from compiling on GeForce 7 GPUs). The other one is the FFTOceanSurface::getSurfaceHeightAt() method. Thanks for investigating the bug. Actually, the code I have for this function is different from what you have (the condition at the top is different): if(ix _numTiles iy _numTiles) { const OceanTile data = _mipmapData[_oldFrame][0]; float tile_x = oceanX - ix * _tileResolution; float tile_y = oceanY - iy * _tileResolution; if (normal != 0) { *normal = data.normalBiLinearInterp(tile_x, tile_y); } return data.biLinearInterp(tile_x, tile_y); } It seems to have been that way forever in the SVN repo (that function was added in revision 146 and it hasn't changed since) so I don't know why your code is different... We have also used that function extensively here at CM-Labs, and have never had a crash there, so I wonder if it could be that check that makes it work for us (it indeed seems like it could influence the values of tile_x and tile_y which could then be valid all the time in our version). Could you try out our version, and also perhaps investigate why your code is different? Are you using a version of osgOcean that was integrated into Delta3D? Could the Delta3D people have made changes when integrating it? In general, when submitting fixes to an open source library, it's always best to try out the most up-to-date version first (SVN trunk) and see if your problem is still reproducible. It may have been fixed already, which saves you some time coding up and submitting a fix. That being said, if the modified code doesn't fix your problem, then by all means you should try to find a fix and submit it. The other thing is that in OSG's case (and I think the same for osgOcean) it's preferable to submit whole modified files when submitting a change, that way we can clearly see what you changed, and would have quickly spotted that different if() I noted above. Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)
Hi Tim, I've found that that problem happens because the attribute arrays are shared among several Geometry objects. The fix is simple, but I haven't submitted it yet because the results of INDEX_MESH are still not great on the sphere object, and I have a different idea for how to approve that. Nice, thanks for the update. I'll wait for your fix. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Setting up matrices
Hello J-S, Thanks for the reply. Why do you insist on using glut to learn OSG? Using the plain viewer is even easier: Absolutely. i did not realize it first since i was used to using glut. But now i realize the osgviewer is much easier and efficient. So, im currently using the method similar to the one suggested by you. Thank you, Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36187#36187 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Inheriting multiple classes
Well, the model is as such. So, there seems to be no problem. Thanks for the support. Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36189#36189 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Loading external materials with proxynodes
Hi. I wonder if there is a way for loading materials/statesets from external osg-file. I´ve tried to use ProxyNode in osg file to load a model but I would like to just load a stateset or a material. Best regards. Nikola R ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trouble trying to integrate Osg in a Wpf Application using HwndHost
Hi, Thanks, that was helpful :)) Thank you! Cheers, Chris -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36192#36192 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Discussion: metadata readerwriters output
Hi Paul, Thanks for this explanation about identifying nodes. Actually we also implemented a node identification using child index... However I did not spot metadata related classes in osgWorks. Well, ok, I just had a very quick overview... Can you tell me where to look at? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Paul Martz pma...@skew-matrix.com a écrit : If a specific node in a scene graph can be reliably identified, application data can be stored separately from the scene graph. Unfortunately, OSG's mechanism for identifying a node (the NodePath) is address-based, making it unsuitable for this task, as addresses change from one app invocation to the next. osgWorks has a solution for this. It has a set of NodePathUtils that identify nodes based on child index, node name, and class name, along with conversion utilities to switch between NodePaths and the string representation. Because the string isn't address-based, these utilities allow an app to identify a specific node between application invocations. Application-specific data can be stored saved to a database keyed by the NodePath's string representation, then restored later, for example. Just wanted to mention this, as the osgWorks metadata solution is already available and requires no changes to core OSG. -Paul On 1/28/2011 2:54 AM, Sukender wrote: Hi Robert, hi (SELECT name FROM OSG_USERS WHERE nameRobert Osfield;), ** Context ** I spotted the DAE plugin is able to return some values to the calling program by writing in the plugin data (options-getPluginData()). But when writing, this plugin data is... const! This thus requires an ugly and unsafe const_cast (or an even uglier C-style cast). In other words: readers should not return any value except the scene graph itself, or generally speaking predefined return values. I also think that using void* is just a maintanability pain, with high risks of writing unallocated memory parts, and such. ** Topic ** More generally, it is hard to store and pass not predifined variables between main program and plugins, or between OSG itself and the main program (I mean adding some type-safe user values to the graph). This makes me think about something I discussed a bit before: the ability to handle metadata in OSG (post named Suggestion: Add components in nodes (aggregation)). To sum up the discussion, it was roughly said that it's on user side, and use userData!. However, the meta system I implemented for my app is now quite used and stable. I want it to be open sourced so that partners using OSG also have access to metadata, and I propose this to be integrated. But I don't wan't to simply copy-paste it into a submission; I'd like to have a real reflexion around it, to make it useable for all. After all, more and more file formats handle these metas, so why not OSG, as long as it does not disturb existing features? ** Ideas ** So... starting the reflexion, I have a few ideas: 1. What is a meta? A meta is a name/typed value pair. Possible implementation is to have a base class (with the name, say MetaBase), and several derived (Metaint, deriving from MetaBase, and then Metastd::string...). There could be as many meta types as you wish, but only a few standard ones should be defined in OSG (int, double, string...). 2. How to store them (the container)? 2.1. Have a simple, yet easy and stable way: a basic container (vector/list). Duplicate meta names should be handled on user's side if necessary. 2.2. Have a name-value map. Implementation may be a bit less flexible, but this ensures faster lookup (is this necessary?), and name unicity (is this necessary?). 2.3. Other ideas: multimap, unordered_map, etc. 2.4. Have a user-defined container. That way, user may ask for a simple vector, or a very complex DataBase-type container. As my colleague told me: usages can be too different to tell beforehand the container type. This is surely a good idea, but how to implement it? Work with iterators? Have a container base class? Use templates somewhere? Help! FYI: my implementation uses a vector container (having generally less than 10-20 metas in a container), with the MetaBase / Metasomething idea. 3. Where to store them? - Maybe there is a need to store them just in another variable, alongside userData. This is one of my needs, but I still can use userData as I do, even if that's not as clean as having directly a container in osg::Object. Note: to avoid burdening osg::Object too much, this could be a ref_ptr to a container. - Maybe there is a need for ReaderWriters, as I told at the begining of my email? I guess so, but this does not solve the constness problem if put in the Options structure. Or maybe we should provide ReaderWriter a non const container to play with? 4. How to serialize/deserialize them? I
Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)
Hi Tim, Sorry to jump into that conversation, but I also had a bug related to IndexMeshVisitor: the output geometries do NOT have number of vertices == number of texcoords... Did I miss something? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Tim Moore timoor...@gmail.com a écrit : I've found that that problem happens because the attribute arrays are shared among several Geometry objects. The fix is simple, but I haven't submitted it yet because the results of INDEX_MESH are still not great on the sphere object, and I have a different idea for how to approve that. Tim On Mon, Jan 31, 2011 at 2:58 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Tim, That sucks. I'll take a look. OK, let me know what you find out. I was pretty surprised the optimizers would go out of bounds, as I've used them on a variety of models without problems (as I bet you have, and many others too). Thanks in advance, J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] DrawElements vertices, normals, texcoords, indices without copying to osg::Array
I have a situation coming up where my code will be fed large blocks of vertex, normal, texcoord and index data from a non-OSG code environment. The goal is to draw this data with DrawElements. Currently, it looks to me like I need to rebuild some of this data (anything Vec*-based) into an osg::Array, which seems to necessitate copying the block. Am I missing anything, or is there some way to get the provided simple C-style arrays of data over to DrawElements without a copy in the middle? I know there will be a copy going from the CPU to the GPU anyway, so I'd like to avoid a second, needless CPU-CPU copy. Thanks in advance. -- 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] Discussion: metadata readerwriters output
On 1/31/2011 9:00 AM, Sukender wrote: Hi Paul, Thanks for this explanation about identifying nodes. Actually we also implemented a node identification using child index... However I did not spot metadata related classes in osgWorks. Well, ok, I just had a very quick overview... Can you tell me where to look at? Thanks. Once you have a mechanism for identifying nodes that is not address-based and therefore works from one app invocation to the next, there is no need for any OSG-specific metadata classes. Such metadata can be stored outside the scene graph. However, if you want to associate metadata with the scene graph, you just use UserData. Perhaps we have a philosophical difference. In my opinion, a scene graph should not be turned into a general purpose data structure. The scene graph should be tuned and optimized for operations on spatial data such as rendering and intersection testing. Rather, the app should associate subgraphs of the scene graph with its internal app data structure, as visual representations of app-specific entities. Using this approach, an app can use the NodePathUtils in osgWorks to identify the relevant nodes to reference from its internal data structure. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DrawElements vertices, normals, texcoords, indices without copying to osg::Array
Hi Chris, Am 31.01.2011 17:10, schrieb Chris 'Xenon' Hanson: I have a situation coming up where my code will be fed large blocks of vertex, normal, texcoord and index data from a non-OSG code environment. The goal is to draw this data with DrawElements. Currently, it looks to me like I need to rebuild some of this data (anything Vec*-based) into an osg::Array, which seems to necessitate copying the block. Am I missing anything, or is there some way to get the provided simple C-style arrays of data over to DrawElements without a copy in the middle? I know there will be a copy going from the CPU to the GPU anyway, so I'd like to avoid a second, needless CPU-CPU copy. You can have a look at osgsharedarray in the examples-directory. It shows how you can subclass osg::Array to use static C-array data without copying. Thanks in advance. Cheers, Peter -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Has anyone write osg::AudioSink for openal?
On 01/28/2011 11:53 PM, Lilinx wrote: hi,all same as tile!! Not yet, to my knowledge. I was going to tackle it at one point on my own, but it turned out to be a bigger job than I first thought. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Converting DrawArrays(TRIANGLE_STRIP) to DrawElements(TRIANGLES)
Hi Sukender, I'm not sure what you mean; I need to see an example. The IndexMeshVisitor doesn't work with BIND_PER_PRIMITIVE attributes and bails if it finds any. If the number of vertex coordinates doesn't equal the number of texture coordinates, that's a big bug. Normally the number of indices in the DrawElements result will be different from the number of vertex coordinates, etc. Tim On Mon, Jan 31, 2011 at 5:05 PM, Sukender suky0...@free.fr wrote: Hi Tim, Sorry to jump into that conversation, but I also had a bug related to IndexMeshVisitor: the output geometries do NOT have number of vertices == number of texcoords... Did I miss something? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Tim Moore timoor...@gmail.com a écrit : I've found that that problem happens because the attribute arrays are shared among several Geometry objects. The fix is simple, but I haven't submitted it yet because the results of INDEX_MESH are still not great on the sphere object, and I have a different idea for how to approve that. Tim On Mon, Jan 31, 2011 at 2:58 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Tim, That sucks. I'll take a look. OK, let me know what you find out. I was pretty surprised the optimizers would go out of bounds, as I've used them on a variety of models without problems (as I bet you have, and many others too). Thanks in advance, J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ 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] How to set the frame rate and full screen
Hi, I finished my application and I want to improve it. I have to issues: I need to increase the frame rate, since I rotate fast the camera and I need to start the simulation window at fullscreen (for now, I have to fix the dimensions manually). How can I do this? Thank you! Cheers, Axel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36198#36198 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DrawElements vertices, normals, texcoords, indices without copying to osg::Array
On 1/31/2011 9:19 AM, Peter Hrenka wrote: You can have a look at osgsharedarray in the examples-directory. It shows how you can subclass osg::Array to use static C-array data without copying. Thanks. That's exactly what I was hoping for. I'll go look at it right now. Appreciate the fast response! -- 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] How to set the frame rate and full screen
Hi Axel, I finished my application and I want to improve it. I have to issues: I need to increase the frame rate, since I rotate fast the camera and I need to start the simulation window at fullscreen (for now, I have to fix the dimensions manually). How can I do this? For full screen, have a look at the code for osgViewer::View::setUpViewAcrossAllScreens() or osgViewer::View::setUpViewOnSingleScreen(). That will show you how, or you could just call one of those methods depending on whether they fit your needs or not. For frame rate, I'm not sure what you mean. In general in real-time graphics, we tend to run with vsync on, meaning the frame rate will be a maximum of 60hz in general. If your app runs slower than that, it may be because of what you're doing in terms of graphical objects, or processing on the CPU, or whatever. But I have a hunch that the above is not what you're asking. Would you be basing the movement of your objects (or camera) on the frame rate? i.e. move x units per frame, or rotate x degrees per frame? If so, I would suggest you change your code from frame-based to time-based. i.e. move x units per second, and then use the elapsed time between the previous frame and the current one to calculate how much movement that is for this frame. That way you're independent of the frame rate. You can get the time elapsed between frame i and frame i+1 in a variety of ways, for example you could store the simulation time (which is recorded automatically each frame by osgViewer) and subtract the current frame time from the time you stored last frame. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set the frame rate and full screen
Hi Jean-Sebastien, thanks for the reply, you were realy helpful, now I have a better idea on how to proceed! Axel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36203#36203 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 2.9.10 on iOS
Am I suppose to use another version of freetype? AFAIK no, it's a universal-lib (i386 + arm) and had worked in the past. FYI, I recently setup a FreeType Xcode project for iOS to support SDL_ttf. It is based on a blog entry written by Alfred Rossi. This might be helpful if you need to rebuild freetype. The source is currently on 2.4.4. My Mercurial repository is here: http://hg.assembla.com/freetype_ios_xcode With SDL, I'm using Xcode cross project dependencies so I don't need to carry around a separate prebuilt static library. I haven't spent any time investigating how to do that with CMake. But if anybody wants to see an example of the Xcode setup, I have a Mercurial repo that utilizes the subrepos feature (kind of similar to svn externals or Git submodules). SDL Satellites http://hg.assembla.com/sdl-satellites-subrepos -Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Discussion: metadata readerwriters output
I have to agree with Paul, the Scene graph is just that. To renders data as fast and efficiently as possible OLD Performer handled some this by providing separate graphs for data and other information (while it was not close to perfect it did allow the clean separation that Paul is talking about and I agree with Gordon Tomlinson 3D Technology System Engineering Consultant Overwatch® An Operating Unit of Textron Systems __ WARNING: Documents that can be viewed, printed or retrieved from this E-Mail may contain technical data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq,) or the Export Administration Act of 1979, as amended, Title 50, U.S.C., App. 2401 et seq. and which may not be exported, released or disclosed to non-U.S. persons (i.e. persons who are not U.S. citizens or lawful permanent residents [green card holders]) inside or outside the United States, without first obtaining an export license. Violations of these export laws are subject to severe civil, criminal and administrative penalties. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz Sent: Monday, January 31, 2011 11:18 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Discussion: metadata readerwriters output On 1/31/2011 9:00 AM, Sukender wrote: Hi Paul, Thanks for this explanation about identifying nodes. Actually we also implemented a node identification using child index... However I did not spot metadata related classes in osgWorks. Well, ok, I just had a very quick overview... Can you tell me where to look at? Thanks. Once you have a mechanism for identifying nodes that is not address-based and therefore works from one app invocation to the next, there is no need for any OSG-specific metadata classes. Such metadata can be stored outside the scene graph. However, if you want to associate metadata with the scene graph, you just use UserData. Perhaps we have a philosophical difference. In my opinion, a scene graph should not be turned into a general purpose data structure. The scene graph should be tuned and optimized for operations on spatial data such as rendering and intersection testing. Rather, the app should associate subgraphs of the scene graph with its internal app data structure, as visual representations of app-specific entities. Using this approach, an app can use the NodePathUtils in osgWorks to identify the relevant nodes to reference from its internal data structure. -Paul ___ 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 human head
Hi guys, I am just beginning to get friendly with the osg api because i want to realize an application that animates a loaded model of a human head. the head will copy the motion of a real person. well, my question is: can osg really help me ? i understand how to realize rotation, translation and scale, but i'm not sure about how to simulate the mouth's motion for example. is that possible? where can i find something that illuminate my mind? xD Thank you an sorry for my poor english! Cheers, Antonio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36205#36205 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Texture atlas and shared state?
Hi all, On my quest to reduce the amount of statesets and draw calls in my graph, I've started building texture atlases with the osgUtil::Optimizer::TextureAtlasVisitor. Now, when I build the texture atlas(es) for a given model, I then save a .ive file of that model which includes the textures, and thus the atlas(es) too. So far so good. Unfortunately, I'm seeing an issue in our simulator that looks like OSG is using the same texture atlas for any model that uses texture atlases (i.e. the first texture atlas that was loaded is applied to any model that uses texture atlases). Indeed, if I dump the scene to a .osg file and examine it, I can see that there's one state set with a texture called atlas_0.rgb, and then all other objects have Use Texture2D_20 in their state sets, where Texture2D_20 is that atlas. I had noticed that osgUtil::Optimizer::TextureAtlasVisitor named its atlases atlas_0.ext, atlas_1.ext etc., but I thought that since I was saving to .ive there would be no problem, it would use the texture from the file when loading and all would be fine. What's weird is that I can't reproduce the problem in plain osgViewer - the textures are not mixed up if I load the .ive files (with atlases) all together in osgviewer. So it must be something in our app. To try and eliminate this, I disabled our use of the osgDB::SharedStateManager and our ReadFileCallback that would cache loaded files and share them. So now, all files should be loaded from disk and state should not be shared between files. But still this problem happens. I debugged into the ive loader's loading of images, and it seems to be loading them directly from the bits of the loaded file, so I don't see how the textures could be shared... Did anyone ever have this kind of problem? Where else could I look to find the problem? Will OSG or the ive loader do any sharing of loaded resources by itself? I guess I could do a kludge where I would traverse the graph just before saving, and add a model-dependent prefix to the filename of any image named atlas_*.* ... But since this works out of the box in osgviewer, I'd like to find out why it doesn't work in our app and fix it correctly... :-) Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] OSG initial setup
Hi J-S I appreciate the help! I am using Eclipse. You mention MinGW-gcc440_1, is that what you're using? Yes, and the line above that I had: Eclipse Helios Service Release 1 Build id: 20100917-0705 I should have mentioned it's EclipseCDT for C/C++ rather than Eclipse with the C/C++ plugin. I use Eclipse for Java but have tried Netbeans and a few others. I mentioned this is what was being used: /wiki/Support/PlatformSpecifics/MingwColladaEclipse As a Newbie to the forum it would not let me post the link. http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/MingwColladaEclipse I did not get any errors with the Cmake GUI, it just put it under C:\Program Files so I just needed to move it to C:\OpenSceneGraph I have not had to pull from an SVN lately so had to install TortoiseSVN again. I tried for a few hours with this but a considerable more time with the pre-compiled download. That example mentions BasicGeometry.cpp but pretty much ends with just printing !!Hello World!! That example is closed to comments so any changes, corrections, clarifications or whatever problems someone else has had and what was done to correct the problem is null ('\0'). Maybe here or somewhere else saw something to the effect that the bin directory had to be put in the system path rather than linked in the IDE be it Eclipse, VC++ or whatever. I have been using Upp, TheIde http://www.ultimatepp.org/index.html for my C++ programming so I am at a disadvantage with Eclipse but as much as I dislike VC++ may have to try that if you have a link to an example that you know is current, complete and works correctly. I will try the SVN again. Thank you! Neil -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36208#36208 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] OSG initial setup
Skylark wrote: with MinGW-gcc440_1 Probably not, it's probably a little-used compiler (I guess). On Windows the most used compiler is Visual C++ (8.0/2005 or 9.0/2008 at the moment). .. plus if you find you need to make changes to get things to compile for you, you will be able to submit your changed files and get the changes merged into the source so they profit others using the same environment as you. For C++ with Upp I use the MS VC++ 9 and 10 and also the MinGW compilers and they all work OK. I will be glad to help, I have more than 1600 posts on the NASA WW forum http://forum.worldwindcentral.com/forumdisplay.php?f=39 Probably 95% of those are helping others. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36209#36209 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] vpbmaster build question...
All, I fired off a VPB build using vpbmaster on a 16 processor machine running Linux Fedora core 13. The number of tasks generated was 5314 for this build. As predicted, vpbmaster fired off 16 osgdem threads to work on the build. As the build went along I noticed that the number of osgdem threads running had slowly decreased until that now there are only 0 to 2 threads running with about 2500 tasks remaining. I never see any more osgdem threads than 2 being generated to work on the build. This seems a bit strange. Is this correct behavior? I would have thought that up to 16 threads would have been working as the build process went along to completion. There is no indication of any errors in the output so far. Has anyone else seen this or know what might be going on? Thank you! -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36210#36210 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] Greetings, and a few bug.
Hi, Oops sorry, the if condition was my first attempt to check and fix the bug. It turns out that it was not working and the bug was somewhere else. The whole method is this: Code: float FFTOceanSurface::getSurfaceHeightAt(float x, float y, osg::Vec3f* normal) { if(_isDirty) build(); // ocean surface coordinates float oceanX, oceanY; // translate x, y to oceanSurface origin coordinates oceanX = -_startPos.x() + x; oceanY = _startPos.y() - y; // calculate the corresponding tile on the ocean surface unsigned int ix = oceanX/_tileResolution; unsigned int iy = oceanY/_tileResolution; unsigned int frame = _oldFrame; // Test if the tile is valid if(ix _numTiles iy _numTiles) { //++ BAWE-20101109: BUG FIX. //NOTE: 20101112 - Not working but what the heck... if (_oldFrame _mipmapData.size()) { const OceanTile data = _mipmapData[_oldFrame][0]; float tile_x = oceanX - ix * _tileResolution; float tile_y = oceanY - iy * _tileResolution; //++ BAWE-20101119: BUG FIX // Absolute value of dx dy tile_x = tile_x 0 ? tile_x : -tile_x; tile_y = tile_y 0 ? tile_y : -tile_y; //-- BAWE-20101119: BUG FIX if (normal != 0) { *normal = data.normalBiLinearInterp(tile_x, tile_y); } return data.biLinearInterp(tile_x, tile_y); } //-- BAWE-20101109: BUG FIX } return 0.0f; } Thank you! Cheers, Bawenang -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36211#36211 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] [ASK] Need help for a shader related issue
Hi, Because I can post URLs now, I'll post the source of what I want to implement. http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html Thank you! Cheers, Bawenang -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36212#36212 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org