[osg-users] Getting animations initial frame bones matrix

2012-02-16 Thread Aitor Ardanza
Hi,

I'm working on a IK system to use in the transition between different 
animations. I have already implemented the IK CCD algorithm, but I need to know 
the bones position at animations initial frame.
It is posible to get it from osgAnimation::TimelineAnimationManager animation 
list?  or from osg osgAnimation::Animation channels???
I have been looking the osg class reference documentation, but I can't find how 
to get that information...

Any help will be appreciated, Thank you!

Cheers,
Aitor

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45501#45501





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Trackballmanipulator and Cameraposition

2012-02-16 Thread Soonchan Park
Hi,

Thank you Nick!
 
it help a lot.


I found one more tip, so i introduce here.
(im in OSG 2.8.3)

When i put your code outside of while loop, then it didn't work.
Still trackball manipulator ignore assigned camera position.
(I don't know why)

So, i just put the code in while loop.



while(!viewer.done()){

cam-setViewMatrixAsLookAt(camPosition,osg::Vec3(0.0,0.0,0.0),osg::Vec3(0.0,0.0,1.0));

trackball-setByMatrix(osg::Matrix::inverse(cam-getViewMatrix()));
...



Then, it works :D:D

Cheers,
Soonchan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45502#45502





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to prevent resize of viewer window (Windows and Linux)

2012-02-16 Thread John Simpson
Hi,

I need to display a viewer window that the user can't resize.  Tried all sorts. 
 I assume it's the viewer's graphics context traits resize boolean but can't 
figure out a way to change it.  This is a cross-platform app and I guess there 
will be a way of messing with the underlying Windows and X subsystems to 
achieve this but I'm hoping for something more elegant within OSG

Help required.

Thanks,

John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45503#45503





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)

2012-02-16 Thread Werner Modenbach
Does cross platform mean you are using Qt framework? In this case just
assign a fixed size to the embedding window.

Am 16.02.2012 13:40, schrieb John Simpson:
 Hi,

 I need to display a viewer window that the user can't resize.  Tried all 
 sorts.  I assume it's the viewer's graphics context traits resize boolean but 
 can't figure out a way to change it.  This is a cross-platform app and I 
 guess there will be a way of messing with the underlying Windows and X 
 subsystems to achieve this but I'm hoping for something more elegant within 
 OSG

 Help required.

 Thanks,

 John

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=45503#45503





 ___
 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] Etende light source example

2012-02-16 Thread Sajjadul Islam
Hi,

Is there any example of extended light source for example , rectangular light 
source inside the osg repository. I could not locate it in the repository, 
please help me to locate if i missed it there. 

Thank you!

Cheers,
Sajjadul

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45505#45505





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)

2012-02-16 Thread John Simpson
Hi Werner

Thanks for the reply.  No I'm not using Qt, it's cross-platform at the console 
level so I'm relying on OSG's viewer windowing. 

John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45506#45506





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] set render bin details

2012-02-16 Thread Sajjadul Islam
Hi,

I am going through an osg example and one point there is a statement as follows:


Code:

stateset-setRenderBinDetails(-1,RenderBin);




Commenting the above statement did not make any changes to the scene.

Any explanation when one should call this function ? 

Thank you!

Cheers,
Sajjadul

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45507#45507





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)

2012-02-16 Thread John Simpson
Hi,

For info: this can be achieved using...

osgViewer::ViewerBase::Windows windows;
viewer.getWindow(windows);
windows[0]-setWindowDecoration(false);

But this also prevents the window being moved - not ideal. 

John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45508#45508





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Effect Durations

2012-02-16 Thread Tolga Yilmaz
Hi,
I'm creating an explosion effect with it is fire and smoke trail it is ok but i 
want to set a duration that determines how many seconds/miliseconds this effect 
will be shown. Does fire smoke and explosion effect classes have such control 
or how we can achieve this implementation?

Thank you!

Cheers,
Tolga

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45509#45509





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Effect Durations

2012-02-16 Thread Sergey Polischuk
Hi

If you use osgParticle for this, both particles and emitter have lifetime in 
seconds, which is configurable through their interface. For emitter you should 
also call emitter-setEndless(false); as it is endless by default iirc

Cheers,
Sergey.

16.02.2012, 18:36, Tolga Yilmaz osgfo...@tevs.eu:
 Hi,
 I'm creating an explosion effect with it is fire and smoke trail it is ok but 
 i want to set a duration that determines how many seconds/miliseconds this 
 effect will be shown. Does fire smoke and explosion effect classes have such 
 control or how we can achieve this implementation?

 Thank you!

 Cheers,
 Tolga

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=45509#45509

 ___
 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] Etende light source example

2012-02-16 Thread Chris Hanson
OpenGL FFP lights are point light sources only.

Generally you have to simulate non-point light sources with arrays of
lights (FFP) or a custom shader (GLSL). No examples of either of these are
included in OSG.

What are you trying to accomplish?


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgAnimation : correct approach to detect when a skeletal animation has completed ?

2012-02-16 Thread Helen Diez
Hi,

I'm new using osgAnimation. I would like to control the state of the animation, 
I mean, I would like to know which frame or time of the animation is happening 
in order to stop it whenever I want.

I've tried setting the duration in half the time, and setting a callback as 
follows:

anim-setDuration(anim-getDuration()*0.5);
osg::ref_ptr osgAnimation::ActionStripAnimation  newAnimAction = new 
osgAnimation::ActionStripAnimation(anim,blendInDuration,blendOutDuration);
newAnimAction-setCallback(newAnimAction-getNumFrames()*0.5, new 
ActionEnd(this));

But I don't think it's working... I think it only speeds up the animation but 
doesn't really stop it half way.

Does anyone know how to achieve this? 

Thanks a lot!

Cheers,

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45512#45512





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] set render bin details

2012-02-16 Thread Jason Daly

On 02/16/2012 08:22 AM, Sajjadul Islam wrote:

Hi,

I am going through an osg example and one point there is a statement as follows:


Code:

stateset-setRenderBinDetails(-1,RenderBin);


When OSG traverses a scene for rendering, it organizes geometry into 
separate render bins.  Each bin has an index and a sorting mode.  When 
it comes time to actually draw the geometry, the render bins are 
traversed in order of index (lowest to highest), and the geometry in 
those bins are drawn after being sorted according to the sorting mode.


In this case the index of -1 means that the geometry in this bin will be 
drawn before the rest of the geometry (which by default goes into bin 
0).  RenderBin is the default sort order (which happens to be 
SORT_BY_STATE).


In this case, there must be some geometry that is required to be 
rendered before the rest of the scene.  Since you didn't mention which 
osg example you were looking at, that's all I can say about it.


--J

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Etende light source example

2012-02-16 Thread Jason Daly

On 02/16/2012 07:57 AM, Sajjadul Islam wrote:

Hi,

Is there any example of extended light source for example , rectangular light 
source inside the osg repository. I could not locate it in the repository, 
please help me to locate if i missed it there.


I think OSG is currently limited to the OpenGL light sources (point, 
spot, and directional light sources, as well as ambient light).


There isn't currently any code to handle global illumination in OSG, so 
area lights (like rectangles) don't really mean much anyway.


--J

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-16 Thread Ethan Fahy
Hi all,

I'm having some difficulty setting up a GLSL lookup table shader with my osg 
program and am hoping for some help.  I've looked at every opengl, glsl, osg 
and other forum posting I could find online and think I am pretty close to 
getting things working.  I could put a ton of code here but I think I'll just 
ask one question and provide more code if need be:

Do I have to attach my lookup table (stored in an osg::Texture2d) to a simple 
rectangular geometry in order to be able to perform a GLSL texture2d method on 
it?  Currently I am putting my lookup texture in texturecoordinate 1 of the 
object I am trying to apply my shader to.

The reason I ask is that whenever I try to pull out a value from my lookup 
texture using a vec2 with values from 0.0-1.0 in my shader and perform any sort 
of operation using that value, the osg command line spits out:

Warning: detected OpenGL error 'invalid operation' at After Renderer::compile

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45515#45515





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to prevent resize of viewer window (Windows and Linux)

2012-02-16 Thread Jason Daly

On 02/16/2012 08:46 AM, John Simpson wrote:

Hi,

For info: this can be achieved using...

osgViewer::ViewerBase::Windows windows;
viewer.getWindow(windows);
windows[0]-setWindowDecoration(false);

But this also prevents the window being moved - not ideal.


Hi, John,

There should be a better way to do that:

osg::GraphicsContext::Traits *traits = new osg::GraphicsContext::Traits;

traits-x = 100;
traits-y = 100;
traits-width = 640;
traits-height = 480;
traits-windowDecoration = true;
traits-supportsResize = false;
traits-sharedContext = 0;

osg::Camera *camera = new osg::Camera();
camera-setGraphicsContext(gc);
camera-setViewport(new osg::Viewport(0, 0, traits-width, traits-height));

viewer.setCamera(camera);
viewer.realize();


Haven't tested this code, but something like that should be enough to 
get what you're looking for.


--J

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Potential bug in mouse / window event handling

2012-02-16 Thread Michael . A . Bosse
Hello all,

I believe that I may have discovered a bug in the GUI abstraction
library; although this may be a known issue. Here are the steps to
reproduce it. I performed these steps on 64bit Windows 7, as well as
64bit Vista, both using version 3.0.0 built in 32 bit on Visual Studio
2008 sp1.

1. Run osgviewer.exe avatar.osg
2. Press f to switch to a window mode
3. Click and hold both your left and right mouse button and drag towards
the edge of the window
4. Release the right button, then exit the window and release the left
5. Move the mouse back over the window WITHOUT clicking any buttons on
the mouse
6. You will notice that the trackball is still moving as though the left
button was held down
7. Click the left button, the behavior is as expected again

To prove to myself that it was probably not the intended functionality,
I then performed the following steps
1. Perform steps 1 and 2 above
2. Click the left mouse button and drag towards the edge of the window
3. Drag off of the window
4. Release the left mouse button 
5. Move the mouse back over the window WITHOUT clicking any buttons
6. You will notice the trackball is as expected

I attached a debugger and went into the event traversal part of the
osgViewer::Viewer class and noticed that while the mouse was out of the
window (so after step 5 of the first procedure), the event queue still
had an event with a mouse button held down. I believe that perhaps, some
boundary condition is being hit when there are two buttons and one is
released, that is not being handled correctly.

I don't have enough time to dig more into this, but I tried to diagnose
it as completely as possible given my time constraints. This also
impacts the osg mfc example, so it is not limited to the osgviewer
application.


Michael A Bosse'
Software Engineer
Link Simulation and Training
Desk (407)206-7628
Cell (386)847-0738

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Etende light source example

2012-02-16 Thread Sajjadul Islam

Chris Hanson wrote:
 OpenGL FFP lights are point light sources only.
 
 Generally you have to simulate non-point light sources with arrays of lights 
 (FFP) or a custom shader (GLSL). No examples of either of these are included 
 in OSG.
 
 What are you trying to accomplish?
 
 
 
 -- 
 Chris 'Xenon' Hanson, omo sanza lettere.  http://www.alphapixel.com/ 
 (http://www.alphapixel.com/)
 Training • Consulting • Contracting
 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • 
 GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • 
 LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
 
  --
 Post generated by Mail2Forum



So it is posible to implement it with GLSL and could you provide me with some 
reference materials ?



I am experimenting and trying to implement summed area variance shadow mapping 
with extended light source.

And i need to define this extended light source first .

Regards
Sajjad

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45518#45518





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] FBO render to texture help please

2012-02-16 Thread Alex Pecoraro
Hi,

I'm attempting to create an osg::Camera that renders to a texture via a frame 
buffer object, but it is not working. When I debug it I see that the after 
attempting to bind the FBO in RenderStage::runCameraSetup() it checks the FBO 
status and it is returned as GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT. 
I basically copied the code from osgprerender.cpp so I don't understand why it 
is not working. Can someone take a look at my code and perhaps help me?

Thank you!

Here's the code:


Code:

osg::Camera* pCamera = new osg::Camera();

pCamera-setClearColor(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
pCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

pCamera-setProjectionMatrixAsOrtho(-halfWidth, halfWidth, -halfHeight, 
halfHeight, 1.0f, 11000.0f);

pCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

pCamera-setViewMatrixAsLookAt(gccXYZ, lookAt, upVec);

pCamera-setViewport(0, 0, imageWidthPixels, imageHeightPixels);
pCamera-setRenderOrder(osg::Camera::PRE_RENDER);

pCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
osg::Texture2D* pRenderTexture = new osg::Texture2D;

pRenderTexture-setTextureSize(imageWidthPixels, imageHeightPixels);

pRenderTexture-setInternalFormat(GL_RGBA8);
pRenderTexture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
pRenderTexture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);

pRenderTexture-setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
pRenderTexture-setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);

pCamera-attach(osg::Camera::COLOR_BUFFER, pRenderTexture, 0, 0, false, 0, 0);




Cheers,
Alex

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45519#45519





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Rendering an OpenSceneGraph scene in Qt QuickRendering an OpenSceneGraph scene in QML Rendering an OpenSceneGraph scene in QML

2012-02-16 Thread Preet
Hey all.

I have an OpenSceneGraph tree I'd like to have displayed in QtQuick.
I'd like the user to be able to interact with the scene where the
mouse can zoom/pan/rotate the camera, just like osgViewer allows. I
saw that there were a couple of examples (osgQtWidgets and
osgQtBrowser), but they're a little over my head.

I think the right way to start trying this is by starting with the
QtDeclarative model
(http://doc.qt.nokia.com/4.7-snapshot/qtdeclarative.html)... but I'm
not too sure where to go from here. Does anyone have any suggestions?

Regards,

Pris
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shader lookup table method: does lookup texture have to be bound to a separate geometry?

2012-02-16 Thread Alex Pecoraro
Hi Ethan,

All you should need to do is attach your osg::Texture to the osg::Stateset that 
you are attaching your osg::Program to and then you also need to add an 
osg::Uniform to the Stateset for the texture sampler that you use in your 
shader program to access the texture:


Code:
osg::ref_ptrosg::Geometry spGeometry = new osg::Geometry();
osg::ref_ptrosg::Texture2D spTexture = new osg::Texture2D();

osg::StateSet* pStateSet = sp-getOrCreateStateSet();
pStateSet-setTextureAttributeAndModes(0, spTexture.get(), 
osg::StateAttribute::ON);

//bind the sampler to texture unit zero
osg::Uniform* pSampler = new osg::Uniform(TextureSampler, 0);
pStateSet-addUniform(pSampler);



Thank you!

Cheers,
Alex

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45521#45521





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] multiple windows question

2012-02-16 Thread Pecoraro, Alexander N
What is the best way to have multiple windows with different views of the same 
scene graph? I took a look at the composite viewer example, but it has 
different views of the same scene graph with a single window. So not quite what 
I want.

Thanks.

Alex
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple windows question

2012-02-16 Thread Wang Rui
Hi Alex,

The composite viewer can have multiple views of different scene graph on
different windows. Setup the Traits of each separated window and set it to
each view's camera, and setup your scenes with the View::setSceneData()
method.

Wang Rui


2012/2/17 Pecoraro, Alexander N alexander.n.pecor...@lmco.com

 What is the best way to have multiple windows with different views of the
 same scene graph? I took a look at the composite viewer example, but it has
 different views of the same scene graph with a single window. So not quite
 what I want.

 ** **

 Thanks.

 ** **

 Alex

 ___
 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] osgvolume performance

2012-02-16 Thread Clement.Chu
Hi,

   I am using MFC to display osg volume data.  If the sample data is 30 * 30 * 
20 voxel, it is quite smooth on rotating the image on viewer.  If the sample 
data is 350 * 350 * 60 voxel, I can't rotate the image as smooth as before.  If 
I used higher voxel data, the rotation become very hard.  I would like to know 
if there is any way to improve the performance.  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to correct remove objects from scene graph and destruct they not in render thread?

2012-02-16 Thread Mikhail I. Izmestev

Hi,

To remove heavy in destruction objects (which will free large buffers 
and etc.) I use method like in DatabasePager - hold object references 
and pass they to another thread for destructing.


But there is one case which cause crash.

(root)
   |
  (some nodes)
 (...)
  ||
   (nodeA)  (nodeB)
  \/
\/
   (nodeC)
  |
(...)
  |
   (nodeD)

So we have nodeC with two parents, and in some moment we want to delete 
subgraph with nodeA.
We remove from graph parents of nodeA and hold it reference to be 
destructed later in another thread.
Another thread decrease reference for parents of nodeA and initialize 
destruction, so nodeA have no more references and it want to be deleted, 
it inform children about that and request to remove it from parent list.
But in render thread we still render main graph and it traverse nodeC, 
but someone like nodeD changed it's matrix, this process require to 
dirtyBound, and dirtyBound inform all parents about this and tries to 
walk backward for all parents and nodeA too.


So one thread iterate _parent vector, second thread change this vector, 
and in result CRASH!


Looks like DatabasePager affects this problem too.

What you can advice in this case?

Mikhail.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Unable to get osgViewerQt to work

2012-02-16 Thread Preet
Hiya,

I've been trying to run the osgViewerQt example. I have osg (including
osgQt) built from git. I'm able to use osgviewer without any issues.
When I try to run osgViewerQt, here's the output:

[preet@icarus osgviewerQt]$ ./osgViewerQt cessna.osg
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has
not been called
[xcb] Aborting, sorry about that.
osgViewerQt: xcb_io.c:178: dequeue_pending_request: Assertion
`!xcb_xlib_unknown_req_in_deq' failed.
Aborted

I'm using libxcb-1.8-2 with Qt 4.8 on Arch Linux (kernel v 3.2.5). The
Qt install should be fine as I can run other Qt applications without
any issues. I'd appreciate any advice...

Preet
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FBO render to texture help please

2012-02-16 Thread Sergey Polischuk
Hi

try to attach depth buffer
pCamera-attach(osg::Camera::DEPTH_BUFFER, GL_DEPTH_COMPONENT32)
or set
pCamera-setImplicitBufferAttachmentMask(osg::Camera::IMPLICIT_DEPTH_BUFFER_ATTACHMENT)

if you use stencil, you need to attach packed depth stencil buffer instead. If 
you dont need depth buffer on this camera you should disable depth test and set 
clear mask to color only, then it wont complain about missing attachment.

Cheers,
Sergey.

17.02.2012, 03:14, Alex Pecoraro alexander.n.pecor...@lmco.com:
 Hi,

 I'm attempting to create an osg::Camera that renders to a texture via a frame 
 buffer object, but it is not working. When I debug it I see that the after 
 attempting to bind the FBO in RenderStage::runCameraSetup() it checks the FBO 
 status and it is returned as 
 GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT. I basically copied the code 
 from osgprerender.cpp so I don't understand why it is not working. Can 
 someone take a look at my code and perhaps help me?

 Thank you!

 Here's the code:

 Code:

 osg::Camera* pCamera = new osg::Camera();

 pCamera-setClearColor(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
 pCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

 pCamera-setProjectionMatrixAsOrtho(-halfWidth, halfWidth, -halfHeight, 
 halfHeight, 1.0f, 11000.0f);

 pCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

 pCamera-setViewMatrixAsLookAt(gccXYZ, lookAt, upVec);

 pCamera-setViewport(0, 0, imageWidthPixels, imageHeightPixels);
 pCamera-setRenderOrder(osg::Camera::PRE_RENDER);

 pCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
 osg::Texture2D* pRenderTexture = new osg::Texture2D;

 pRenderTexture-setTextureSize(imageWidthPixels, imageHeightPixels);

 pRenderTexture-setInternalFormat(GL_RGBA8);
 pRenderTexture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
 pRenderTexture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);

 pRenderTexture-setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
 pRenderTexture-setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);

 pCamera-attach(osg::Camera::COLOR_BUFFER, pRenderTexture, 0, 0, false, 0, 0);

 Cheers,
 Alex

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=45519#45519

 ___
 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