mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
add ability to set the type of near far method to be used in shadow calculation; default to bounding volumes; cleaned up code while there and re-ordered items
This commit is contained in:
parent
476a74c2d3
commit
ae729a1ac7
6 changed files with 131 additions and 94 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <osgShadow/ShadowedScene>
|
||||
|
||||
#include <components/misc/stringops.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
namespace SceneUtil
|
||||
|
@ -38,11 +39,14 @@ namespace SceneUtil
|
|||
}
|
||||
|
||||
mShadowSettings->setMinimumShadowMapNearFarRatio(Settings::Manager::getFloat("minimum lispsm near far ratio", "Shadows"));
|
||||
if (Settings::Manager::getBool("compute tight scene bounds", "Shadows"))
|
||||
|
||||
std::string computeNearFarMode = Settings::Manager::getString("near far computation", "Shadows");
|
||||
if (Misc::StringUtils::lowerCase(computeNearFarMode) == "primitives")
|
||||
mShadowSettings->setComputeNearFarModeOverride(osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES);
|
||||
else
|
||||
else if (Misc::StringUtils::lowerCase(computeNearFarMode) == "bounding volumes")
|
||||
mShadowSettings->setComputeNearFarModeOverride(osg::CullSettings::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES);
|
||||
|
||||
|
||||
int mapres = Settings::Manager::getInt("shadow map resolution", "Shadows");
|
||||
mShadowSettings->setTextureSize(osg::Vec2s(mapres, mapres));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue