Re: [osg-users] Visibility of point array

2011-08-17 Thread Roman Grigoriev
Hi, Sergey! I try to adopt transform feedback to osg and find some comments Code: // next three methods MUST be called from thread that have valid opengl context (same context that this callback is initialized with) // f.e. you can modify callback to use them in next frame to get previous frame

Re: [osg-users] Visibility of point array

2011-01-24 Thread Oliver Neumann
Hi Sergey, Thanks for the code example! I will try to get it to work but I might need some days, this is the first custom shader I'm using. Cheers, Oliver -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35914#35914 ___

Re: [osg-users] Visibility of point array

2011-01-21 Thread Sergey Polischuk
Hi, Oliver Quick and somewhat dirty how-to example attached. File contains custom osg::Drawable::DrawCallback with some utility stuff and comments on what is going on and how to use it. shaders to test against view frustum is: vertex: [code] #version 150 core in vec3 InstancePosition; uniform

Re: [osg-users] Visibility of point array

2011-01-20 Thread Oliver Neumann
Hi Sergey, ok, thanks, currently my approach is working ok, but I'm still looking for speed improvements, so your help is very appreciated. Cheers, Oliver -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35808#35808 ___

Re: [osg-users] Visibility of point array

2011-01-20 Thread Sergey Polischuk
Hi, Oliver I can give you some general pointers or make basic example, but i'll have time for example not earlier than on weekend. Cheers, Sergey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35803#35803

Re: [osg-users] Visibility of point array

2011-01-19 Thread Oliver Neumann
Hi Sergey, Thanks for the quick reply. Do you have a sample code or some documentation on how to get transform feedback to work? Greetings, Oliver -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35772#35772 ___

Re: [osg-users] Visibility of point array

2011-01-19 Thread Sergey Polischuk
If its still not good enough then try transform feedback stuff... it's not that hard to implement and works very fast even with insane amounts of points to test, i've been using this approach for culling instanced objects like trees and grass patches in large scenes with like 200k objects to tes

Re: [osg-users] Visibility of point array

2011-01-19 Thread Sergey Polischuk
Hi, 9Volt Solution that you can use actually depends of do you care about processing speed or it is not that important. If speed is not concern then your approach must be good enough. You can actually try to use occlusion queries for that purpose, though you'll need to generate drawables that

Re: [osg-users] Visibility of point array

2011-01-19 Thread Oliver Neumann
Hi Ulrich and Sergey, the problem I need to solve is this: for an arbitrary scene loadable through osg, detect which points in an array of points are visible (points are normally on model surface, but not necesserily part of the original model). Your solutions sound very complex. Currently I'm

Re: [osg-users] Visibility of point array

2011-01-19 Thread Sergey Polischuk
Hi, You can use opengl transform feedback with vertex and geometry shaders for that purpose to check visibility of vertex vs frustum in shaders and emit only visible vertices or their indexes or whatever you need to texture buffer object, but since osg dont support transform feedback and tbo na

Re: [osg-users] Visibility of point array

2011-01-18 Thread Ulrich Hertlein
Hi Oliver, On 18/01/11 20:23 , Oliver Neumann wrote: > I need the information on vertix level, not bounding volumn level. How does > the Render > Engine know which vertices to draw. Is it all done in GPU using the Z Buffer > (overwriting what is nearer)? OSG does not check each vertex for visibi

Re: [osg-users] Visibility of point array

2011-01-18 Thread Oliver Neumann
Hi Ulrich, I need the information on vertix level, not bounding volumn level. How does the Render Engine know which vertices to draw. Is it all done in GPU using the Z Buffer (overwriting what is nearer)? I found the OcclusionQuery example that uses OcclusionQueryNode, but I can't quite make o

Re: [osg-users] Visibility of point array

2011-01-17 Thread Ulrich Hertlein
Hi Oliver, On 18/01/11 2:21 , Oliver Neumann wrote: > I am trying to detect which of a set of 3D points (e.g. vertices of a scene > model) are > currently visible. I tried to derive from osg::Geometry and overwrite the > drawImplementation methode. The _vertexData.array contains all points > spe

[osg-users] Visibility of point array

2011-01-17 Thread Oliver Neumann
Hi, I am trying to detect which of a set of 3D points (e.g. vertices of a scene model) are currently visible. I tried to derive from osg::Geometry and overwrite the drawImplementation methode. The _vertexData.array contains all points specified (all points, also the occluded) and _vertexData.in