Re: [osg-users] bounding box of culled geometry
Hi Renzo, On Thu, 15 Oct 2020 at 09:05, OpenSceneGraph Users < osg-users@lists.openscenegraph.org> wrote: > thanks for pointing out how cull traversal operates. > > Yes, it might be I am searching in the wrong direction. I need to get the > minimum and the maximum Z coordinate of the geometry vertices in order to > apply a color range. This is quite easy to do for the whole geometry but I > would know if there is a way just for the vertices inside the view frustum. > The CullVisitor maintains the near and far values used in the view frustum so after the cull traversal you should be able query the settings. See CullVisitor::getCalculatedNearPlane() and getCalculatedFarPlane() Robert. -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21889.1602778907.3538.osg-users-openscenegraph.org%40lists.openscenegraph.org. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21889.1602778907.3538.osg-users-openscenegraph.org%40lists.openscenegraph.org.
Re: [osg-users] bounding box of culled geometry
Hi Wojtek, it looks interesting. I do not have a shadowed scene but I will try it, thanks. Regards, Renzo On 15-Oct-20 2:54 PM, OpenSceneGraph Users wrote: Hi Renzo, You may look at osgShadow\MinimalCullBoundsShadowMap.cpp. It scans RenderBins and compute bounds of culled drawables to optimize shadow map resolution. Cheers, Wojtek Lewandowski czw., 15 paź 2020 o 12:40 OpenSceneGraph Usersnapisał(a): Hi Werner, I do not know if I have found the code that you are suggesting. I see that CullVisitor could help to find the near and far plane, however with Z I meant the world vertical axis, not the axis of the view frustum. Regards, Renzo On 15-Oct-20 11:25 AM, OpenSceneGraph Users wrote: Hi Renzo, Maybe a node visitor with z-near and z-far as parameter is a possible approach. Werner On 15. Oktober 2020 09:46:57 MESZ, OpenSceneGraph Users wrote: Hi Robert, On 14-Oct-20 3:56 PM, OpenSceneGraph Users wrote: Hi Renzo, On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Users wrote: I am using osg::Drawable::getBoundingBox() to retrieve the bounding box around the whole geometry. Is there a similar short way to get the equivalent box for just the culled geometry or do I need to write my own procedure? Culling isn't related to the nodes directly, but to a traversersal of the scene graph that compares the bounding shere's of internal nodes of the scene graph and the bounding boxes of the drawable leaves. Culling can happen at any point in the hierarchy - it can cull right up at the top node in the scene graph if the scene is outside the view frustum. Within the cull traversal there is no tracking of culled or non culling bounding boxes, a cull test is done and the bool result used directly. There isn't a "bounding box" or "bounding sphere" for culled or non culled objects. All the cull traversal cares about is building a list of drawables leaves that pass the view frustum test, there is no tracking of any objects that are culled - this would be a crazy waste of CPU resources. I have to ask, why do you want a bounding box of culled objects - what is the high level problem you are trying to solve? It may well be that you are asking the wrong question thinking about the task you have in the wrong way. Robert. thanks for pointing out how cull traversal operates. Yes, it might be I am searching in the wrong direction. I need to get the minimum and the maximum Z coordinate of the geometry vertices in order to apply a color range. This is quite easy to do for the whole geometry but I would know if there is a way just for the vertices inside the view frustum.
Re: [osg-users] bounding box of culled geometry
Hi Renzo, You may look at osgShadow\MinimalCullBoundsShadowMap.cpp. It scans RenderBins and compute bounds of culled drawables to optimize shadow map resolution. Cheers, Wojtek Lewandowski czw., 15 paź 2020 o 12:40 OpenSceneGraph Users < osg-users@lists.openscenegraph.org> napisał(a): > > Hi Werner, > > I do not know if I have found the code that you are suggesting. I see that > CullVisitor could help to find the near and far plane, however with Z I > meant the world vertical axis, not the axis of the view frustum. > > Regards, > Renzo > > On 15-Oct-20 11:25 AM, OpenSceneGraph Users wrote: > > Hi Renzo, > Maybe a node visitor with z-near and z-far as parameter is a possible > approach. > Werner > > > On 15. Oktober 2020 09:46:57 MESZ, OpenSceneGraph Users > > wrote: >> >> >> Hi Robert, >> >> On 14-Oct-20 3:56 PM, OpenSceneGraph Users wrote: >> >> Hi Renzo, >> >> On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Users < >> osg-users@lists.openscenegraph.org> wrote: >> >>> I am using osg::Drawable::getBoundingBox() to retrieve the bounding box >>> around the whole geometry. Is there a similar short way to get the >>> equivalent box for just the culled geometry or do I need to write my own >>> procedure? >>> >> >> Culling isn't related to the nodes directly, but to a traversersal of the >> scene graph that compares the bounding shere's of internal nodes of the >> scene graph and the bounding boxes of the drawable leaves. Culling can >> happen at any point in the hierarchy - it can cull right up at the top node >> in the scene graph if the scene is outside the view frustum. >> >> Within the cull traversal there is no tracking of culled or non culling >> bounding boxes, a cull test is done and the bool result used directly. >> There isn't a "bounding box" or "bounding sphere" for culled or non culled >> objects. All the cull traversal cares about is building a list of >> drawables leaves that pass the view frustum test, there is no tracking of >> any objects that are culled - this would be a crazy waste of CPU resources. >> >> I have to ask, why do you want a bounding box of culled objects - what is >> the high level problem you are trying to solve? It may well be that you >> are asking the wrong question thinking about the task you have in the wrong >> way. >> >> Robert. >> >> >> thanks for pointing out how cull traversal operates. >> >> Yes, it might be I am searching in the wrong direction. I need to get the >> minimum and the maximum Z coordinate of the geometry vertices in order to >> apply a color range. This is quite easy to do for the whole geometry but I >> would know if there is a way just for the vertices inside the view frustum. >> >> Regards, >> Renzo >> >> -- >> >> osg-users mailing >> listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > ___ > osg-users mailing > listosg-users@lists.openscenegraph.orghttp://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 > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bounding box of culled geometry
Hi Werner, I do not know if I have found the code that you are suggesting. I see that CullVisitor could help to find the near and far plane, however with Z I meant the world vertical axis, not the axis of the view frustum. Regards, Renzo On 15-Oct-20 11:25 AM, OpenSceneGraph Users wrote: Hi Renzo, Maybe a node visitor with z-near and z-far as parameter is a possible approach. Werner On 15. Oktober 2020 09:46:57 MESZ, OpenSceneGraph Users wrote: Hi Robert, On 14-Oct-20 3:56 PM, OpenSceneGraph Users wrote: Hi Renzo, On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Userswrote: I am using osg::Drawable::getBoundingBox() to retrieve the bounding box around the whole geometry. Is there a similar short way to get the equivalent box for just the culled geometry or do I need to write my own procedure? Culling isn't related to the nodes directly, but to a traversersal of the scene graph that compares the bounding shere's of internal nodes of the scene graph and the bounding boxes of the drawable leaves. Culling can happen at any point in the hierarchy - it can cull right up at the top node in the scene graph if the scene is outside the view frustum. Within the cull traversal there is no tracking of culled or non culling bounding boxes, a cull test is done and the bool result used directly. There isn't a "bounding box" or "bounding sphere" for culled or non culled objects. All the cull traversal cares about is building a list of drawables leaves that pass the view frustum test, there is no tracking of any objects that are culled - this would be a crazy waste of CPU resources. I have to ask, why do you want a bounding box of culled objects - what is the high level problem you are trying to solve? It may well be that you are asking the wrong question thinking about the task you have in the wrong way. Robert. thanks for pointing out how cull traversal operates. Yes, it might be I am searching in the wrong direction. I need to get the minimum and the maximum Z coordinate of the geometry vertices in order to apply a color range. This is quite easy to do for the whole geometry but I would know if there is a way just for the vertices inside the view frustum. Regards, Renzo 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 -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21361.1602757401.3541.osg-users-openscenegraph.org%40lists.openscenegraph.org. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21361.1602757401.3541.osg-users-openscenegraph.org%40lists.openscenegraph.org.
Re: [osg-users] bounding box of culled geometry
Hi Renzo, Maybe a node visitor with z-near and z-far as parameter is a possible approach. Werner On 15. Oktober 2020 09:46:57 MESZ, OpenSceneGraph Users wrote: > >Hi Robert, > >On 14-Oct-20 3:56 PM, OpenSceneGraph Users wrote: > >Hi Renzo, > > >On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Users > wrote: > >I am using osg::Drawable::getBoundingBox() to retrieve the bounding box >around the whole geometry. Is there a similar short way to get the >equivalent box for just the culled geometry or do I need to write my >own procedure? > > >Culling isn't related to the nodes directly, but to a traversersal of >the scene graph that compares the bounding shere's of internal nodes of >the scene graph and the bounding boxes of the drawable leaves. Culling >can happen at any point in the hierarchy - it can cull right up at the >top node in the scene graph if the scene is outside the view frustum. > > >Within the cull traversal there is no tracking of culled or non culling >bounding boxes, a cull test is done and the bool result used directly. >There isn't a "bounding box" or "bounding sphere" for culled or non >culled objects. All the cull traversal cares about is building a list >of drawables leaves that pass the view frustum test, there is no >tracking of any objects that are culled - this would be a crazy waste >of CPU resources. > > >I have to ask, why do you want a bounding box of culled objects - what >is the high level problem you are trying to solve? It may well be that >you are asking the wrong question thinking about the task you have in >the wrong way. > > >Robert. > > >thanks for pointing out how cull traversal operates. > >Yes, it might be I am searching in the wrong direction. I need to get >the minimum and the maximum Z coordinate of the geometry vertices in >order to apply a color range. This is quite easy to do for the whole >geometry but I would know if there is a way just for the vertices >inside the view frustum. > >Regards, >Renzo > > > > > >___ >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] bounding box of culled geometry
Hi Robert, On 14-Oct-20 3:56 PM, OpenSceneGraph Users wrote: Hi Renzo, On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Userswrote: I am using osg::Drawable::getBoundingBox() to retrieve the bounding box around the whole geometry. Is there a similar short way to get the equivalent box for just the culled geometry or do I need to write my own procedure? Culling isn't related to the nodes directly, but to a traversersal of the scene graph that compares the bounding shere's of internal nodes of the scene graph and the bounding boxes of the drawable leaves. Culling can happen at any point in the hierarchy - it can cull right up at the top node in the scene graph if the scene is outside the view frustum. Within the cull traversal there is no tracking of culled or non culling bounding boxes, a cull test is done and the bool result used directly. There isn't a "bounding box" or "bounding sphere" for culled or non culled objects. All the cull traversal cares about is building a list of drawables leaves that pass the view frustum test, there is no tracking of any objects that are culled - this would be a crazy waste of CPU resources. I have to ask, why do you want a bounding box of culled objects - what is the high level problem you are trying to solve? It may well be that you are asking the wrong question thinking about the task you have in the wrong way. Robert. thanks for pointing out how cull traversal operates. Yes, it might be I am searching in the wrong direction. I need to get the minimum and the maximum Z coordinate of the geometry vertices in order to apply a color range. This is quite easy to do for the whole geometry but I would know if there is a way just for the vertices inside the view frustum. Regards, Renzo -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21338.1602748022.3541.osg-users-openscenegraph.org%40lists.openscenegraph.org. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21338.1602748022.3541.osg-users-openscenegraph.org%40lists.openscenegraph.org.
Re: [osg-users] bounding box of culled geometry
Hi Renzo, On Wed, 14 Oct 2020 at 12:00, OpenSceneGraph Users < osg-users@lists.openscenegraph.org> wrote: > I am using osg::Drawable::getBoundingBox() to retrieve the bounding box > around the whole geometry. Is there a similar short way to get the > equivalent box for just the culled geometry or do I need to write my own > procedure? > Culling isn't related to the nodes directly, but to a traversersal of the scene graph that compares the bounding shere's of internal nodes of the scene graph and the bounding boxes of the drawable leaves. Culling can happen at any point in the hierarchy - it can cull right up at the top node in the scene graph if the scene is outside the view frustum. Within the cull traversal there is no tracking of culled or non culling bounding boxes, a cull test is done and the bool result used directly. There isn't a "bounding box" or "bounding sphere" for culled or non culled objects. All the cull traversal cares about is building a list of drawables leaves that pass the view frustum test, there is no tracking of any objects that are culled - this would be a crazy waste of CPU resources. I have to ask, why do you want a bounding box of culled objects - what is the high level problem you are trying to solve? It may well be that you are asking the wrong question thinking about the task you have in the wrong way. Robert. -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21167.1602683796.3540.osg-users-openscenegraph.org%40lists.openscenegraph.org. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/mailman.21167.1602683796.3540.osg-users-openscenegraph.org%40lists.openscenegraph.org.