Hi Jean-Charles Another option is render occlusion geometry to depth texture from P point of view (like in shadowmap generation), then draw buffer with points that u need to test with visibility testing against depth map in vertex or geometry shader, streaming out result via transform feedback. To connect this output data to your c++ structures you can add vertex attribute with some sort of hash (or even pointer to your data structure stored in one\two 32 bit uints, depending on whether you building 32\64bit app ) to each vertex, and stream out both visibility check result and this hash to be able to connect this data to your high level structures.
This option is very fast, but you will have some precision issues (for correct checking of points that lie exactly on visible surface you need to use polygon offset or instead some threshold in your shaders when checking against depth map, which could cause some points to be counted as visible when they aren't). Also this require quite a bit of effort to get it working, unless you are familiar with opengl low-level stuff. Cheers, Sergey. 21.09.2011, 13:45, "Jean-Charles Quillet" <[email protected]>: > Hi, > > I'm working on an application that manipulates a 3d terrain (one big single > geometry). I'm using OSG for 3d rendering as well as for internal data > manipulation. I need to calculate the visibility of each point of a result > grid from a certain position P. > > I have setup the simplest algorithm for this. It goes like this > > for each point of my grid > --compute the 3D position P' on the terrain > --create a segment between P and P' > --call the intersector with the segment on the terrain > --if there is an intersection > ----flag the point as hidden > do it again > > As you can imagine, this is going fairly slow. I suppose the main issue is > that the intersector is testing every single triangle for an intersection. > Any idea to optimize this ? Thanks, > > Jean-Charles[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=42908#42908 > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

