[osg-users] DataBasePager expired removal question
Hello, I have a fairly big database which needs to be handled via PagedLOD. This works fine up to a certain point. In my project I've installed a load callback in order to clone certain nodes and do my own caching. Now, in order to cache the nodes correctly I've put a reference to the node in to a map (std::mapstd::string, osg::ref_ptrNode). I need to use the ref_ptr to be sure the node is still valid. It works well, up to the point where the DataBasePager removes expired PagedLODs, as I don't found any way to set a callback to the DataBasePager that tells me, which node is going to be removed. Is there any way to get this information (preferably via a callback)? Or do I have to set an observer to the node and don't manage the nodes as ref_ptr at this point? cheers Sebastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgVolume RayTracedTechnique problem
Hi Clement, On 5 March 2012 03:04, clement@csiro.au wrote: My program was using coin3D for volume rendering before. Now it is replaced with osg, but I still want the existing machine is able to run osg version. Last time you mentioned it is possible to implement a crude 3D volume rendering based on 2D textures. Can you tell me more in details how to do? Do you mean the current osg doesn't have this feature? Is it required to modify the source code and recompile again? Thanks. I am not about to complicate osgVolume with backwards compatibility to hardware that can't do volume rendering properly so this will be something you'll have to implement at your end. The way to do volume rendering with 2D textures is very limited but possible - you need to create a stack of 2D images that build up the volume, and then render a each of images as a 2D texture assigned to an axis aligned quad, building up the image from back to front. To handle viewing from all angles you'll need to create three sets of 2D images, one for each axis so as you rotate around the volume you can select the most closely aligned axis. This will use more memory than using proper 3D textures, and it'll be far less flexible as you won't be able to compute normal on the GPU or do any decent shader operations. The final product of you work will be compatibility but on as far as the lowest common denominator - i..e. really crude low res volumes. Alternatively you could spend a small amount of money on a graphics card for your systems that is capable of doing volume rendering. Even a low end ATI or NVidia card will be able to do volume rendering - it'll be slow, but still way faster than the Intel graphics and way higher visual quality. You'll save lots of time - you'll only need to save a couple of hours work to break even on the purchase of the graphics card - in fact I have little doubt that you've already wasted far more time and money trying to get by with crappy hardware that isn't up to the job. As for Coin3D doing it, well it's implementation of volume rendering is not too advanced - it's stuck at the lowest common denominator level that you really should be expecting to exceed these days. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataBasePager expired removal question
HI Sebaastian, I you want to keep track of internals of DatabasePager it is probably best to simply subclass from DatabasePager. Robert. On 5 March 2012 09:01, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hello, I have a fairly big database which needs to be handled via PagedLOD. This works fine up to a certain point. In my project I've installed a load callback in order to clone certain nodes and do my own caching. Now, in order to cache the nodes correctly I've put a reference to the node in to a map (std::mapstd::string, osg::ref_ptrNode). I need to use the ref_ptr to be sure the node is still valid. It works well, up to the point where the DataBasePager removes expired PagedLODs, as I don't found any way to set a callback to the DataBasePager that tells me, which node is going to be removed. Is there any way to get this information (preferably via a callback)? Or do I have to set an observer to the node and don't manage the nodes as ref_ptr at this point? cheers Sebastian ___ 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] DataBasePager expired removal question
Thanks Robert, I was expecting this answer ;-) cheers Sebastian HI Sebaastian, I you want to keep track of internals of DatabasePager it is probably best to simply subclass from DatabasePager. Robert. On 5 March 2012 09:01, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hello, I have a fairly big database which needs to be handled via PagedLOD. This works fine up to a certain point. In my project I've installed a load callback in order to clone certain nodes and do my own caching. Now, in order to cache the nodes correctly I've put a reference to the node in to a map (std::mapstd::string, osg::ref_ptrNode). I need to use the ref_ptr to be sure the node is still valid. It works well, up to the point where the DataBasePager removes expired PagedLODs, as I don't found any way to set a callback to the DataBasePager that tells me, which node is going to be removed. Is there any way to get this information (preferably via a callback)? Or do I have to set an observer to the node and don't manage the nodes as ref_ptr at this point? cheers Sebastian ___ 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] OpenGL 3.2 support in OS X 10.7 (Lion)
Hi David, On 4 March 2012 20:55, David Garcia da...@aimsun.com wrote: Yes, I think so too. Unfortunately Apple decides that a VAO is required. I can fill a radar and ask in the developer forums but, for now, what is the best solution? The think that we should implement proper VAO support. I'm not familiar with this new feature yet, but would guess that it should probably sit in osg::Array and osg::BufferData. I'm open to suggestions. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Light source default position
Hello. I found this shader line in the book: float intensity = dot(vec3(gl_LightSource[0].position), normal ); i was wondering why he doesnt normalize the light source position. He loads the cow.osg. The normal vector is normalized using: normal = normalize(gl_NormalMatrix * gl_Normal); Thank you for your time. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] If I set a vertex color using floats and access the vertex color in a shader, is there a loss of precision?
Hello all, If I were to set the color of a vertex of an osg::Node using floats between 0-1 and then accessed the color of that same vertex in a GLSL shader, would I get back the exact same floating point value? I am worried that at some point in the pipeline that float would be scaled to an 8 bit unsigned int between 0-255 and then rescaled back to a 0-1 float when accessed using GLSL. The reason I ask is that I am hoping to use the floating point value to carry a scaled index number for a lookup table in the shader instead of a color, so precision would be important. I know this is an OpenGL pipeline question and I am actively reading OpenGL documentation to get my head around this stuff in general but a quick answer to this particular question would be very much appreciated, especially since I can't do any debugging on the shader to verify this one way or another. Thanks, -Ethan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46035#46035 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] camera manipulator proposal
Hi Robert and All, in more than one occasion I've noticed that having access to the camera manipulator in use is not enough to have full control over the camera motion handling. An example is if you want to temporary disable the manip to set the camera position explicitly (in this case you need to remove the manipulator from the viewer, not to get the position overwritten), or if you want to write a manip for an ortho camera, in which case you need access to the camera's projection matrix as well. At the same time we need to preserve the loose coupling between the camera and its manipulator. I think that a possible approach would be a virtual method in the base camera manip like: virtual void osgGA::CameraManipulator::UpdateCamera(osg::Camera* pCam) to be invoked by the viewer classes. Instead of asking the ViewMatrix to the manipulators, they would call this method passing the reference camera and leaving the matrix assignments to the implementation. Do you think it's a reasonable approach? The porting of the existing manipulators to the new interface would be an easy task. Please give me some feedback, if you like the approach I can submit a patch. Thanks, Ricky ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D Frame Packing with OSG
On 03/03/2012 10:38 AM, Christian Buchner wrote: Geforce cards support stereoscopic 3D through HDMI as part of the 3DVision support for DirectX gaming only. It is called 3DTV Play and it isn't free (there's a 14 day trial version available). And this does not include OpenGL. Sure, but that's a different animal than what Erin is after. 3DTV play assumes the game wasn't written for 3D output and synthesizes the left and right channels based on the depth buffer. It also provides a Blu-ray 3D player (and I'm sure the fee is at least partly to cover Nvidia's licensing costs for this). From what I've read in several forums. If you create the 1280x1470 format (or 1920x2205 format) directly, you can get a GeForce card to render 3D content on a 3D monitor. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] If I set a vertex color using floats and access the vertex color in a shader, is there a loss of precision?
On 03/05/2012 10:54 AM, Ethan Fahy wrote: If I were to set the color of a vertex of an osg::Node using floats between 0-1 and then accessed the color of that same vertex in a GLSL shader, would I get back the exact same floating point value? I am worried that at some point in the pipeline that float would be scaled to an 8 bit unsigned int between 0-255 and then rescaled back to a 0-1 float when accessed using GLSL. The reason I ask is that I am hoping to use the floating point value to carry a scaled index number for a lookup table in the shader instead of a color, so precision would be important. Hi, Ethan, If you're talking about vertex attribute data, you're likely get the same value back that you originally specified. The vertex attributes will remain in float form until you actually rasterize the vertices. Only at that point will they need to be converted to fit the data format of the framebuffer. That said, it's generally not a good idea to rely on floating point values to be exactly the same from one call to the next. I'd recommend trying to come up with a different way to do what you're attempting, or at least use an epsilon value in your comparison. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] If I set a vertex color using floats and access the vertex color in a shader, is there a loss of precision?
Thanks Jason, I may do some testing with floats to see if they work out, but most likely I'll play it safe and use unsigned ints for r,g,and b and come up with an indexing scheme that can theoretically host up to 16.7 million discrete values. Jason Daly wrote: On 03/05/2012 10:54 AM, Ethan Fahy wrote: If I were to set the color of a vertex of an osg::Node using floats between 0-1 and then accessed the color of that same vertex in a GLSL shader, would I get back the exact same floating point value? I am worried that at some point in the pipeline that float would be scaled to an 8 bit unsigned int between 0-255 and then rescaled back to a 0-1 float when accessed using GLSL. The reason I ask is that I am hoping to use the floating point value to carry a scaled index number for a lookup table in the shader instead of a color, so precision would be important. Hi, Ethan, If you're talking about vertex attribute data, you're likely get the same value back that you originally specified. The vertex attributes will remain in float form until you actually rasterize the vertices. Only at that point will they need to be converted to fit the data format of the framebuffer. That said, it's generally not a good idea to rely on floating point values to be exactly the same from one call to the next. I'd recommend trying to come up with a different way to do what you're attempting, or at least use an epsilon value in your comparison. --J ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46039#46039 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] If I set a vertex color using floats and access the vertex color in a shader, is there a loss of precision?
On 03/05/2012 03:17 PM, Ethan Fahy wrote: Thanks Jason, I may do some testing with floats to see if they work out, but most likely I'll play it safe and use unsigned ints for r,g,and b and come up with an indexing scheme that can theoretically host up to 16.7 million discrete values. Just curious, Is there some reason you're specifying a scaled index for a look-up table as a color? Any reason you can't just pass your scaled index to your shader as a 32 bit generic integer vertex attribute? --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgexport - new version
Hi, That would be nice to report issue on the osgexport project because it's easier for me to see it. https://github.com/cedricpinson/osgexport/issues The other thing that helps is to provide simple example that I could commit in the project, then we can use it as non regression tests. I am able to export the model you talk with blender 2.61 r 42614. Could you report the log file generated ? Cedric Cedric Pinson Provide OpenGL, WebGL services +33 659 598 614 - http://cedricpinson.com - http://osgjs.org - http://showwebgl.com On Mar 2, 2012, at 21:40 , Maia Randria wrote: Hi Cedric, Thank you all for this new version. May I ask you with which Blender version did you use for this version ? I am sorry if I bother you about this problem, but this OSGExporter doesn’t work very well for me (I worked with Blender 2.59.0 r39307 (release version of 2.59) as well as with 2.61.0 r42615, Windows 7-32 bits) and the results are the same. I explain: for the avatar example (in the avatar directory on the osgexporter website), I got an osg model with black rectangles around the eyes, the mouth, etc. at the same place as of the spheres used to put the eyes, mouth. I also created 3D models with Makehuman, and no more success: I tried with naked and dressed characters but both failed. For the dressed character, I just got the skirt and a weird box … Please, may I ask you to have a look at my blend files and see what wrong am I doing ? Thank you very much. Maia -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46001#46001 ___ 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] DataBasePager expired removal question
Hi Sebastian, On 5/03/12 20:01 , Sebastian Messerschmidt wrote: Now, in order to cache the nodes correctly I've put a reference to the node in to a map (std::mapstd::string, osg::ref_ptrNode). I need to use the ref_ptr to be sure the node is still valid. It works well, up to the point where the DataBasePager removes expired PagedLODs, as I don't found any way to set a callback to the DataBasePager that tells me, which node is going to be removed. If you only need to detect that nodes have been expired by the DatabasePager (and not necessarily the exact moment) you could use an observer_ptr in your map rather than a ref_ptr. But you would need to 'lock()' every access and run a map cleanup periodically to remove stale nodes. Still, depending on your needs it might be cleaner than to subclass DBP. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] DataBasePager expired removal question
I need a coffee, you've already figured that out. Sorry for the noise :-} ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org