Re: [osg-users] texture to file

2009-08-27 Thread Engvall Åsa
Try to use m_rImage->setInternalTextureFormat(GL_LUMINANCE32F_ARB); Åsa -Ursprungligt meddelande- Från: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] För J.P. Delport Skickat: den 27 augusti 2009 10:50 Till: OpenSceneGraph Users Ämne: R

[osg-users] Problem to get textures from a .flt model

2008-06-16 Thread Engvall Åsa
Hi everybody! I am new to OSG and this is my first posting to OSG users. I have some problems to retrieve the textures from a .flt model and would like to know what I'm doing wrong. In main, the model is loaded in this way: osg::Group* Ground = dynamic_cast (osgDB::readNodeFil

Re: [osg-users] Problem to get textures from a .flt model - resolved

2008-06-17 Thread Engvall Åsa
://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/OpenFlight Regards, Brede On Tue, Jun 17, 2008 at 8:24 AM, Engvall Åsa <[EMAIL PROTECTED]> wrote: > Hi everybody! > > I am new to OSG and this is my first posting to OSG users. > I have some problems to retrieve the textures

Re: [osg-users] camera view matrix problems...

2008-06-23 Thread Engvall Åsa
Hi, I think you need a matrix that makes a conversion from "Y up" to "Z up". Here is some code that I use for setting the camera manually: osg::Matrixd cameraMatrix; osg::Matrixd cameraRotation; osg::Matrixd cameraTrans; cameraRotation.makeRotate(

[osg-users] Varying shader variable /= 0 in vertex shader, is == 0 in fragment shader

2008-11-03 Thread Engvall Åsa
Hi osg-users! I'm trying to write my first shader, it is a very simple test program which sets the color on a sphere. The color depends on whether the sphere has moved relative to its position in the previous frame. I use two varying variables, which are set in the vertex shader, see the code

Re: [osg-users] Varying shader variable /= 0 in vertex shader... resolved

2008-11-03 Thread Engvall Åsa
PosClip.xy/currentPosClip.w - previousPosClip.xy/previousPosClip.w; should be displacementNDC = currentPosClip.xy/currentPosClip.w - previousPosClip.xy/previousPosClip.w; Otherwise you will be declaring a new variable with the name displacementNDC the main function as scope. /Andreas 2008/11

[osg-users] Render to texture problem

2008-11-06 Thread Engvall Åsa
Hi! I want to render the scene to a texture and use the texture in a shader. The texture image is saved to file by a postdraw callback, so I can look at it. I'm doing something wrong because the texture becomes all gray. My scene graph looks like this: RTT camera root |

Re: [osg-users] Render to texture problem

2008-11-07 Thread Engvall Åsa
m Hi, any reason why you have RGBA texture, but RGB in callback? jp Engvall Åsa wrote: > Hi! > > I want to render the scene to a texture and use the texture in a shader. > The texture image is saved to file by a postdraw callback, so I can > look at it. I'm doing so

Re: [osg-users] Render to texture problem

2008-11-07 Thread Engvall Åsa
er 2008 09:42 Till: OpenSceneGraph Users Ämne: Re: [osg-users] Render to texture problem Hi, is your RTT camera the child of anything? I'm just guessing without having an example to run. jp Engvall Åsa wrote: > I thought that the texture must be in RGBA to be used in a shader. The >

Re: [osg-users] Render to texture problem

2008-11-07 Thread Engvall Åsa
l not under the viewer, try viewer.setSceneData(root); jp Engvall Åsa wrote: > Hi again! > Now I have changed my scenegraph according to your drawing, and put > the RTT camera under a root node, but it still doesn't work. > > This time I attach all the code in my appl

Re: [osg-users] Render to texture problem - resolved

2008-11-07 Thread Engvall Åsa
at 1:16 PM, Engvall Åsa <[EMAIL PROTECTED]> wrote: > It isn't obvious to me why the RTT camera must be under the viewer. I just > thought of the viewer as a camera which looks at the scene. Is the viewer > more like something that collects the pictures from all cameras and mak

Re: [osg-users] Render to texture problem

2008-11-07 Thread Engvall Åsa
___ Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Andreas Lindmark Skickat: den 7 november 2008 10:33 Till: OpenSceneGraph Users Ämne: Re: [osg-users] Render to texture problem The camera has to be somewhere in the scenegraph under the root. Something like this: Root /

[osg-users] RTT - texture is not what I expected

2008-11-11 Thread Engvall Åsa
Recently, I tried to render the scene to a texture, and after some help I got something in the texture. Now, I've found that the texture doesn't show the scene but the previous frame. With shading and everything. How is that possible? My scene graph looks like this: root / \

[osg-users] Problem updating uniforms

2008-12-02 Thread Engvall Åsa
Hi osg-users! I have a shader attached to a subgraph. The shader uses a uniform which needs to be updated in every frame. The uniform is related to the modelviewmatrix, and should thus get a different value for every node in the subgraph. I have tried to use a osg::Uniform::Callback, but the c

Re: [osg-users] Problem updating uniforms

2008-12-02 Thread Engvall Åsa
ement and provide poor performance. Please note that you have gl_ModeViewMatrix and osg_ViewMatrix available in shaders as well a range of other variables. Robert. On Tue, Dec 2, 2008 at 1:47 PM, Engvall Åsa <[EMAIL PROTECTED]> wrote: > Hi osg-users! > > I have a shader attache

Re: [osg-users] Problem updating uniforms

2008-12-02 Thread Engvall Åsa
::PreciptionEffect as it caches the previous frames modelview matrix to enable it to compute motion blurr of the rain particles. This is done just for the precipitation effect drawables though. Robert. On Tue, Dec 2, 2008 at 2:08 PM, Engvall Åsa <[EMAIL PROTECTED]> wrote: > I agree, but what I ne

[osg-users] ComputeBoundsVisitor problem

2009-02-11 Thread Engvall Åsa
Hi osg-users! I want to use a ComputeBoundsVisitor for finding the bounds of an object. The object belongs to the class GroundObject, which is derived from osg::Node. Please have a look at this short function. The visitor is probably not executed, and the resulting bounding box is not valid. vo

Re: [osg-users] ComputeBoundsVisitor problem

2009-02-11 Thread Engvall Åsa
Engvall Åsa : > Hi osg-users! > > I want to use a ComputeBoundsVisitor for finding the bounds of an object. > The object belongs to the class GroundObject, which is derived from > osg::Node. > > Please have a look at this short function. The visitor is probably not > exe