Re: [osg-users] How do I access the Z-Buffer content from the last render pass

2009-03-09 Thread Ralf Stokholm
Hi Daniel I dont know if its possible to do this from the native z buffer, but I know its possible if you create the zbuffer as part of a render target. i.e. osg::Texture2D* CreateTexture( unsigned short w, unsigned short h ) { osg::Texture2D* texture = new osg::Texture2D() ;

Re: [osg-users] osg+QT MODKEY How to

2009-03-09 Thread Dieter Pfeffer
Hi Legeo I had a similar problem - using osg, qt4 and the AdapterWidget example. In AdapterWidget::keypressEvent (...) osgGA::GUIEventAdapter::KeySymbol) * (event-text().toAscii().data() returns 0 in the call _gw-getEventQueue()-keyPress( (... ) ) for keys like: Qt::Key_up ... Have a look at

Re: [osg-users] How do I access the Z-Buffer content from the last render pass

2009-03-09 Thread Robert Osfield
Hi Daneil, You'll need to render the scene to a FBO with texture attached to as the depth buffer, then reuse this texture in the second pass. Robert. On Mon, Mar 9, 2009 at 1:30 AM, Daniel Holz dani...@cm-labs.com wrote: Hi osg-users, is it possible to access the Z-Buffer content from a

Re: [osg-users] osg+QT MODKEY How to

2009-03-09 Thread Fabien Lavignotte
The osgViewerQt example does not take into account modifier key. So, the OSG modifier mask is always zero. I have changed the conversion between Qt event and OSG event to handle modifier properly. Here is my code. You can adapt this code in your widget. Let me know if you need some help. Fabien

Re: [osg-users] Mirrored camera

2009-03-09 Thread Joakim Simonsson
On Mon, 02 Mar 2009 15:50:41 +0100, Ufuk ufuk@gmail.com wrote: Hi Joakim, in examples osgcamera, in function: void multipleWindowMultipleCameras(osgViewer::Viewer viewer, bool multipleScreens) i tried this code sample: if (i != 2) viewer.addSlave(camera.get(),

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread J.P. Delport
Hi, sorry, I didn't read through all your code, but have a look at the osgmultiplerendertargets example. I don't think data is written specifically to alpha there, but you can modify it to check. Run it with --image and --hdr. I think the --image prints out some values of the texture it

[osg-users] camera standard frustum

2009-03-09 Thread Martin
Hello, when i create a camera: osg::ref_ptr osg::Camera cam = new osg::Camera(); and I want to get the frustum parameters: cam-getProjectionMatrixAsFrustum(left,right,bottom,top,znear,zfar); I dont't get the parameters. It seems that the camera hasn't a projection matrix. Where is the

Re: [osg-users] camera standard frustum

2009-03-09 Thread Robert Osfield
Hi Marttin, osg::Camera always has a projection and view matrix, you can't disable/remove them. osg::Camera stores the projection matrix as a 4x4 matrix, which you can get using Camera::getProjectionMatrix(). When you set the projection matrix using setProjectionMatrixAsFrustum(...) it does the

Re: [osg-users] camera standard frustum

2009-03-09 Thread Martin
Hello, I think it works now. It was my mistake. But the near plane is very small. Is it normal? Thanks Martin LittleG wrote: Hello, when i create a camera: osg::ref_ptr osg::Camera cam = new osg::Camera(); and I want to get the frustum parameters:

[osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Erwan Bigorgne
Hello, I'm currently using (and learning) osg in order to manage an implicite 3D- model in an computer vision task. for that purpose, i need to compute a reliable depth map, that i intend to update at each step of the algorithm. I've almost reach that goal, but sometimes, the generated osg::Image

Re: [osg-users] camera standard frustum

2009-03-09 Thread Robert Osfield
On Mon, Mar 9, 2009 at 12:06 PM, Martin grosser.mar...@gmx.de wrote: Hello, I think it works now. It was my mistake. But the near plane is very small. Is it normal? By default the OSG will compute the near + far planes, during the cull traversal, to fit the depth range of the objects in the

Re: [osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Robert Osfield
Hi Erwan, You don't provide enough information about your setup for us to guess what might be wrong. How are you setting up your scene + viewer to render to the image? Is your rendering just for the purpose of generating an osg::Image as output? How you are testing the results of the image?

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jim Brooks
. // activate blending to be able to write to gl_FragColor.a stateset-setMode(GL_BLEND, osg::StateAttribute::ON); .. No, this comment has a misunderstanding. Writing to gl_FragColor.a in the fragment shader does work of course but it isn't the final RGBA

[osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Erwan Bigorgne
How are you setting up your scene + viewer to render to the image? basically : mesh (readnodefile) - PAT (internal) - PAT (external) -- Rootnode - viewer |_ MyCam _| |_ Depth Map

Re: [osg-users] camera standard frustum

2009-03-09 Thread Tomlinson, Gordon
Typically it can be yes, Search the archives/FAQs/ on small feature culling as well, as by default OSG automatically adjust the near and far plans , you may want to turn this off , that is if you want to controll the near and far plans Gordon Product Manager 3d

Re: [osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Robert Osfield
Hi Erwan, Could you please do a reply to on the original thread in future, so that people following the thread can view all the posts in sequence - this post starts a new thread so looses the continuity. As for your explanation, I'm afraid it fill in a few missing pieces in the jigsaw, but also

Re: [osg-users] How do I access the Z-Buffer content from the last render pass

2009-03-09 Thread Jean-Sébastien Guay
Hi Robert, You'll need to render the scene to a FBO with texture attached to as the depth buffer, then reuse this texture in the second pass. Just to add specifics to Daniel's question, in case the approach is not right and you can suggest something else. We want to render something in

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jean-Sébastien Guay
Hi Jim, . // activate blending to be able to write to gl_FragColor.a stateset-setMode(GL_BLEND, osg::StateAttribute::ON); .. No, this comment has a misunderstanding. Writing to gl_FragColor.a in the fragment shader does work of course but it isn't the

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Ralph Kern
hi Jean-Sebastian, I guess you're looking for the discard statement in the fragment shader? regards Ralph Jean-Sébastien Guay schrieb:If not, then is there some other way to kill a fragment we don't want to show up once we're at the fragment shader stage? (I seem to recall there was a way,

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jean-Sébastien Guay
Hi Ralph, I guess you're looking for the discard statement in the fragment shader? Heh, discard, that's it. Thanks :-) J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/

Re: [osg-users] 2.8 OpenThreads linker errors on Mac 10.5

2009-03-09 Thread Christian Noon
Stephan, Sorry this took me so long to get posted, I've been out of the country for the last couple weeks. Anyways, here's a shortened version of my build log, I removed a bunch of the warnings coming from wx. If you want to see the full log, I'll repost. Building target “ASDS-v2.0” of

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Joseba
Hi, I had some similar problem sometime ago and i solved it changing the internal format of the texture for the RTT. I also had some issues using FRAME_BUFFERS instead of FBOs, but you are already using them. Regards, J. -- Read this topic online here:

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Daniel Holz
Hi Joseba, I use FBOs but the problem is that in the beginning of my application it says RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6. Could this be the problem? And what is the reason for that? Could you tell me which internal format you where using and which issues

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jim Brooks
I agree that whatever is put in gl_FragColor.a will not be the final alpha value in the framebuffer, but at least if we put gl_FragColor.a = 0.0 then the current fragment shader's output color should be transparent, and so anything behind should be completely visible, right? Not necessarily. If

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Daniel Holz
Hi, I just want to make sure that we do not misunderstand each other: The problem is not to make a fragment invisible (the discard statement in fact works for that pretty well) but to simply store normalized data ([0,1]) as the alpha component of my RGBA texture by using gl_FragColor.a = ...

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jean-Sébastien Guay
Hi Jim, Not necessarily. If the object-that-is-supposed-to-be-transparent still has depth writing enabled, it will overwrite more distant objects. Then there's which blend functions are enabled which can alter the output of the fragment shader. OK, but I'm talking about a pre-render pass to

[osg-users] Distance to camera

2009-03-09 Thread Peter
Hi all, I'd like to make callback which compute the distance from LOD object to camera. I tried this: Code: class DistanceCallback : public osg::NodeCallback { public: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osg::LOD *lod = dynamic_castosg::LOD * (node);

Re: [osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Erwan Bigorgne
My bad, I must admit that I actually don't know how to simply reply to a thread. anyway, here is my code : void COSGMesh::Initialization(void) { mp_RootNode = new osg::Group; mp_MeshGroup = new osg::Group; mp_InternalMatrixTransform = new osg::MatrixTransform; //

[osg-users] OSGDem Question

2009-03-09 Thread Albert
Hello All, I'm attempting to generate some terrain data of south western Australia using OSGdem. I am using Erdas Imagine to create an Area Of Interest tiff file of Australia and then running the file through OSGDem. My question comes in the output portion. I notice OSGDem is outputting a

Re: [osg-users] Distance to camera

2009-03-09 Thread Vincent Bourdier
Hi, I use the manipulator-gtInverseMatrix().getTrans() to have camera position node-getBound-center() * node-getWorldMatrix() to have node center, and then you just have to compute the difference. Vincent. 2009/3/9 Peter osgfo...@tevs.eu Hi all, I'd like to make callback which compute the

Re: [osg-users] Distance to camera

2009-03-09 Thread Robert Osfield
Hi Peter, Go look at how LOD::traverse() is implemented in src/LOD.cpp. Robert. On Mon, Mar 9, 2009 at 4:47 PM, Peter osgfo...@tevs.eu wrote: Hi all, I'd like to make callback which compute the distance from LOD object to camera. I tried this: Code: class DistanceCallback : public

Re: [osg-users] Robust Update of an osg::Image attached to a osg::camera ?

2009-03-09 Thread Robert Osfield
Hi Erwan, I find you code rather confusing. Do you actually want to use a slave camera? If you just need one camera then just set the values on the viewers master camera. As for threading... have you attempted to search the include/osgViewer headers, documentation, examples or the web for the

[osg-users] [osgPlugins] fonts

2009-03-09 Thread Paul Shabash
Hello, When I try to create text, I get the following error message: Warning: Could not find plugin to read objects from file C:\Windows\Fonts\arial.ttf. Does anyone know which plugin that's referring to and why? Both osgdb_osgtext.dll and osg55-osgText.dll are built and present in my path.

Re: [osg-users] Distance to camera

2009-03-09 Thread Tomlinson, Gordon
Pump Vincents Vec's in and just replace fasterSqrt SQRT func and square with SQR func inline double const getDistance( double const start[3], double const end[3] ) { double dist = fasterSqrt( rv3d::square( start[0] - end[0] ) + square( start[1] - end[1] ) +

Re: [osg-users] [osgPlugins] fonts

2009-03-09 Thread Csaba Halász
On Mon, Mar 9, 2009 at 7:23 PM, Paul Shabash osgfo...@tevs.eu wrote: Hello, When I try to create text, I get the following error message: Warning: Could not find plugin to read objects from file C:\Windows\Fonts\arial.ttf. Does anyone know which plugin that's referring to and why? I

[osg-users] is osg::Referenced threadsafe by default?

2009-03-09 Thread Cory Riddell
In my app, I have the viewer running in its own thread. I only change the scene graph in a synchronized update callback (or to be more precise, I'm serializing access to the data that the callback uses). Using the default build settings, are the reference counting methods thread safe? Cory

Re: [osg-users] OSGDem Question

2009-03-09 Thread Ralf Stokholm
Hi Albert You can specify a default color as a command line parameter, I have experienced chrashed using this, but if you build from sources you can change the default color in the code. That worked for me. As far as I know the quadtree osgdem builds will always have a rootnode covering the

[osg-users] cast ray into scene

2009-03-09 Thread Ben Axelrod
I have been using osgUtil::PickVisitor for a while now to pick objects in my tree under the mouse. But now I need to cast a ray into the scene under the mouse and manually intersect it with an imaginary plane. Is there some helper function to do this mouse ray cast for me? Specifically,

Re: [osg-users] cast ray into scene

2009-03-09 Thread John Aughey
For my application, I use this function to extract the origin and the direction of a 2d point on the screen. My windowing system here is Qt. I can't say this is the most efficient way to get the answer, but it works. void QOpenSceneGraph::xyVector(const QPoint screenpoint, osg::Vec3d origin,

Re: [osg-users] osg+QT MODKEY How to

2009-03-09 Thread René Molenaar
Hi, i use the following code to get the modifiers in. call this in your mousePressEvent. (and don't forget to convert the keyrelease, like other non-text key-releases) /** * Check the current event for modifiers * * @brief Mouse Press Event * @param event Mouse event to be placed in the

Re: [osg-users] Can't write to ALPHA component with custom fragment shader in RTT pass

2009-03-09 Thread Jim Brooks
OK, but I'm talking about a pre-render pass to an FBO though. The FBO is attached to an RGBA texture, and we want to be able to store some data in the alpha channel... So we want what we write to gl_FragColor.a to make it into the texture directly. Is there a way to do that? Never used FBO, but

Re: [osg-users] is osg::Referenced threadsafe by default?

2009-03-09 Thread Robert Osfield
On Mon, Mar 9, 2009 at 6:42 PM, Cory Riddell c...@codeware.com wrote: Using the default build settings, are the reference counting methods thread safe? Yes. ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] [osgPlugins] Plugin to read ACAD 7.2 Facet File ?

2009-03-09 Thread Ed
I need to read a file which is based on a subset of the ACAD 7.2 Facet File format. Has anyone written a plugin to do so? Ed ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] osg+QT MODKEY How to

2009-03-09 Thread legeochen
Hi guys: Thanks all for your answers. It helps a lot! cheers :) Legeo 2009/3/10 René Molenaar megamillerz...@gmail.com Hi, i use the following code to get the modifiers in. call this in your mousePressEvent. (and don't forget to convert the keyrelease, like other non-text key-releases)

[osg-users] Simple question: How to set the icon that will be used when a viewer is realized?

2009-03-09 Thread Matt McPheeters
Hi guys, I found of an old way of doing this using Producer. I want the icon of the viewer window to be custom, not the plain white application icon it defaults to. How do you set the icon now in OpenSceneGraph-2.7.4? Sorry if this question gets asked a lot.

Re: [osg-users] Simple question: How to set the icon that will be used when a viewer is realized?

2009-03-09 Thread Cory Riddell
I don't know if there is a platform independent way of setting this. What OS are you using? which icon are you talking about exactly? The one in the top right corner? Cory Matt McPheeters wrote: Hi guys, I found of an old way of doing this using Producer. I want the icon of the viewer

[osg-users] importing shaders

2009-03-09 Thread Julia Guo
I have a model made in 3DS with textures and shaders and I would like to use it within OSG. When I try displaying it with osgviewer.exe the textures are rendered but not the shaders. I know shaders are algorithms, so perhaps they are not exported with the model. Or 3DS may be using a DirectX