Add 'small feature culling pixel size' setting

pull/137/head
scrawl 8 years ago
parent 9180089a3b
commit fcb4129aee

@ -244,7 +244,10 @@ namespace MWRender
if (!Settings::Manager::getBool("small feature culling", "Camera"))
cullingMode &= ~(osg::CullStack::SMALL_FEATURE_CULLING);
else
{
mViewer->getCamera()->setSmallFeatureCullingPixelSize(Settings::Manager::getFloat("small feature culling pixel size", "Camera"));
cullingMode |= osg::CullStack::SMALL_FEATURE_CULLING;
}
mViewer->getCamera()->setCullingMode( cullingMode );

@ -19,10 +19,21 @@ small feature culling
:Range: True/False
:Default: True
This boolean setting determines whether objects that render to a few pixels or smaller will be culled (not drawn). It generally improves performance to enable this feature, and by definition the culled objects will be very small on screen. It appears that the default definition of "small" in OpenSceneGraph is 2x2 pixels.
This boolean setting determines whether objects that render to a few pixels or smaller will be culled (not drawn). It generally improves performance to enable this feature, and by definition the culled objects will be very small on screen. The size in pixels for an object to be considered 'small' is controlled by a separate setting.
The default value is true. This setting can only be configured by editing the settings configuration file.
small feature culling pixel size
---------------------
:Type: floating point
:Range: > 0
:Default: 2.0
Controls the cutoff in pixels for the 'small feature culling' setting which will have no effect if 'small feature culling' is disabled.
This setting can only be configured by editing the settings configuration file.
viewing distance
----------------

@ -16,9 +16,11 @@
# Near clipping plane (>0.0, e.g. 0.01 to 18.0).
near clip = 1
# Cull objects smaller than one pixel.
# Cull objects that occupy less than 'small feature culling pixel size' on the screen.
small feature culling = true
small feature culling pixel size = 2.0
# Maximum visible distance (e.g. 2000.0 to 6666.0). Caution: this setting
# can dramatically affect performance, see documentation for details.
viewing distance = 6666.0

Loading…
Cancel
Save