[osg-users] FBO and Render to Texture
Hi, I have a scene to be captured by camera and render it to a texture. I am applying shaders to post process the scene and draw the scene as texture to a scene aligned quad. I need clarification regarding applying shaders and drawing the scene. Does it needs to implemented as camera callback. Kindly suggest me a suitable method Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60326#60326 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Performance issue regarding number of drawables
Hi, I need to clarify some doubts regarding texture size and number of drawables (Geometry) in a node and its effect on 'draw time'. For example i've a osg node, with a geode present inside a MatrixTransform. The geode contains 4 geometries (drawables), each drawable has a diffuse texture of size 512x512. Now the number of draw calls is 4. (correct me if i'm wrong). Now i'm converting the four 512x512 textures into single 1024x1024 texture (single material) in photoshop and apply it to the mesh in 3D Software (blender or 3D Studio Max) and exported it to OSG format. Now the geode in the osg file contain a single drawable with a single material and texture. I would like to know whether the four drawables or single drawable will consume more time to draw. How is the draw time affected when multiple UV's are applied to the mesh for the above case. ... Thank you! Cheers, Saravanan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=41468#41468 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadows : Creating multiple osgShadow::ShadowedScene
Hi, I'm rendering shadows using osgShadow::ShadowMap method. For large outdoor scenes with various objects, the rendered shadows look pixelated and self shadows on objects are not correct. I've increased the shadow map resolution to 4096, but still it is not correct. So i have created two shadowed scenes (osgShadow::ShadowedScene ) each having a separate light source and shadow map of 4096 resolution. The second osgShadow::ShadowedScene that is added (last) as a child to root node is getting rendered, while the first shadowed scene added to root is not getting rendered. Please provide some suggestions to get the shadows rendered correctly Thank you! Cheers, Saravanan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32093#32093 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadows : Creating multiple osgShadow::ShadowedScene
Thanks for the reply. But could any one explain me why it is not possible to add two osgShadow::ShadowedScene to the root node Thank you! Cheers, Saravanan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32115#32115 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Adding ShadowedScene as a child ?
Hi, I'm using osgShadow::ShadowedScene to render shadows using shadowmap. The shadows are rendered correctly. As my scene graph gets complex i want to add the ShadowedScene as a child to another node as shown below Code: ref_ptrGroup scene (new Group); //Main light source Vec3 lightPosition(0,0,3); LightSource* ls = new LightSource; ls-getLight()-setPosition(Vec4(lightPosition,1)); ls-getLight()-setAmbient(Vec4(0.2,0.2,0.2,1.0)); ls-getLight()-setDiffuse(Vec4(0.6,0.6,0.6,1.0)); //Shadow stuff!!! ref_ptrosgShadow::ShadowedScene shadowedScene = new osgShadow::ShadowedScene; ref_ptrosgShadow::ShadowMap sm = new osgShadow::ShadowMap; shadowedScene-setShadowTechnique(sm.get()); sm-setTextureSize(osg::Vec2s(2048, 2048)); sm-setTextureUnit(1); sm-setLight(ls); // Shadowed scene added as a child to scene scene-addChild(shadowedScene.get()); // Set scene data viewer.setSceneData(scene.get()); As shown above if i add the shadowedScene to scene and set the scene data to scene, the shadows are not getting rendered. If i set the sceneData to shadowedScene the shadows are rendered correctly. But the scene graph has some other elements such as ODE physics, shaders applied to some nodes etc., are getting disabled if i set sceneData to shadowedScene. Please provide some suggestions on how to get the shadow effect by by adding the shadowedScene as a child Thank you! Cheers, Saravanan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31885#31885 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disable maximize button in Win32 window
Hi, I've tried using the following code to disable the maximize button in the window. osgViewer::ViewerBase::Windows wins; viewer-getWindows(wins); osgViewer::GraphicsHandleWin32* hwnd = dynamic_castosgViewer::GraphicsHandleWin32*(wins[0]); HMENU hMenu = ::GetSystemMenu(hwnd-getHWND(), FALSE); ::EnableMenuItem(hMenu, SC_MAXIMIZE, MF_BYCOMMAND | (MF_DISABLED | MF_GRAYED)); The above code is not working for maximize button, but it works well for close button. Is there any other way to achieve this -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29947#29947 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgOcean] osgOcean unhandled exception error
Hi, We've compiled the osgOcean sucessfully and the osgExample runs well. When we quit the application, the compiler vc++ 2008 (express edition) shows an unhandled exception hxxp://img514.imageshack.us/img514/4452/unhandle.jpg Thank you! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=28348#28348 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with derived class from osg::Drawable
Hi, i derived a class from osg::Drawable. When ever i try to create an instance, the compiler is giving me the following error error C2259: 'TDrawable' : cannot instantiate abstract class 1due to following members: 1'osg::Object *osg::Object::cloneType(void) const' : is abstract 1C:\Program Files\OpenSceneGraph\include\osg/Object(80) : see declaration of 'osg::Object::cloneType' 1'osg::Object *osg::Object::clone(const osg::CopyOp ) const' : is abstract 1C:\Program Files\OpenSceneGraph\include\osg/Object(84) : see declaration of 'osg::Object::clone' Here is the actual code Code: class TDrawable : public osg::Drawable { public: // Constructor TDrawable() {} // Destructor ~TDrawable() {} virtual void drawImplementation (osg::RenderInfo renderInfo) const { } }; int main() { .. TDrawable TBarDraw; .. .. } Please help me to solve this problem Thank you! Cheers, saravanan[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=27599#27599 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org