[osg-users] setLODScale affecting near far planes?

Thrall, Bryan bryan.thrall at flightsafety.com
Mon Sep 22 08:56:15 PDT 2008


Tomlinson, Gordon wrote on Monday, September 22, 2008 10:45 AM:

> Culling IS done against the near and far clip, this is standard
> operating procedure of OGL and OSG

To be precise, OSG only culls based on the sides of the frustum by
default (as Roland says); OGL does the near and far plane culling (based
on OSG calculations of what those planes should be). You can configure
OSG to do its own near and far plane culling in addition, though.

> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org
> [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of
Smeenk,
> R.J.M. (Roland)
> Sent: Monday, September 22, 2008 11:36 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] setLODScale affecting near far planes?
> 
> 
> Paul,
> 
> As far as I know default OSG culling is only done against the sides
and
> not against the near and far plane.
> See:
> 
>         enum MaskValues
>         {
>             NO_CULLING                  = 0x0,
>             VIEW_FRUSTUM_SIDES_CULLING  = 0x1,
>             NEAR_PLANE_CULLING          = 0x2,
>             FAR_PLANE_CULLING           = 0x4,
>             VIEW_FRUSTUM_CULLING        = VIEW_FRUSTUM_SIDES_CULLING|
>                                           NEAR_PLANE_CULLING|
>                                           FAR_PLANE_CULLING,
>             SMALL_FEATURE_CULLING       = 0x8,
>             SHADOW_OCCLUSION_CULLING    = 0x10,
>             DEFAULT_CULLING             = VIEW_FRUSTUM_SIDES_CULLING|
>                                           SMALL_FEATURE_CULLING|
>                                           SHADOW_OCCLUSION_CULLING,
>             ENABLE_ALL_CULLING          = VIEW_FRUSTUM_CULLING|
>                                           SMALL_FEATURE_CULLING|
>                                           SHADOW_OCCLUSION_CULLING
>         };
> 
> 
>> -----Original Message-----
>> From: osg-users-bounces at lists.openscenegraph.org
>> [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Paul
Martz
>> Sent: maandag 22 september 2008 16:46
>> To: 'OpenSceneGraph Users'
>> Subject: Re: [osg-users] setLODScale affecting near far planes?
>> 
>>> Hi all again,
>>> 
>>> Robert: for you last question; yes, I have near/far culling enabled
>>> and the near/far setting is
>> compute_near_far_using_bounding_volume. If
>>> the near far modification that is taking place should be very small,
>>> somehow I am still getting quite significant jumps because some
>>> objects near the camera get culled when I would not like that to
>>> happen. When I enable culling for near/far planes, it seems like osg
>>> takes into account my preferred near/far planes and is NOT
>>> auto-computing. It does do some re computation as I change the
>>> LODScale. Why does this happen?
>> 
>> You have said on multiple occasions that you are "enabling near/far
culling"
>> -- What exactly do you mean by that? Near/far culling is always
>> enabled in OSG and OpenGL, so I'm curious to know what function call
>> you are making that you believe is enabling near/far culling.
>> 
>>> Paul:
>>>> Do you get the same behavior when viewing your database in
osgviewer and
>>>>   hitting the * and / keys? -Paul
>>> 
>>> Sorry Paul, but it is hard for me to say, because with osgviewer I
>>> only notice the terrain loosing or gaining detail, but since I am
>>> unable to dump the camera information in osgviewer I cannot compare
it
>>> to my application's printouts of near far planes, but thanks for the
>>> advice.
>> 
>> If you don't get the dame behavior in osgviewer, then most likely
this
> 
>> is a bug in your own application somewhere, and not a problem in OSG.
>> 
>> You can dump the osgviewer camera information by editing the
osgviewer
> 
>> source.
>>    -Paul

-- 
Bryan Thrall
FlightSafety International
bryan.thrall at flightsafety.com



More information about the osg-users mailing list