Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-29 Thread Valerian Merkling
Sorry but I still have questions ..

I found this article about LOD and Shaders :

http://codeflow.org/entries/2010/nov/07/opengl-4-tessellation/

If I correctly understood how the OcclusionQueryNode works, I would say I can't 
replace my HeightField with that kind of shaders AND expect my 
OcclusionQueryNode to keep on working, right ? Or is it another way to make 
some occlusion culling when my occluding mountain is rendered with a shader ?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67904#67904





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-29 Thread Valerian Merkling
Thats ok now, thanks a lot !

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67891#67891





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-28 Thread Julien Valentin
oups I answer too fast  
try it
ocqn->getQueryStateSet()->setRenderBinDetails(100,"DepthSortedBin")



mp3butcher wrote:
> try
> ocqn->getQueryStateSet()->setRenderBinDetails(100,"RenderBin",TRANSPARENT_BIN)
> 
> 
> 
> kragnfroll wrote:
> > Ok. Then I've a problem with my occlusionQuery node !
> > 
> > Here is how I tested :
> > - breakpoint in the OcclusionQueryNode::getNumPixels function
> > - configured OQN with a QueryFrameCount of 500 to see occluded node coming 
> > 
> > And the result is :
> > - occlusion working when a node is outside the camera field
> > - not working at all when occluded by textured HeightField when opacity is 
> > manager (setRenderingHint TRANSPARENT_BIN)
> > - working when removing the TRANSPARENT_BIN attribute on the heightField
> > 
> > I really need transparency. I think I can understand what is going on : the 
> > occlusion Query is made before the HeightField is rendered, even if the 
> > node I need to occlude is also in the transparent_bin.
> > 
> > Is there a way to make it work ?
> 


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67886#67886





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-28 Thread Julien Valentin
try
ocqn->getQueryStateSet()->setRenderBinDetails(100,"RenderBin",TRANSPARENT_BIN)



kragnfroll wrote:
> Ok. Then I've a problem with my occlusionQuery node !
> 
> Here is how I tested :
> - breakpoint in the OcclusionQueryNode::getNumPixels function
> - configured OQN with a QueryFrameCount of 500 to see occluded node coming 
> 
> And the result is :
> - occlusion working when a node is outside the camera field
> - not working at all when occluded by textured HeightField when opacity is 
> manager (setRenderingHint TRANSPARENT_BIN)
> - working when removing the TRANSPARENT_BIN attribute on the heightField
> 
> I really need transparency. I think I can understand what is going on : the 
> occlusion Query is made before the HeightField is rendered, even if the node 
> I need to occlude is also in the transparent_bin.
> 
> Is there a way to make it work ?


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67885#67885





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-28 Thread Valerian Merkling
Ok. Then I've a problem with my occlusionQuery node !

Here is how I tested :
- breakpoint in the OcclusionQueryNode::getNumPixels function
- configured OQN with a QueryFrameCount of 500 to see occluded node coming 

And the result is :
- occlusion working when a node is outside the camera field
- not working at all when occluded by textured HeightField when opacity is 
manager (setRenderingHint TRANSPARENT_BIN)
- working when removing the TRANSPARENT_BIN attribute on the heightField

I really need transparency. I think I can understand what is going on : the 
occlusion Query is made before the HeightField is rendered, even if the node I 
need to occlude is also in the transparent_bin.

Is there a way to make it work ?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67882#67882





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-28 Thread Julien Valentin
If I remember correctly my previous reading of OcclusionQueryNode
It makes a "number of fragments passing the depth test" query test on the 
bounding volume geometry of children nodes (discarding framebuffer writes) and 
decide to draw or not children based on the fragments number of the query  
result.




kragnfroll wrote:
> My last problem related to this topic is how to be sure that the 
> OcclusionQueryNode works. I made a few tests and it seems that the depth 
> buffer is making all the job, but I can't prove it.
> 
> I'm reading the code to try to understand how the OcclusionQueryNode works 
> (and I'm not stuck), but tips or explanation are welcome.


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67879#67879





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-28 Thread Valerian Merkling
My last problem related to this topic is how to be sure that the 
OcclusionQueryNode works. I made a few tests and it seems that the depth buffer 
is making all the job, but I can't prove it.

I'm reading the code to try to understand how the OcclusionQueryNode works (and 
I'm not stuck), but tips or explanation are welcome.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67875#67875





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-27 Thread Chris Hanson
I gotcha. In a legacy situation, it might be hard to integrate osgEarth
properly.

So, what is your current remaining obstacle?
​
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-27 Thread Valerian Merkling
Hi Jason, 

I'm not making a full new application, I'm just upgrading the old OpenGL code 
to OSG, so there is lots of things I should have to destroy to use osgEarth, 
like the way tile are loaded, georeferencing management all that tools made to 
works on the rasters. 

My decision was to use OSG to have a better integration, and thus far it's good.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67860#67860





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-27 Thread Jason Beverage
Hey Valerian,

Just curious, but what do you need to do with non georeferenced images that
osgEarth can't do?  Are you providing georeferencing yourself externally?

Jason

On Mon, Jun 27, 2016 at 6:05 AM Valerian Merkling 
wrote:

> Chris, I already try to use osgEarth, it's really good but I can't use it
> :(
> To make it short, osgEarth's way to manage non georeferenced image isn't
> compatible with my needs.
>
>
> Sebastien, I don't need to outline, I need to draw stuff like roads.
> Right now I'm using polygon offset to make sure the red part is drawn
> behind the yellow (you can see it the joined file). It's hard for me to be
> clear with my poor english and my poor understanding of the OpenGL world,
> sorry !
>
> Anyway, using a shader may also be a solution for my roads, I'll try it.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67845#67845
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Chris Hanson
Have you considered looking at osgEarth? There's a lot of capability there,
including line rendering to textures with CSS-like styles using AGG. I've
used it for this sort of thing, and when you're already DOING geospatial
stuff, you should really think about using the OSG toolkit that was really
designed for geospatial use.​

I'm happy to advise on it.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Sebastian Messerschmidt



Am 24.06.2016 um 17:14 schrieb Valerian Merkling:

Hi Robert,

Thanks for your clarification about OccluderNode.

I already looked at the osgocclusionquery example. If I'm right, it just need 
to add an OcclusionQueryNode to contain the node wich have to be occluded by 
the rest of the scene graph. I wasn't able to make it works so I may need to 
dig a bit.

To be honest, I don't know if I will use OcclusionCulling at all, but I want to 
understand how it works and how it can be used. I don't want to be forced to, 
in a few month, rebuild all my app because I'm unable to use occlusion culling 
while really needing it.

I'm also need to support a part of SLD (see here 
http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/lines.html), the "Line 
With Border" example.

I want to use PolygonOffset to force the drawing order of my lines, and 
OcclusionCulling might be a good way to avoid depth buffer issues.
If you are trying to display outlines it might be more efficient to use 
a shader, as your heightfield is most likely a regular grid, for which 
you can calculate barycentric coordinates easily. See [0], I used this 
myself by adding a Barycentric-Visitor which simply put, will add some 
vertex-attributes to the geometry which you then can use to have 
outlines. As the rendering is in the same primitive, there won't be any 
depth-related issues.


Cheers
Sebastian

[0] 
http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/


Anyway, thanks again for your help. And if you have any tips about 
OcclusionQueryNode I'll take it !

Cheers,
Valerian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67798#67798





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Valerian Merkling
Ok OcclusionQueryNode works fine for me now, this post helped me : 
http://forum.openscenegraph.org/viewtopic.php?t=8955=occlusionquerynode

It seems this problem is still real : an empty OcclusionQueryNode occludes 
everythings !

Can anyone explain me why ?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67800#67800





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Valerian Merkling
Hi Robert, 

Thanks for your clarification about OccluderNode.

I already looked at the osgocclusionquery example. If I'm right, it just need 
to add an OcclusionQueryNode to contain the node wich have to be occluded by 
the rest of the scene graph. I wasn't able to make it works so I may need to 
dig a bit.

To be honest, I don't know if I will use OcclusionCulling at all, but I want to 
understand how it works and how it can be used. I don't want to be forced to, 
in a few month, rebuild all my app because I'm unable to use occlusion culling 
while really needing it.

I'm also need to support a part of SLD (see here 
http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/lines.html), the 
"Line With Border" example.

I want to use PolygonOffset to force the drawing order of my lines, and 
OcclusionCulling might be a good way to avoid depth buffer issues.

Anyway, thanks again for your help. And if you have any tips about 
OcclusionQueryNode I'll take it !

Cheers,
Valerian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67798#67798





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Robert Osfield
HI Valerian,

The osg::OccluderNode is not appropriate for what you are trying to
achieve, it only works when you have convex planar occluder geometries
that you can use to do the culling.  It's useful for town or building
scenes where walls can form large occluders relative to screen space.
A terrain height field doesn't exhibit any proporties that fit with
being a convex planar occluder so it not useful in your case.

Using OpenGL occlusion query feature via the osg::OcclusionQueryNode
is more likely be to be helpful as it can handle a straight meshes
rather than contrained geometric primitives like osg::OccluderNode.
Have a look at the osgocclusionquery example to see how to set it up.

As a general point, do you really need to cull things behind the
terrain?  If you are getting a solid 60Hz you don't need to complicate
your scene graph with techniques like occlusion query.

Robert.

On 24 June 2016 at 13:39, Valerian Merkling  wrote:
> I might show some pieces but there is a lot of code and i'm not allowed to 
> share it :(
>
> Right now I need to understand how occlusion culling is supposed to be used 
> with HeightField (is it is possible). I made a few tests in my code but I did 
> not keep them as nothing was working.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67787#67787
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-24 Thread Valerian Merkling
I might show some pieces but there is a lot of code and i'm not allowed to 
share it :(

Right now I need to understand how occlusion culling is supposed to be used 
with HeightField (is it is possible). I made a few tests in my code but I did 
not keep them as nothing was working.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67787#67787





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way to cull object hidden by a mountain

2016-06-23 Thread Chris Hanson
I might be able to help you with this. Is your source something you can
share, possibly off-list?

On Wed, Jun 22, 2016 at 9:55 AM, Valerian Merkling 
wrote:

> Hi,
>
> I'm working with OpenSceneGraph 3.4.0 on a kind of GIS app.
>
> I'm rendering the ground using textured HeightField square. My scene graph
> is cut in two part, a group node with all the textured HeightFields, and
> another containing all my 3D objects (sorted in a quadtree).
>
> I've got a lot of thoses textured heightfield squares, they come in
> different resolution, and will be soon put into a nice QuadTree with LOD.
>
> I would like to use Occlusion Culling to avoid to render object hidden
> behind those Heightfield.
>
> As far as I know there is both OccluderNode and OcclusionQueryNode which
> can be used for culling.
>
> I tried to use OccluderNode but I can't convert HeightField to
> ConvexPlanarOccluder.
>
> Then I tried OcclusionQueryNode (root -> occlusionQueryNode -> QuadTree ->
> objects) but it seems to be too powerful : everything is culled, even the
> heightField part which is not inside the occlusionQueryNode ... :(
>
> I came to realize that I barely understand how to use OcclusionQueryNode
> and OccluderNode, so I would like to have your advice : Is it a good idea
> to use one of thoses ? And how can I use them properly ?
>
> Thank you!
>
> Cheers,
> valerian
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67739#67739
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org