Re: [osg-users] Render order of osgText and transparent object

2010-07-29 Thread Jimmy Lin
Hi, I tried the override flag, but makes no difference stateset-setRenderBinDetails(20,RenderBin, osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); by the way I am using osg 2.8.1 Thank you! Cheers, Jimmy -- Read this topic online here:

[osg-users] Render order of osgText and transparent object

2010-07-28 Thread Jimmy Lin
Hi, I am trying to display text which always stay on top. (but it's not a hud) So I turn off depth test on the text, and set bin number to 20 to make it render last. It only worked partially. The text rendered on top of all opaque objects, but not transparent objects. I tried both RenderBin

Re: [osg-users] Modifying scenegraph and update

2010-05-31 Thread Jimmy Lin
Hi, On relative issue. What if viewer-frame() is running on different thread that is different to the thread that modifies the scene graph. In that case I don't really have the control when is frame() get called. the modification can happen during the rendering time, which I guess is bad. I

Re: [osg-users] 3D HUD Elements

2009-09-23 Thread Jimmy Lin
Hi Andrew, You will need a separate camera for just rendering the 3D Axis. And implement a update callback for the camera. Something like this: Code: class AxisCameraUpdateCallback:public osg::NodeCallback { public: /** Callback method called by the NodeVisitor when visiting a node.*/

Re: [osg-users] CompositeViewer-addView/removeView problem

2009-08-24 Thread Jimmy Lin
Hi, I just found out when I create graphic context, if I don't set inheritedWindowData for the trait, then everything is ok. but if I use window form control's handle as inheritedWindowData and repeatly addView/removeView 20~30 times, then I start to have memory leak. problem. Does anyone

[osg-users] CompositeViewer-addView/removeView problem

2009-08-23 Thread Jimmy Lin
Hi, I am using CompositeViewer in my app to have multiple view. I create a new camera/view/graphic context ...etc every time a user created a window(view) and add the osgViewer::View to CompositeViewer. And remove the view from CompositeViewer if user close the window. (I didn't delete the

Re: [osg-users] 3D HUD Elements

2009-08-19 Thread Jimmy Lin
Hi, Here is the code of frame() Code: void ViewerBase::frame(double simulationTime) { if (_done) return; if (_firstFrame) { viewerInit(); if (!isRealized()) { realize(); } _firstFrame = false; }

Re: [osg-users] 3D HUD Elements

2009-08-18 Thread Jimmy Lin
Hi Robert, Looking at the CompositeViewer::updateTraversal(), it seems the update callback is called before update the view matrix, which mean my slave camera is using master camera's previous view matrix. But I think it's allright in my case to have 1 frame out of sync. Just want to know if

Re: [osg-users] 3D HUD Elements

2009-08-17 Thread Jimmy Lin
Hi Robert, My first attemp was doing something similar to osghud, it does successfully display my 3D axis as hud, but it won't rotate when the view changes. Basically I want something similar to a hud but changes with view/camera. or a 3d model always stay in the same position relative to the

Re: [osg-users] Reset Viewer and Context question

2009-08-17 Thread Jimmy Lin
Thanks Robert, Sorted now. Cheers, Jimmy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16359#16359 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] 3D HUD Elements

2009-08-17 Thread Jimmy Lin
Hi, I think I got it now. I combine both hud and callback approach. I created a slave camera similar to the one in the example, then add a update callback to it. In the callback I update the view matrix of the slave camera relate to the master camera's view matrix. so the views are basically

Re: [osg-users] Reset Viewer and Context question

2009-08-16 Thread Jimmy Lin
Thanks Robert, I will try that. By the way, when I remove an object from the scene graph by remove the PAT above the model, do I need to call releaseGLObjects on the model node as well? or just the PAT? I use the model to create mutiple instance (use mutiple PAT) in the scene. If one of the

Re: [osg-users] 3D HUD Elements

2009-08-16 Thread Jimmy Lin
Hi, Does anyone has solution for this? I am doing a simliar thing as well. I tried to update my 3D Axis object with camera's position by using CullCallBack, but I have flickering problem with mutiple view/camera. It seems it's too late to update the node position/matrix at the culling stage,

[osg-users] Reset Viewer and Context question

2009-08-12 Thread Jimmy Lin
Hi, In my app, I allow user to restart the scene by - keeping all the nodes but disconnect all nodes from the scene root node - recreate new graphic context and composite viewer. - assign the root node to the new viewer. If the user create some object which was created in last session, I will

Re: [osg-users] [HELP] Cull time in stats?

2009-08-10 Thread Jimmy Lin
Hi, Regarding of having a flat scene graph. Does it matter if the whole scene will always be seen? Would it still improve the performance if I balance the scene graph more? Thanks for the advice, I will try them. Cheers, Jimmy -- Read this topic online here:

Re: [osg-users] [HELP] Cull time in stats?

2009-08-10 Thread Jimmy Lin
Hi, Thanks for clear things up for me, it does help alot. To reduce the draw time, you need to group geometry so that data is uploaded to the card in good-sized chunks. What will be a good-sized chunks? The bigger the better? My scene are contains numbers of models which consist of

Re: [osg-users] [HELP] Cull time in stats?

2009-08-10 Thread Jimmy Lin
Hi, Thanks alot, J-C! Cheers, Jimmy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16064#16064 ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] [HELP] Cull time in stats?

2009-08-09 Thread Jimmy Lin
Hi, I would like to know what is the Cull time in the osg stats (the blue bar) means. I notice it changes together with draw time when I zoom in/out of my scene. I tried to disable the camera cull by setting NO_CULLING for the camera, but it didn't remove the cull time at all. It looks like