From fcb4129aee517375055da989a780c15d88afa1d4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 1 Feb 2017 05:38:59 +0100 Subject: [PATCH] Add 'small feature culling pixel size' setting --- apps/openmw/mwrender/renderingmanager.cpp | 3 +++ docs/source/openmw-mods/settings/camera.rst | 15 +++++++++++++-- files/settings-default.cfg | 4 +++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 417f335672..08eb894990 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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 ); diff --git a/docs/source/openmw-mods/settings/camera.rst b/docs/source/openmw-mods/settings/camera.rst index 796e117cb4..41dabee408 100644 --- a/docs/source/openmw-mods/settings/camera.rst +++ b/docs/source/openmw-mods/settings/camera.rst @@ -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 ---------------- @@ -72,4 +83,4 @@ first person field of view The floating point setting controls the field of view for first person meshes such as the player's hands and held objects. It is not recommended to change this value from its default value because the Bethesda provided Morrowind assets do not adapt well to large values, while small values can result in the hands not being visible. -The default value is 55.0. This setting can only be configured by editing the settings configuration file. \ No newline at end of file +The default value is 55.0. This setting can only be configured by editing the settings configuration file. diff --git a/files/settings-default.cfg b/files/settings-default.cfg index e17f0235ba..6b98d55990 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -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