Re: [osg-users] looking for a terrain database building toolchain
Hi Raizel Proland Looks pretty interesting. Is there an exising OSG Integration available somewhere? Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69781#69781 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] WordEditor, TerraGear, FlightGear --> OSG ??
Hi there I was just reading about the capapilities of terrain building using the tools that go with the flightgear. There is TerraGear (http://wiki.flightgear.org/Using_TerraGear) that can be used to generate full world scenery based on elevation, textures and shapefiles (similar to VPB, I guess). Then there is the WorldEditor (http://wiki.flightgear.org/WorldEditor), which allows in particular to build airports. Especially the WorldEditor looks interesting for me, since I'm looking for a tool that allows me to generate airports using all the details that appear there (taxiways, runways, markings, lightings, etc.) Is there anybody that achieved to bring WorldEditor and OSG together? A way to convert the DSF Files for OSG? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69750#69750 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] looking for a terrain database building toolchain
Hi Martin How do you bring the TerraGear scenery to OSG? I was just reading about TerraGear and its capabilities of generating airports and stuff. But its all in the the proprietary DSF file format... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69749#69749 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Imporstor and Shadows
Hi there I have a scenario with around 100 cars driving around in my scene. I wondered if I could gain some performance by using impostors to simplify the rendering if this high-poly objects. For now I have no experience with impostors, and I don't know if they integrate well with Shadow (VDSM). Anybody out there used these two techniques along side? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67252#67252 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Speed of Shaders
Hi there I have experienced that generally as soon as I use shaders, my DRAW time starts to increase significantly, and this even if I just reimplement the fixed function pipeline basic functionality. I wonder if some out there make the same experiences. Either it is my poor shader programming (i know about if's and branches that kill performance) or is there really a price for the added flexibility? I'm running a GTX TITAN so usually there is plenty of power... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66719#66719 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] What's the difference between put rttcamera under root node and viewer?
Hi silver In our project we have a driving simulator using rear view mirrors. And we had the same issues about what should be seen in the mirror and what in the main view. First we had no shadows and light effects in the mirrors, but after some time, we figured that light effects are essential in the mirrors to, but shadows are to expensive... So we ended up having the following scene graph: RootNode - PostProcessingNode - MainView PreRenderer - VisualRootNode - ShadowedScene - Terrain - Models - Particles - Environment (Sky, Clouds) - Common PreRenderers (LightMap, Tracks, etc) So in other words we defined an VisualRootNode that holds all the Content that is common for every viewer (main or mirror). The upper most RootNode contains all the Postpro stuff and Prerenderers that are only for the main view. Then to render the Mirrors we created PreRender Cameras that are not owned by the scenegraph but share the same GraphicsContext. This is an important Point. They work like the StatsHandler or HelpHandler with their apropriate PostRender Cameras, which never appear in a scene graph but still the use the main GraphicsContext... These cameras render the VisualRootNode Content to a texture, and this texture can then be applied to a mirror geometry somewhere in our car model. So there is a decision you have to take what you want to display in the main view and what in the mirrors. I hope this gave you some ideas. Now I have a question for you: How did you integrate SpeedTree? Can you provide your implementation? I am working on it, but stuck somehow.You can also write to me personnaly... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65803#65803 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Stats Handler showing prerender cameras
Hi all, Currently the statshandler can show the main camera plus slave cameras. The available cameras are fetched via viewer->getcameras method. It would be great if the list of interesting cameras could be customized to show for instance an interesting prerender camera. Adding it via customstatline is kindof stupid since the whole functionality is already there... Anybody else had this need? I think of writing a submission... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65798#65798 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VDSM and shadow of 3d Tree
Hi all Until now we had trees made of billboards in our terrain, and used VDSM as a shadow algorithm. Shadows of billboard trees are ok on the ground, but the billboard itself is always half lit and half in shadow which is not very nice. So I decided to put trees made as a 3d model with solid trunk and branches and leafs made out of surfaces with alpha texture. The trees look nice, also the shadow on the ground, but the GPU time of the shadow camera literaly explodes. Trees with dense leafs and therefore lot of alpha overdraw is a huge performance killer. But probably I missed something, put bad states or stuff. I imagine I am not the only one that is using VDSM to shadow a terrain and using 3d tree models. Do you have some hints or ideas for me? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65541#65541 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Speedtree Implementation
Hi all Meanwhile SpeedTree V7 is available. But unfortunately there is still no really good implementation available of how it can be integrated tightly into OSG. So this is a call for all the users of SpeedTree out there. Please post your experience and sample code and as much of your knowlegde as you are willing to share to make this a place where SpeedTree integrators can find help. Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65540#65540 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] SpeedTree 6.0 integration
Any examples available meanwhile? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65537#65537 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] tree[d] Generator
Hi all I used to generate trees for OSG using a tool called tree[d]. It comes from a website called www.frecle.net, but this site was updated and there is nomore reference to the tool. The only way to get it is via a cached website: https://web.archive.org/web/20130915030534/http://www.frecle.net/index.php?show=treed.about Does anybody else use(d) this tool, or know any of the developers, access to sources, etc? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65307#65307 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to add shadows to deferred shading?
Hi Sebastian I read in lot of posts that you have experience with deferred rendering in osg. Could you share some of your insights and probably even samples or code snippets that could bring some more light into this topic? I'm basically interested in: - construction of G-Buffer - integration of Shadow (VDSM), maybe even for multiple lights? - choice and integration of postprocessing framework - antialiasing method / shader It would be of so much help! Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65140#65140 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lagging between main camera MV and prerender camera
Hi all I solved the problem! Actually the mistake I made is that the uniform holding the texture-matrix was added to the stateset of the root node. Instead I had to dive into the ShadowedScene, find the stateset of the shadow receiving scene part and add the matrix (and the prerendered texture) there. Now everything is working fine... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62303#62303 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lagging between main camera MV and prerender camera
Hi Robert I do all my matrix calculations in the cull, which is renderTraversal. I don't understand why the camera matrices shouldn't be correct at this time... Code: void EfxTracksPrerenderer::ViewData::cull(osgUtil::CullVisitor* a_cv) { osg::NodePath l_NodePath = a_cv->getNodePath(); osg::Node* l_Root = l_NodePath.front(); osg::StateSet* l_StateSet = l_Root->getStateSet(); osg::Camera* l_MainCamera = a_cv->getCurrentCamera(); osg::Matrixd l_MainViewMatrix = (*a_cv->getModelViewMatrix());//l_MainCamera->getViewMatrix(); osg::Matrixd l_MainProjMatrix = (*a_cv->getProjectionMatrix());//l_MainCamera->getProjectionMatrix(); osg::Matrix l_ViewMatrix; osg::Matrix l_ProjMatrix; osg::Vec3d eyePos, centerPos, upPos; l_MainViewMatrix.getLookAt(eyePos, centerPos, upPos); // calculate the eye dir vector osg::Vec3 eyeDir = centerPos - eyePos; eyeDir.normalize(); // do post perpspective setup of view and projection matrices // here... m_Camera->setProjectionMatrix(l_ProjMatrix); m_Camera->setViewMatrix(l_ViewMatrix); // compute the matrix which takes a vertex from local coords into tex coords // will use this later to specify osg::TexGen.. osg::Matrix MVP = m_Camera->getViewMatrix() * m_Camera->getProjectionMatrix(); osg::Matrix MVPT = l_MainCamera->getInverseViewMatrix() * MVP * osg::Matrix::translate(1.0,1.0,1.0) * osg::Matrix::scale(0.5,0.5,0.5); m_TextureMatrix = MVPT; m_Camera->accept(*a_cv); } As you see above, I tried with getCurrentCamera and also getting the matrices from the CullVisitior, which gives identical results. So I kind of don't understand the issue between updateTraversal and renderTraversal. I'm probably missing something... I do all my calc in Cull. The only potential problem I could imagine is because I have a cull thread and a parallel draw thread, and the matrices are not correctly used? I out of ideas...[/quote] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=62055#62055 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Loading in background without displaying
Hi Sebastian You you provide your own derived class of DatabasePager and overload the method addLoadedDataToSceneGraphLocal. Thats the place where the databaseRequest->loadedModel is added to the scene. Afterwards, the model is set to zero to notify the completion of the databaseRequest. You would have to make sure that the models are not added to the scene here aslong as some condition is not met, and that the requests remain pending... Hope this gives you some inspiration... Regards Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59513#59513 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Calculate bounds of geometry in culled frustum
Hi there I have a huge scene and would like to know what geometry is contained in view frustum. Doing via a ComputeBoundsVisitor is not an option, there's way to much to traverse. I was wondering of doing it by examining renderstage/renderleafs but there are too much objects contained. I want to exclude objects like overlays, skybox etc, but renderleafs only reference to drawables, so it's hard to filter it out. Does anybody have an idea of how to examine renderleafs and calculate frustum BBx correctly? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59245#59245 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] SpeedTree 6.0 integration
Hi Michael I wonder if your SpeedTree and terrain rendering is doing ok? We are about to integrate SpeedTree and we use paged/tiled terrain aswell. Can you provide example code of how you integrated the SpeedTree classes and shaders into OSG? and also share some insights on the issues you faced? I would be grateful! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58683#58683 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgDesigner or other Editor
Hi all I know this topic comes from time to time. But it is a real pitty that there seems to be no good Editor that allows you to modify .osg files. I know that I can use blender or similar, but I when I really need to modify stuff in the scenegraph and classes that are proper to osg, then this is a real pain. I did another search today along side osgEdit osgscenemaker and similar, and I found osgDesigner. I was able to load a model, but couln't find a way to modify properties... - Is there anyone with experience with osgDesigner? - What tool do you use to modify .osg files? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58382#58382 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] force fixed function pipeline
I chose the following solution: by knowing that binding program 0 (zero) doesn't give 100% correct results with all drivers, I created a fragment program that simply passes the incoming color to the output. Like this I was sure that at least the vertex part of the pipeline is using fixed function. That solved my problem and I always have predictable results. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58245#58245 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fixed-function multi-texturing
As far as I know, NVIDIA for instance left the Maximum number of multitexturing Units for the fixed function Pipeline at 4 also for more current Cards and Driver Versions. They say that for more textures you have to use shaders. I had the same issues a couple of weeks ago and had to Switch to shaders on a pretty old Project... which was not my prefered solution but there was no way around... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58184#58184 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] force fixed function pipeline
I know setting an empty program is the way this used to be done. And it seemed to work for some time. But in my case it doens't. In the apply method of osg::Program, a call to glUseProgram(0) is issued when the program object is empty. According to http://stackoverflow.com/questions/13546461/what-does-gluseprogram0-do this is not a reliable way of falling back to FFP, and it seems to depend heavily on opengl profile and probably also on the driver... Are there any alternative solutions? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58183#58183 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] force fixed function pipeline
Hi Robert and all I have a main shader for my scene graph. Then I have some parts of my loaded models that I want to explicitely render with the fixed-function-pipeline (FFP). In osg 3.1.5 I was able to modify a particular stateset by writing a_node.getOrCreateStateSet()->setAttributeAndModes(new osg::Program, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED); Like this, the main shader was ignored for the the node and underlying children and the FFP was used. I don't know why but in OSG 3.2.0 this doesn't work anymore. I tried with osg::StateAttribute::OFF/ON etc. I just cant switch back to FFP . 1. What is the reason this behaviour changed? 2. What is the correct way to bypass/disable a shader at some particular point in the scene-graph? Thanks for help! Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] sorting in renderbin
Hi all I have a custom renderstage, that I use for prerendering of a sub-scenegraph. The drawables within are stacked along the y axis (up) to simulate priority, the projection is done as view-from-top. The highest-y drawable is supposed to be drawn last (topmost). Since I look down on from above, the y axis is also equivalent to the scene depth, so I tried to achieve this by calling _readRenderstage->sortBackToFront(); right before _readRenderstage->draw(*drawState, previous); but this didn't bring any sorting at all. The drawables are all drawn in the order they are added to their parent geode. I have a depthbuffer, depth test is on etc. What am I missing? Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Post perspective space texture mapping
Is there nobody who has knowledge of how to implement post perspective texture matrix, like used in perspective shadow map (PSM) ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57877#57877 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Post perspective space texture mapping
Hi there I'm doing projective texturing of a texture created in a prerender pass. In fact something similar to OverlayNode, using a vertical projector (like vertical light source if we were talking in shadow language). Everything works fine so far. Now I want to add perspective projection in order to reduce aliasing effects. According to lots of documents (gems, tuwien, etc), the way to go is using post perspective space or light perspective space. I know there is VDSM and and also some part of (not working) implementation in OverlayNode, but frankly the implementation is quite heavy. I just need a simple guide of how to go add perspective projection. Can anybody guide me? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] TexGen limitations
Interesting. So could this be a bug in osg? Did you try to query GL_MAX_TEXTURE_UNITS and check if it says 4 ? I wonder if this value does not only mean maximum number of multitexture units, but also that only the lowest 4 units are capable of beeing used for multitexturing! This would kind of be an answer... Wojtek wrote: > Hi Daniel, > > I confirm your observation. I, however, do not agree that its a TexGen > problem. Frankly I do not know what it is, and I had no time to investigate, > but I think its maybe relate to TexEnv settings. I only made a following > test: I zeroed a spotlight texture (memset( image->data(), 0, > image->getTotalSizeInBytes() );). In this case no light should be cast on > terrain no matter if texgen is set or not, because texcoords should not > matter if texture is black everywhere. Yet the problem is the same. For > stages above 3 terrain is brightly lit. So it looks to me like an issue with > applying or blending the texture on stage 4 and more... Its not a problem of > coord generation its the problem of texture not used correctly... > > > Cheers, > Wojtek > > > > 2013/12/16 Daniel Schmid < ()> > > > Hi Wojtek, would you mind doing the simple test with the sample program > > osgspotlight and the modifications I documented? I wonder if you get the > > same different results as soon as you use texture units from 4 and above. > > > > Cheers, > > Daniel > > > > -- > > Read this topic online here: > > > > http://forum.openscenegraph.org/viewtopic.php?p=57677#57677 > > (http://forum.openscenegraph.org/viewtopic.php?p=57677#57677) > > > > > > > > > > > > ___ > > osg-users mailing list > > () > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) > > > > > > > > > -- > Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57679#57679 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] TexGen limitations
Hi Wojtek, would you mind doing the simple test with the sample program osgspotlight and the modifications I documented? I wonder if you get the same different results as soon as you use texture units from 4 and above. Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57677#57677 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] TexGen limitations
The mistery is solved. On Nvidia cards, a maximum of 4 Multitexture Units are allowed. you can simply query this value by calling glGetIntegerv(GL_MAX_TEXTURE_UNITS, &iUnits); So it looks like using TexGen is therefore limited to the lowest 4 Textureunits, which is not very logical. Actually if 4 units are allowed, they should be able to come from any of the available texture units... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57675#57675 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] TexGen limitations
I made the test now with a GTX 580 and a different driver version, and I still have the same issues! Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] TexGen limitations
I have an Nvidia GTX TITAN with current drivers. Sure this could be a driver issue... but I doubt it with such current hardware. I would be curious if you Robert or anybody could quickly make the test according to my previous post and just tell your results. I know it sounds silly for such a basic issue, but this is what community is for... :) Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] TexGen limitations
Hi there I noticed a limitation in TexGen. It looks like osg::TexGen can only be used up to a texture unit between 0 and 3, starting from texture unit 4 to 7, osg::TexGen have no more effect. You can easily test this with the osgspotlight.cpp example by changing the following lines: Line 249: xform->addChild(createSpotLightNode(osg::Vec3(0.0f,0.0f,0.0f), osg::Vec3(0.0f,1.0f,-1.0f), 60.0f, 0, 1)); replace the last number (1). Line 275: root->setStateSet(createSpotLightDecoratorState(0,1)); replace the last number (1). If you use numbers between 0..3, everything works fine, 4 and up doesn't work anymore. Where does this limitation come from? Is this OSG or opengl? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Forum error
Hi all The forum seems to be out of service. Is there anybody working on this issue? The mailing list is gread but in order to look up and search, I still prefer the forum... Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] remove a view from a CompositeViewer
Hi gambr I had similar issues when adding/removing views from composite viewer. Finally my crashes were solved by stopping and restarting Threading ! The code then looks like this: Code: // adding m_Viewer.stopThreading(); m_Viewer.addView( a new view pointer ); m_Viewer.startThreading(); // removing m_Viewer.stopThreading(); m_Viewer.removeView( an existing view pointer ); m_Viewer.startThreading(); Regards Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57572#57572 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Adding/Removing objects to scene graph
Hi all I searched the forum already but didn't find anything that pointed me further. My question is the following: When is the correct moment of removing/modifying objects from the scenegraph? In my multithreaded context, cull and draw run parallel, and in my understanding (and according to code) event/update also run parallel to the draw thread. And I cannot put all my objects as data variance dynamic only because I want to be able to remove them. How does Database pager resolve this problem? LOD and PagedLOD are not DYNAMIC, but still he is able to add/remove nodes savely. Are there other ways/moments to do this? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SharedStateManager performance issues
@Robert, would it be possible to call Code: if (osgDB::Registry::instance()->getSharedStateManager()) osgDB::Registry::instance()->getSharedStateManager()->share(databaseRequest->_loadedModel.get()); in the db loading thread scope instead of during the scene update? This would not resolve the problem of lengthy share operations, but at least would move the time consumption into the db thread instead of the scene-update... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56493#56493 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] SharedStateManager performance issues
Hi there I have a tiled DB that is loaded using the DatabasePager. Everything ok and fully performant. Now I generate some custom drawables and attach them to the tiles sub-scene graph. Suddenly I notice a heavy load problem (stutter) in the moment when the node is being added to the main scene. Actually I figured out that during the call addLoadedDataToSceneGraph of the DatabasePager, the SharedStateManager calls its share method on the loadedModel. Time measurements brough forth that his is actually where a lot of time is spent (40-50ms) which gives me a frame loss. Now I'm about to debug the SharedStateManager to figure out what kind of Data in my Stateset or Textures causes this lengthy opereration. Does anybody have a clue what generally makes the SharedStateManager use so much time? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56492#56492 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] What tools do you use
Sounds interesting to me. I would be glad if you added me to the list of beta testers. When will public beta tests be starting? Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56420#56420 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] What tools do you use
Hi all out there I am trying to build content for our OSG-based driving simulation engine. I have some complete terrains (terrain, buildings, streets, vegetation, etc) that were build (externally) on a terravista based toolchain. I was searching the forum to find out what tools people use to generate such content showing urban or natural areas, with cities, villages etc. There are some discussions about similar subjects... There are some osg based tools like osgEdit (outdated), osgExplore (view only?), Remo3D (commercial, but focused on models, not terrain), Blender (export issues?), etc. I thought it would be worth a thread where people just line up their tool chain and what they use for what, starting from generating terrain, to placing roads, buildings, vegetation, optimizing, exporting, etc. There you go! Regards Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56418#56418 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reflection / refraction clip plane
Hi all I was unsuccesful with the ClipPlanes, so I decided to write a Vertex/Fragment Shader pair that handles the clipping by doing a fragment abort upon testing the vertex world height with a clipping height uniform. Like this I was finally able get the control I wanted. Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56405#56405 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reflection / refraction clip plane
Hi all Here comes my follow up. As you can see in the code snipped above, the clipping plane of the refraction camera is looking in the opposite direction. Since the clipping is done on the graphics card, and the primitives are still in world coordinates, the refraction clipping plane has to be multiplied with the transposed camera matrix. Code: // this is what happens in cull: osg::Matrixd l_ViewMatrix = l_MainCamera->getViewMatrix(); osg::Matrixd l_ProjMatrix = l_MainCamera->getProjectionMatrix(); osg::Vec4d l_PlaneNormalCoeff(0.0, 0.0, -1.0, -m_Height); osg::Matrixd l_CameraMatrix = l_ViewMatrix * l_ProjMatrix; osg::Matrixd l_InvCameraMatrix = osg::Matrixd::inverse(l_CameraMatrix); double* l_MV = l_InvCameraMatrix.ptr(); osg::Matrixd l_InvCameraMatrixTransposed; l_InvCameraMatrixTransposed.set( l_MV[0], l_MV[4], l_MV[8], l_MV[12], l_MV[1], l_MV[5], l_MV[9], l_MV[13], l_MV[2], l_MV[5], l_MV[10], l_MV[14], l_MV[3], l_MV[6], l_MV[11], l_MV[15] ); l_PlaneNormalCoeff = l_InvCameraMatrixTransposed * l_PlaneNormalCoeff; m_RefractionClipPlane->setClipPlane(l_PlaneNormalCoeff); The problem I encounter is the following. All the stuff doesn't have any effect. The fact of setting a new Clip Plane in the RefractionClipPlane object doens't do anything. So I end up having a clip plane for the reflection camera and a clip plane for the refraction camera with both show into opposite directions . According to the theory, this should work... I read something about Positional State attribute and that there are issues when setting multiple clipping planes. I don't get the point there, and maybe need some more insight (say explanation). I thought by having two distinct render cameras, they should be able to have their own clipping planes? Regards Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56392#56392 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow culling for big geometries
Hi Robert I checked my viewers camera. I set it on DO_NOT_COMPUTE_NEAR_FAR explicitely. I noticed that the shadow camera uses COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES ... But there is one thing I don't understand. I set the nodemask on this particular geometry to NOT shadow cast. Why is it still taken into account? it shouldn't be used AT ALL!... Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56207#56207 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadow culling for big geometries
Hi all I use VDSM of osg 3.2.0. In my current project (terrain rendering for driving simulation), I want to render the surface of a big lake. Until now it was composed of a bunch of polygons (~40), that described its surface as a flat plane withoug any animation, just showing a simple texture. Not very appealing so far. Now I converted my lake into a mesh of polygons (500k) that are all part of the one geometry object. Now I observed that my Shadow culling time exploded up to 10ms of frame time, heavily depending on my viewing angle. I even set the nodemask of my lake object to be excluded of shadow casting. How come that huge but static geometries are so heavy in shadow culling? Can anybody point me in the good direction to optimize this? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Create Texture coodinates for modified geometry
Hi Laurens and Robert This is exactly what I was looking for... @Robert, I think this is the barycentric method you were talking of... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56173#56173 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Compar polygons in Geometry
Hello all I have geometry with vertex arrays that contain triangles that are duplicated. They appear once as normal polygons, and once using the same vertex points, but with the normal pointing in the opposite direction. So in the same array I have polygons that cover the exact same surface but they are oriented in the opposite direction. Now I want to write a visitor that traverses these triangles and offsets each of them in their appropriate normal direction, in order to make them no longer sitting on top of each other. No I have a hard time to figure out if there is already some classes in osg that help me do such thing, or how I should accomplish that. I'm not very used to PrimitiveSet and this stuff, so can somebody help me? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PointSprite Texture orientation
Hi all I use pointsprites to simulate precipitation (rain/snow). The implementation is completed and works very well. Now the end user decided to rotate the viewport about 90 degrees. The problem is now that the pointsprite texture coordinates to not take into accout the rotated viewport and the raindrops (small lines) are transversly and are not oriented in their falling direction. I tried to set a TexGen object in the stateset but what arguments do I have to set? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53959#53959 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set attribute shaders vars into ShadowedScene.
Hi Dario For this case you have to derive your own shadow class from MinimalShadowMap, in order to get access to the protected statesets and programs. That's the way I did it. Regards -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53446#53446 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] lightmap generated from lightcone geometry
Hi all I have a number of modeled lightcones that simulate the illumination area of spotlights in my scene. These lightcones allow me to render lightshafts very nicely. Now I want to render the impact of the light on the lit geometry, known as lightmap. imagine a street lamp and the floor area beeing lit. I couldn't find any good documentation about rendering lightmaps. An important note, some lights may move, so rendering is on a per frame basis, no pre-baked lightmap. Anybody has some more experience? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53406#53406 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] prerender camera and cullvisitor
Hi Robert Its not the ModelView Matrix of that I need, it is the ViewMatrix, since I want to calculate the current eyepoint/direction in world coordinates. Or is there a way to get to eyepoint by using the ModelView Matrix of the cullvisitor? I'm not that strong in matrix math... Regards Danoo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53336#53336 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] prerender camera and cullvisitor
Hi all I have a prerender RTT camera that renders part of my scenegraph, and i set reference_frame to RELATIVE_RF, the view direction of the camera is identical to the main camera. The output of the prerender camera is then applied in a postprocessing step. Everything works fine and is displayed correctly. Now I added uniforms to each node of the sub scenegraph of this prerender camera, in order to have a per node control of a particular property in the shader. To update the uniform, I installed a cullcallback on each node, to update the particular uniform. So far still so good. The problem is, that in my calculations of my uniform, I need the ViewMatrix of the camera in world coordinates. When I get the viewmatrix of the current camera (which is the prerender camera) in my cull visitor, it get a identiy matrix. I guess this is due to the fact that this camera is child of the main camera. How can I calculate the correct ViewMatrix ? Regards Danoo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?
Hi wernerM Could you please provide some example code of how you are doing things? I have a prerender camera rendering part of the scene which is applied in a ppu unit over the main scene. Are both background and hud text missing? For hud text please have a look all the statistic and help handler, they show very vell how do to huds... Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53332#53332 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU and wireframe
Problem solved, my last posted solution is working. It was a compile problem... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53224#53224 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU and wireframe
In the method Procesor::init(), it added the following code: Code: osg::PolygonMode* l_Polymode = new osg::PolygonMode( osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL ); mStateSet->setAttributeAndModes(l_Polymode, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); This doesn't change anything when 'w' is pressed... I don't know if this is a osgPPU issue? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53223#53223 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] osgPPU and wireframe
Hi all Maybe you noticed that when using osgPPU and pressing 'w' to change the polygon mode to wireframe, the screen goes black, because only the screenquad is rendered in wireframe, but the actual scene is not rendered anymore. Does anybody know how to change this? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53207#53207 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] potential deadlock in viewer threading
Hi Robert I discovered an issue with multithreading. Consider the following Code in ViewerBase::startThreading: Code: void ViewerBase::startThreading() { if (_threadingModel==CullThreadPerCameraDrawThreadPerContext && numThreadsOnStartBarrier>1) { Cameras::iterator camItr; for(camItr = cameras.begin(); camItr != cameras.end(); ++camItr) { osg::Camera* camera = *camItr; if (camera->getCameraThread() && !camera->getCameraThread()->isRunning()) { OSG_INFO<<" camera->getCameraThread()-> "startThread();[/b] } } } for(citr = contexts.begin(); citr != contexts.end(); ++citr) { osg::GraphicsContext* gc = (*citr); if (gc->getGraphicsThread() && !gc->getGraphicsThread()->isRunning()) { OSG_INFO<<" gc->getGraphicsThread()->startThread() " startThread();[/b] // OpenThreads::Thread::YieldCurrentThread(); } } _threadsRunning = true; OSG_INFO<<"Set up threading"
[osg-users] transparent geometry refuses to write to depth buffer
Lets put it this way round: my pre-render camera has a depth and a color buffer. My geometry has a vertex and fragment shader that fades the geometry using alpha. I have the desired result in my color buffer but my depth buffer remains empty. How can I force geometry to always write depth, no matter the alpha? Is there a difference in putting the blending and alpha funcs in the geometry stateset or putting it in the camera stateset? Thanks for help Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PRE_RENDER ignores depth buffer?
Hi all I have a NESTED_RENDER camera that 3 RTTs plus a Depth texture. Works fine. Now I added a PRE_RENDER camera rendering part of geometry to a texture and a Depth texture. This works aswell except that the depth texture remains empty/untouched. Is there an issue with PRE_RENDER cameras? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] Rendering scene geometry in PPU
Hi all I have some light cones that simulate the glowing of a light. All the light cones are in one group in the scene graph, and they have their apropriate shader in the group stateset to get the desired effect. Now my goal is to render the cones in a osgppu postpro step. I want to have them rendered over the normal scene. So my intention is to write a UnitInOut class that can take a osg::Group node and render it over the existing input texture. This is actually very close to the UnitText class, instead of a osg::Text I have a small sub scene graph. One issue is the correct view and projection matrixes, which must no longer be related to the screen quad, but instead must be the same like the main scene. I hope you get the idea... I started to write the class, but I'm stuck with applying the correct stateset and matrixes at the correct time. Can anybody help me? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52949#52949 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Cheaper way to implement rendering-to-texture and post-processing pipeline?
With all postprocessing solutions I checked out so far, they all have the same issue: they lack support of multiple viewports (for instance using CompositeViewer) and they all need some additional elements (camera, quads, etc) being added to the scene graph. My expectation of a postprocessing framework is this: - It doesn't impact the scenegraph, since it is something that happens after the whole geometry is rendered, therefore it must be completely separated. - It must be compatible with multiple views Why is there no postprocessing framework that can be attached/inserted into a FinalDraw or PostDraw call of the main camera? This is the place I expect postpro to happen! Right now I'm using osgPPU and I modified it to work with CompositeViewer and multiple views, but still I'm forced to have one postprocessing camera (including its whole unit pipeline) per view stored in the scenegraph. Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52683#52683 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Sharing some screenshots of my present work :-)
Hi Wang I'm using your VDSM implementation in my project, and also Silverlining for atmosphere simulation. Did you implement your own tone-mapping (HDR) or do you use Silverlining in the standard way? In case you use your own tone-mapping, I would be interested in some sample code, because I didn't manage to achieve something that was usable... Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52236#52236 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer
Hi Robert I tried with dynamic_cast and also with reinterpret_cast. Both didn't give me the correct pointer. Could it be that with multiple inheriance it is not working correctly? CullVisitor is derived from NodeVisitor AND CullStack... Finally I created my own map of the following type: typedef std::map ViewMapType; I added the observer to the camera. So as soon as a camera is deleted (view removed), I get notified. Then I iterate through the list above to find out which CullVisitors are related to the camera (can be multiple). Finally I remove these cullvisitors entries from _viewDependentDataMap. Maybe not the most beautifull solution, but this way I was succesfull. Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51649#51649 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer
Hi Robert Sounds like a good idea to use observers. I just did the following: - Derived my customized ViewDependentShadowMap class also from Observer. - override the createViewDependentData method to add this-ptr to CullVisitors observers - implemented Observers objectDeleted method to remove the CullVisitors map entry from _viewDependentDataMap. Now I noticed that the CullVisitors pointer that is passed into objectDeleted method does not match any of the CullVisitors that are used for culling, therefore the entry in the map is never found and never deleted. This is strange... Next I try to store the pointer to the View object and add an observer onto it. Maybe I have more luck... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51641#51641 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ViewDependentShadowMap memory leaks with CompositeViewer
Hi Robert, Wang Rui, and all I discovered a great gpu memory wasting in ViewDependentShadowMap. I use CompositeViewer with dynamically adding/removing view, and one global scene graph for all views. ViewDependentShadowMap uses ViewDependentData to store the shadows etc. These Data are stored in a map (ViewDependentDataMap) by CullVisitor. The problem is now, that for each new View that is added to CompositeViewer, a new entry is stored in this map, which is never removed! The removal scenario is not prepared at all. I can add/remove a couple of times a viewer, but then the GPU memory is full and strange effects appear. Right now I have no solution for this. This issue is actutally a serious problem for all view dependent data storage techniques. You have to make sure that when a view is no longer used, all associated data is released aswell!!! Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51636#51636 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] CompositeViewer recreates textures upon adding View
Hi there I run a CompositeViewer, and I can add views dynamically, and they all share the same scene and the same graphicscontext. Now I have the following issue: As soon as a view is added, it looks like all the texture objects are invalidated and/or recreated. In my log I have tons of lines saying: Created new 0x7f07c4cd2230 TextureObject, _numOfTextureObjects 19 Created new 0x7f07dc2028c0 TextureObject, _numOfTextureObjects 391 Created new 0x7f07dc2028c0 TextureObject, _numOfTextureObjects 392 During all this time, the render loop is blocked. I don't understand why these texture objects must be recreated, since it is all there already. Can anybody explain this behavior? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] Objects not released
Hi all I'm trying to track down some memory leaks in my application which uses osgPPU. I noticed a difference between the following two methods of cascading units: - When I cascade units through childUnit->setInputToUniform(parentUnit, ...), then the units seem to have a object reference that is not correctly unref'd, therefore unit is not released. - When I cascade units through the parentUnit->addChild(childUnit) method, and add the texture uniforms in the ShaderAttribute, then everything works correctly. I decided to use the second solution, although I find the first one nicer... Anybody else observered memory leaks? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51627#51627 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] lighting of pointsprites
Hi all I implemented a particle system using pointsprites, using fixed function pipeline. Now I have the requirement that the particles must react to lighting. I tried everything, but somehow my points don't care. I know I can do my own thing by implementing a shader program, but first I wonder if there is a limitation for point sprites to not beeing able to be illuminated by default. Or maybe it is a bug in my application, but normally by setting _dstate->setMode(GL_LIGHTING, osg::StateAttribute::ON); everything is taken care of... Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51459#51459 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Example request: render to renderbuffer attachments of FBO of main camera.
Hi, You can have a look in my post: http://forum.openscenegraph.org/viewtopic.php?t=11385 there is an example attached! Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51430#51430 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] multiple processors
I'm kind of talking to myself here... and since 2010 there is no sign of Art Tevs... anybody saw him lately? Well, if anybody cares, I found out a solution to have multiple processors with compositeviewer, each view can have its different osgPPU pipeline, etc. 1. All you need to add is a group node to your scene, that holds all the processors. 2. then you need to add this little snippet of code to Processor.cpp in the traverse method: Code: void Processor::traverse(osg::NodeVisitor& nv) { if (!mCamera) return; // if not initialized before, then do it if (mbDirty) init(); // if subgraph is dirty, then we have to resetup it // we do this on the first visitor which runs over the pipeline because this also removes cycles if (mbDirtyUnitGraph) { mbDirtyUnitGraph = false; // first resolve all cycles in the set ResolveUnitsCyclesVisitor rv; rv.run(this); // mark every unit as dirty, so that they get updated on the next call MarkUnitsDirtyVisitor nv; nv.run(this); // debug information osg::notify(osg::INFO) << "" << std::endl; osg::notify(osg::INFO) << "BEGIN " << getName() << std::endl; SetupUnitRenderingVisitor sv(this); sv.run(this); osg::notify(osg::INFO) << "END " << getName() << std::endl; osg::notify(osg::INFO) << "" << std::endl; // optimize subgraph OptimizeUnitsVisitor ov; ov.run(this); } [b]// make sure we render only our own camera if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { osgUtil::CullVisitor* cv = dynamic_cast(&nv); if (cv) { if (cv->getCurrentCamera() != getCamera()) { return; } } } [/b] // first we need to clear traversion bit of every unit if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) { CleanUpdateTraversedVisitor::sVisitor->run(this); } // if processor is propagated by a cull visitor, hence first clean the traverse bit if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { osg::notify(osg::DEBUG_INFO) << "" << std::endl; osg::notify(osg::DEBUG_INFO) << "BEGIN FRAME " << getName() << std::endl; CleanCullTraversedVisitor::sVisitor->run(this); } if (mbDirtyUnitGraph == false || nv.getVisitorType() == osg::NodeVisitor::NODE_VISITOR) { osg::Group::traverse(nv); } // check if we have units that want to be executed last, then do so if (mbDirtyUnitGraph == false && nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { for (std::list::iterator it = mLastUnits.begin(); it != mLastUnits.end(); it++) { placeUnitAsLast(*it, false); (*it)->accept(nv); placeUnitAsLast(*it, true); } mLastUnits.clear(); } } 3. You need to make sure your camera viewport of each view is set to an origin of 0/0. Control the position of the rendering viewport by setting the UnitOut viewport to the desired origin. This is due to a limitation of osgPPU, which copies to and from the render target always relative to a 0/0 origin. Now Enjoy osgPPU and compositeViewer! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51363#51363 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] custom vertex attribut, using BIND_OVERALL
I tried everything, it only worked with bind per VERTEX. It must be an opengl issue... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51228#51228 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to remove or reduce shivering in soft shadow map?
Hi I wonder if you are using some kind of ambient occlusion for your scene? how did you do it? Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51216#51216 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] slave camera using rtt texture
For all those out there who wonder if it is possible, please find attached an example program that illustrates, how to use : - composite viewer with 2 views - both rendering the same scene - both using a post render camera to apply postpro effects If you run the example with --rtt argument, the main camera per view renders to a texture, and the post-render camera renders the texture on a quad. for now, there are no shader programs used, I simply render the texture on the quad. but it would be no problem to add a shader to the quad's stateset. Important stuff I stumbled upon: - when using multiple views that overlap, make sure the topmost view has the lowest post-render index, since its content has to be rendered first. and applied on the quad last. - no matter where the final viewport is located on screen, the rtt camera always renders from the origin of the framebuffer. this means for a viewport of (x,y,w,h) you have to set the viewport of the rtt-camera to (0,0,w,h). I hope my little example program can help somebody. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51214#51214 /* * This sample program illustrates the use of RTT cameras to render to texture and * post render cameras to render the texture again on a quad. * * Daniel Schmid 22.11.2012 */ #include #include #include #include #include #include #include #include #include #include #include using namespace osg; int postrenderindex = 5; void setRTTandHUDCamera(osgViewer::View& viewer, int a_width, int a_height) { osg::Camera* maincamera = viewer.getCamera(); osg::Viewport* l_Viewport = maincamera->getViewport(); unsigned int x = l_Viewport->x(); unsigned int y = l_Viewport->y(); unsigned int tex_width = l_Viewport->width(); unsigned int tex_height = l_Viewport->height(); osg::Texture2D* texture = new osg::Texture2D; texture->setTextureSize(tex_width, tex_height); texture->setResizeNonPowerOfTwoHint(false); texture->setInternalFormat(GL_RGBA); texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); // set up the render to texture of main camera. { maincamera->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ); // IMPORTANT: no matter where final viewport is, the framebuffer is always referred to zero origin maincamera->setViewport(0, 0, tex_width, tex_height); // tell the camera to use OpenGL frame buffer object where supported. maincamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); // attach the texture and use it as the color buffer. maincamera->attach(osg::Camera::COLOR_BUFFER, texture, 0, 0, false, 4, 4); } // create the quad to visualize. osg::Vec3 corner = osg::Vec3(x, y, 0.0f); osg::Vec3 heightVec = osg::Vec3(0.0f, tex_height, 0.0f); osg::Vec3 widthVec = osg::Vec3(tex_width, 0.0f, 0.0f); osg::Geometry* geom = osg::createTexturedQuadGeometry(corner, widthVec, heightVec); // setup default state set geom->setStateSet(new osg::StateSet()); geom->setUseDisplayList(false); // new we need to add the texture to the Drawable, we do so by creating a // StateSet to contain the Texture StateAttribute. osg::StateSet* stateset = geom->getOrCreateStateSet(); stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); // setup post render camera { osg::Geode* geode = new osg::Geode(); geode->addDrawable(geom); // set up the camera to render the textured quad osg::Camera* camera = new osg::Camera; camera->setRenderer(new osgViewer::Renderer(camera)); // IMPORTANT: the topmost view has to have the lowest index camera->setRenderOrder(osg::Camera::POST_RENDER, postrenderindex--); camera->setGraphicsContext(maincamera->getGraphicsContext()); camera->setViewport(0, 0, a_width, a_height); camera->setProjectionMatrix(osg::Matrix::ortho2D(0, a_width , 0, a_height)); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setViewMatrix(osg::Matrix::identity()); // only clear the depth buffer camera->setClearMask(0); // add subgraph to render camera->addChild(geode); } } class RTTEventHandler : public osgGA::GUIEventHandler { public: bool bInitialized; int width; int height; RTTEventHandler(int a_width, int a_height) { bInitialized = false; width= a_width; height = a_height; } virtual bool handle(const osgGA::GUIEventAdapter& a_ea, osgGA::GUIActionAdapter& a_aa) { osgViewer::View* myview = dynamic_cast(&a_aa); if (!myview) return false; if (!bInitialized) { setRTTandHUDCamera(*myview, width, height); b
Re: [osg-users] manually calling drawImplementation
Hi Robert I tried to setup the main view camera to rtt, and add a post-render camera (like in the HelpHandler), like you suggest. Then I added a screen quad to the post-render camera, which renders the texture of the rtt camera. It results in a black screen, it seems like either... - the main cameras textures are not yet available - the order of the cameras is wrong (although post render should be after main camera...) - i messed up something in my code (also probable) I will try to make an example program that illustrates this behaviour... Regards Daniel robertosfield wrote: > Hi Daniel, > > Is there a reason why you can't just use a osg::Camera that is drawn after > the main scene? > > Robert. > > On 21 November 2012 08:58, Daniel Schmid < ()> wrote: > > > > > Hello all > > > > I have a camera postdrawcallback, and I want to draw a little > > scene-subgraph manually. So lets say for my subgraph I have a osg::Node as > > an entry point. > > How can I call the drawImplementations of the objects inside this subgraph > > manually? > > > > The reason for doing this is a post processing. I have quads with assigned > > textures that I want to draw in this postprocessing step. I know there is > > osgPPU but unfortunately it doesn’t work with composite viewer so I decided > > to have my postpro implemented in the postdraw callback. > > > > So, how can I draw nodes manually? > > > > Regards > > Daniel > > > > > > ___ > > osg-users mailing list > > () > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) > > > > > > > -- > Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51202#51202 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] manually calling drawImplementation
Hello all I have a camera postdrawcallback, and I want to draw a little scene-subgraph manually. So lets say for my subgraph I have a osg::Node as an entry point. How can I call the drawImplementations of the objects inside this subgraph manually? The reason for doing this is a post processing. I have quads with assigned textures that I want to draw in this postprocessing step. I know there is osgPPU but unfortunately it doesn't work with composite viewer so I decided to have my postpro implemented in the postdraw callback. So, how can I draw nodes manually? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] multiple processors
Hi art and all This is not my first post about osgPPU and composite viewer, but I get no read feedback so I try it once more. I have a composite viewer, and I can add views at runtime. I use osgPPU and it works with one viewer (the first created). For every additional viewer I also create a separate unit pipeline and separate processor, and I add the latter to the scene graph root node. Everything seems to work, except that osgPPU runs only on the first view, every additional viewer is black. Art, can you provide some feedback where the drawbacks are that hinder my second view of having his own postprocessing? I have a separate processor, separate units and the processor attached to the correct camera. What else do I have to check? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51169#51169 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] slave camera using rtt texture
Hi all I have a composite viewer, where the main camera renders to texture. No I added a slave camera (POST_RENDER that uses the same graphics context as the main camera). I had a screen quad child on which I would like to render the texture from the main camera. But all I get is a black screen. Regards Daniel [code] osg::Camera* camera = new osg::Camera; // set the projection matrix camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1920,0,1200)); // set the view matrix camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setViewMatrix(osg::Matrix::identity()); // only clear the depth buffer camera->setClearMask(0); // draw subgraph after main camera view. camera->setRenderOrder(osg::Camera::POST_RENDER); //GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; camera->setDrawBuffer(GL_BACK); camera->setReadBuffer(GL_BACK); // we don't want the camera to grab event focus from the viewers main camera(s). camera->setAllowEventFocus(false); camera->setGraphicsContext(a_viewer->getCamera()->getGraphicsContext()); camera->setViewport(a_viewer->getCamera()->getViewport()); camera->addChild( createScreenQuad(1.0f, 1.0f) ); osg::Camera::BufferAttachmentMap& map = a_viewer->getCamera()->getBufferAttachmentMap(); osg::Texture* input = map[osg::Camera::COLOR_BUFFER0]._texture.get(); camera->getOrCreateStateSet()->setTextureAttributeAndModes(0, input); a_viewer->addSlave(camera, false); [/code] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Finding OSG debug libraries
Thanks for the reply. The problem I had was that I had only a OSG-debug build. The FindPackage funktions can either find release libs or release&debug libs, but if you provide only debug libs (with d postfix), there is no luck, the find will abort. Finally I had a release and a debug build, but they reside in different directories. So there was the next problem... I had to analyse the osg find package scripts, and finally I used env OSGDIR for the release path and OSG_ROOT for the debug path. I hope this post can help somebody save some time ... My suggestion would actually be that if only debug libs (with d postfix) are provided, that those libs are taken for release and debug applications build -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51103#51103 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Finding OSG debug libraries
Hi all I use the following lines to find the libraries of osg: SET(OSGLIBRARIES osgDB osgUtil osgGA osgViewer osgText osgSim osgParticle osgShadow osgManipulator) FIND_PACKAGE(OpenSceneGraph 3.0.1 COMPONENTS ${OSGLIBRARIES} REQUIRED) Now I want to look for debug libraries. I specify the env path to the correct placement of debug compilation, but cmake still tries to find the osgXXX libs instead of osgXXXd libs. My CMAKE_BUILD_TYPE is correctly set to Debug. What do I have to configure in order that the debug libraries (which exist) are found and used? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU with CompositeViewer
Hello all I bring this subject again to the surface. And I wonder if Art (or anybody else out there) has an opinion about this he would like to share... In a composite viewer setting, views can be dynamically added and removed. In osgPPU, the Processor is part of the scene graph, but it has to be connected to a views camera... So there are two problems which are not solved: - How to disconnect a view (camera) from the processor and succesfully reconnect a new view to it? - How to deal with multiple views visible at the same time? Multiple processors added to the scene graph? I guess for the last point, there is a conceptional problem. The whole postprocessing should ONLY be bound to the view and leave no traces in the scene graph itself... What do you think? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50971#50971 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Non emissive ParticleSystem and lighting
I have a similar problem, but simply tricking the ambient light is not enought. I have a particle system to simulate snow. I have two GL lights. One is the normal daylight (sun) that defines my ambient/diffuse light. The second light is a spotlight simulating the car head light, which should illuminate only the snow flakes that are right inside the light cone. I was trying really bad to make my GL lights influence my particles, but with zero success. How can I implement my spotlight solution? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50950#50950 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Attach light to camera
Hi all I struggle to add a light to my viewer. I have the sky light illuminating the scene (light 0). Now I want to add a spotlight to illuminate the area right in front of my camera for night scenarios. I tried to attach the light to the scene and position it in a cull visitor in front of the viewer... but is there no way to attach the light directly to the camera node so that it is moved along with the camera? Anybody can give me some example code? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] custom vertex attribut, using BIND_OVERALL
When I would use uniforms, I cannot set different values for different geometries. Uniforms are global for a particular stateset. So I HAVE to use vertex attributes, since in my shader I want to treat some particular surface in a special way, but without the need of separate stateset. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50748#50748 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] custom vertex attribut, using BIND_OVERALL
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: [code] int l_SMC = 1027; // some material code for (unsigned int i=0; iasGeometry(); if (l_Geom) { osg::Array* l_VertexArray = l_Geom->getVertexArray(); if (l_VertexArray) { unsigned int vertex_count = l_VertexArray->getNumElements(); osg::IntArray* l_Array = new osg::IntArray; for (int v=0; vpush_back(l_SMC); } l_Geom->setVertexAttribArray(6, l_Array); l_Geom->setVertexAttribNormalize(6, false); l_Geom->setVertexAttribBinding(6, osg::Geometry::BIND_PER_VERTEX); } } } [/code] Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader cannot detect it anymore. I thought i should maybe reduce the VertexAttribArray (l_Array) to one single entry, but this doesn't work either. What is the correct way of passing general or common data, on a per geometry (and not vertex) basis? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] custom vertex attribut, using BIND_OVERALL
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: Code: int l_SMC = 1027; // some material code for (unsigned int i=0; iasGeometry(); if (l_Geom) { osg::Array* l_VertexArray = l_Geom->getVertexArray(); if (l_VertexArray) { unsigned int vertex_count = l_VertexArray->getNumElements(); osg::IntArray* l_Array = new osg::IntArray; for (int v=0; vpush_back(l_SMC); } l_Geom->setVertexAttribArray(6, l_Array); l_Geom->setVertexAttribNormalize(6, false); l_Geom->setVertexAttribBinding(6, osg::Geometry::BIND_PER_VERTEX); } } } Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader cannot detect it anymore. I thought i should maybe reduce the VertexAttribArray (l_Array) to one single entry, but this doesn't work either. What is the correct way of passing general or common data, on a per geometry (and not vertex) basis? Regards Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50745#50745 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Ghosting
Hi all I wonder what experiences other users made with the ghosting effect on LC Displays and projectors. As soon as I move in my 3D scene (viewport move or rotate), I start to have double images or blur better known as ghosting. I run at 60 Hz vsync refresh so I'm in perfect sync with my displays. There are forums that says and this is due to the LCD technology and you have to live with it, in the CRT age this was no problem since the screen refresh was effectively controlled by the vsync coming over the cable. We use projectors that are made specifically for low latency image display, but still we have ghosting... What measures do you take to reduce the effect? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Self-Shadowing of Billboards
Hi all I'm thinking of a solution to prevent self shadowing for billboards: If I can determine the radius of the billboard, and verify that the surface that casts shadow on the billboard is further away that the radius, I could make sure that all objects can cast shadows on the billboard, but not the billboard itself... Does anybody have an idea how this could look in GLSL? What is the actual return value given back by shadow2DProj? Is it the distance from the I use VDSM as a shadow technique (derived from actually), and I build my shadow receiving shader with the ShaderGenerator class. Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] cannot get floating-point multisampled FBOs
Hi Robert I wonder if this bug has been investigated further or even fixed. Do you have any news concerning this? I face the exact same problem. No AA / multisampling on floating point render targets... Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49301#49301 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] set new camera pointer
Hi Art I create a processor and units and hock to processor to the root scene node. Then as soon as the viewer is up, I set the processors camera pointer. Now in my application I have the feature of destroying the view and setting it up again (we use composite viewer). As soon as I set the processors camera to the new camera that belongs to the new view, I have a random checkerboard texture which is rendered. What is the correct procedure when the scene graph is not changed, neighter the ppus, but the viewer can be added and removed. How can I tell osgPPU to completely invalidate its resources? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49270#49270 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using shaders (vert and frag) with StandardShadowMap shaders.
Regarding your code, I think you missunderstood the concept of shaders and shadowtechnique. You do not need to have a visitor to add the shaders to your objects. You have to set the shaders to your shadow technique! Its the shadowscene node which takes responsibility to render your scene using the shadowtechnique's shaders. The scene objects do not have to know anything about the shader... Paradox wrote: > Hi, > > No one can give me an idea to integrate lppsm with customs shaders? > > Thank you! > > Cheers, > Dario -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49172#49172 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Framebuffer antialias
Hi everyone I render a scene my composite viewers camera, directly to the framebuffer. I have nice FSAA. Now I changed my implementation to render to a framebuffer object, which I attach to my camera. In the attach method, I can set the colorSamples values to achieve again AA. But I somehow cannot achieve quality I had in direct framebuffer. Is there a method to read out the AA settings of the framebuffer, and create a framebuffer object accordingly? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with deferred rendering
Hi Wang Thanks for the Link. This is a really simple example. Is there a more advanced example working with the depth buffer, multiple lights and applying shadows rendered in a separate shadow pass? This is the stuff i'm kind of stuck... Wang Rui wrote: > Hi Daniel, > > Why not first have a look at the osgRecipes project which is also the code > repo of the book OpenSceneGraph Cookbook. It does has a very simple deferred > shading example in chapter 6. The book may require you to buy it but the code > is totally free at: > https://github.com/xarray/osgRecipes/tree/master/cookbook/chapter6/ch06_12 > (https://github.com/xarray/osgRecipes/tree/master/cookbook/chapter6/ch06_12) > > > Wang Rui > > > > 2012/7/5 Daniel Schmid < ()> > > > Hi Sebastian > > > > You were talking about a deferred shading example. Do you have any example > > code you could provide? I'm just about to start with deferred shading and > > I'm very interested in having a look... > > > > Regards > > Daniel > > > > > > Sebastian Messerschmidt wrote: > > > > > Hi Micael, > > > > > > Feel free to ask If you encounter more problems. > > > I was just planning to provide a minimal deferred shading example to the > > > community, but unfortunately I'm busy with other stuff right now. > > > > > > > > > > > > > > > -- > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=48709#48709 > > (http://forum.openscenegraph.org/viewtopic.php?p=48709#48709) > > > > > > > > > > > > ___ > > osg-users mailing list > > () > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) > > > > > -- > Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48716#48716 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem with deferred rendering
Hi Sebastian You were talking about a deferred shading example. Do you have any example code you could provide? I'm just about to start with deferred shading and I'm very interested in having a look... Regards Daniel Sebastian Messerschmidt wrote: > Hi Micael, > > Feel free to ask If you encounter more problems. > I was just planning to provide a minimal deferred shading example to the > community, but unfortunately I'm busy with other stuff right now. > > -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48709#48709 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Render to QUAD and resize with osgManipulator::Dragger
Hi all I render my scene into a frame buffer object which is attached to the main camera. Then I add a post render camera that renders the scene on a quad. So far so good, all is well, the quad fills a quarter of my screen as expected. Now I wanted to add a Dragger (TabPlaneDragger) to my quad in order to resize it with the mouse dynamically. There I'm stuck. I followed the osgManipulator example. I have the following issues: - When using the TabPlaneDragger, it shows only a horizontal line over the rendered quad - When using the TabBoxDragger, it shows some dragger handles but they don't react. Is it possible that Draggers cannot handle nested cameras? Is there something wrong with my postRenderCamera projection matrix so it cannot map mouse coords? Hope anybody can help. I attached my code below. Regards Daniel osg::ref_ptr l_RootCamera = a_viewer->getCamera(); // Create the texture; we'll use this as our color buffer. // Note it has no image data; not required. osg::Texture2D* tex = new osg::Texture2D; tex->setTextureWidth( winW ); tex->setTextureHeight( winH ); tex->setInternalFormat( GL_RGBA ); tex->setBorderWidth( 0 ); tex->setFilter( osg::Texture::MIN_FILTER, osg::Texture::NEAREST ); tex->setFilter( osg::Texture::MAG_FILTER, osg::Texture::NEAREST ); // Attach the texture to the camera. Tell it to use multisampling. // Internally, OSG allocates a multisampled renderbuffer, renders to it, // and at the end of the frame performs a BlitFramebuffer into our texture. l_RootCamera->attach( osg::Camera::COLOR_BUFFER0, tex, 0, 0, false, 8, 8 ); l_RootCamera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::FRAME_BUFFER ); // Configure postRenderCamera to draw fullscreen textured quad osg::ref_ptr< osg::Camera > postRenderCamera( new osg::Camera ); postRenderCamera->setClearColor( osg::Vec4( 0., 1., 0., 1. ) ); // should never see this. postRenderCamera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER, osg::Camera::FRAME_BUFFER ); postRenderCamera->setReferenceFrame( osg::Camera::ABSOLUTE_RF ); postRenderCamera->setRenderOrder( osg::Camera::POST_RENDER ); postRenderCamera->setViewMatrix( osg::Matrixd::identity() ); postRenderCamera->setProjectionMatrix( osg::Matrixd::identity() ); // create the quad filling the lower left quarter of the screen osg::Geode* geode( new osg::Geode ); geode->addDrawable( osg::createTexturedQuadGeometry(osg::Vec3( -1,-1,0 ), osg::Vec3( 1,0,0 ), osg::Vec3( 0,1,0 ) ) ); geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON ); geode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); geode->setName("Grid"); // the following code is more or less copied from the osgManipulator example geode->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); osg::MatrixTransform* selection = new osg::MatrixTransform; selection->addChild(geode); osgManipulator::TabPlaneDragger* dragger = new osgManipulator::TabPlaneDragger(); dragger->setupDefaultGeometry(); float scale = geode->getBound().radius() * 1.6; dragger->setMatrix(osg::Matrix::scale(scale, scale, scale) * osg::Matrix::translate(geode->getBound().center())); dragger->addTransformUpdating(selection); dragger->setHandleEvents(true); // dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL); // dragger->setActivationKeyEvent('a'); osg::Group* root = new osg::Group; root->addChild(selection); root->addChild(dragger); postRenderCamera->addChild(root); a_viewer->getSceneData()->asGroup()->addChild(postRenderCamera.get()); ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ViewDependentShadowMap improvements
Hi Wang In your latest submission update, there is the possibility to set splitvalues. I somehow have a hard time to figure out how to use it. In my settings I calculate shadows up to 500 m max distance, with two shadows for my sun-light. Can't I just say that I want a shadowmap going from 0..100m and the second one covering the rest up to 500m? How do I have to set the splitvalues to achieve this? With the different shadow maps I expect the scene to be culled in each shadow pass according to the split distance said. This means for me that I my first split is pretty close to the viewer I have my first shadow map working at a high resolution for close objects. The further I move the split value, the more triangles are taken into that specific shadow pass... Hope you can explain it in some more detail... Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgShadow and both-face-visible polygons
Hi all I use VDSM and I have a self shadowing issue. The polygons with both faces visible flicker with the shadow. Imagine this is the case for a fence around a house. The fence polygons show the fence texture on both sides. Did anybody experience the same behavior and find a good solution for this? Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PrecipitationEffect in CameraPostDrawCallback
Hello all I'm using SilverLining-SDK to render clouds and athmosphere, and I HAVE to render clouds in the PostDrawCallback. I do not use precipitation of SilverLining, I decided to use osgParticle::PrecipitationEffect. The precipitation MUST be drawn the very last, otherwise there are transparency issues and snowflakes are drawn opaque. So I need to draw the precipitation in a Camera PostDrawCallback. How can I use the osgParticle::PrecipitationEffect class and its PrecipitationDrawable and integrate it / call it from a PostDrawCallback ? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ViewDependentShadowMap
Hi Mike Thanks for your suggestion for the clipping distance. It is more ore less the same approach like the one proposed in the submission of Wang Rui (see http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2012-April/009292.html) . It basically works form me, but there is a problem I noticed. When I look +/- into light direction, I have good looking shadows, when I turn away from light, my shadows drop heavily in resolution. This happens also with standard clipping implementation. Do you you have any ideas? There is a drawback in the current implementation of ViewDependentShadowMap. It has a couple of local classes defined in the .cpp file, like VDSMCameraCullCallback and ComputeLightSpaceBounds. When I want to derive my own class from ViewDependentShadowMap, and overwrite cull method, I end up copying all these classes aswell into my derived implementation. @Robert : please move the definition of these classes into the header file, this makes life much easier ! Regards Daniel Von: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] Im Auftrag von Mike Connell Gesendet: Montag, 16. April 2012 10:07 An: OpenSceneGraph Users Betreff: Re: [osg-users] ViewDependentShadowMap On 11 April 2012 15:35, Daniel Schmid mailto:daniel.sch...@swiss-simtec.ch>> wrote: Hi all Somehow I feel pretty alone out here working with VDSM... I have a huge paged terrain, and shadow looks awesome unless that as soon as I change my viewpoint (move camera), the shadows start to flicker and fuzz. I need somehow to limit the shadow distance... similar to MinimalShadowMap where you can set min max clip plane. I tried to modify computeShadowCameraSettings method by setting the xyzMinMax values fort he projectionMatrix to fix values, but this didn't bring much success. Does anybody have a modified or advanced version of VDSM with a clipping limit ? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org<mailto:osg-users@lists.openscenegraph.org> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Daniel I replied to you on the forum last week but I see my post never got through. I have done this, although I don't have a copy against the current VDSM source. I haven't tested this code, but it was working for me when I used it, so what you want to do is certainly possible. What I did was to override the VDSM::cull method and then after the first scenegraph traversal I had code like this: // 1. Traverse main scene graph cv.pushStateSet( _shadowRecievingPlaceholderStateSet.get() ); osg::ref_ptr decoratorStateGraph = cv.getCurrentStateGraph(); cullShadowReceivingScene(&cv); cv.popStateSet(); if (cv.getComputeNearFarMode()!=osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR) { OSG_INFO<<"Just done main subgraph traversak"<___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ViewDependentShadowMap
Hi all Somehow I feel pretty alone out here working with VDSM... I have a huge paged terrain, and shadow looks awesome unless that as soon as I change my viewpoint (move camera), the shadows start to flicker and fuzz. I need somehow to limit the shadow distance... similar to MinimalShadowMap where you can set min max clip plane. I tried to modify computeShadowCameraSettings method by setting the xyzMinMax values fort he projectionMatrix to fix values, but this didn't bring much success. Does anybody have a modified or advanced version of VDSM with a clipping limit ? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VDSM getMinimumShadowMapNearFarRatio usage
Hi everyone I'm goving another try to VDSM shadow technique. I have scene with paged terrain, and a great visibility. Is there a way to limit the max distance that should be taken into account in VDSM? When I use a top down perspective in my view, I have sharp shadows, but when I use a view direction horizon, the shadows close to the camera get fuzzy... Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] StandardShadowMap overriding Vertex programs
Hi there I noticed that in StandardShadowMap, in the method ViewData::init starting from line 607 there is code that sets the cameras stateset to an empty shader program. Does this mean that all shaderprograms that are set in my scene graph are deactivated for the shadow pass? I abuse some vertex shaders to rotate billboards into eye orientation. When the shadow pass disables these shaders, this would explain why my billboards do not work... Can anyone confirm this? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bug in osgShadow VDSM texture stages
Hi there I observed a strange behaviour with osg 3.1.2 shadows. You can reproduce it very simply with osgshadow example. Just run it with the following arguments: Osgshadow -4 –vdsm –unit 4 As soon as you select a shadowunit of 4 and above, no more shadows are displayed. In my project application, I use multitexturing and therefore the 4 lowest texture stages are occupied. Does anybody know how to circumvent this limitation ? Regards Daniel -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46670#46670 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] bug in osgShadow VDSM texture stages
Hi there I observed a strange behaviour with osg 3.1.2 shadows. You can reproduce it very simply with osgshadow example. Just run it with the following arguments: Osgshadow -4 -vdsm -unit 4 As soon as you select a shadowunit of 4 and above, no more shadows are displayed. In my project application, I use multitexturing and therefore the 4 lowest texture stages are occupied. Does anybody know how to circumvent this limitation ? Regards Daniel *** Daniel Schmid Swiss SIMTEC AG Frutigenstrasse 4 CH-3600 Thun Tel:+41 33 533 02 10 Fax: +41 33 533 02 01 Mail: daniel.sch...@swiss-simtec.ch<mailto:cdaniel.sch...@swiss-simtec.ch> URL: http://www.swiss-simtec.ch<http://www.swiss-simtec.ch/> *** ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org