mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
added settings for rendering distance of small objects
This commit is contained in:
parent
2b4b941192
commit
e5cc9adbb0
2 changed files with 22 additions and 7 deletions
|
@ -89,18 +89,16 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
NifOgre::NIFLoader::load(mesh);
|
NifOgre::NIFLoader::load(mesh);
|
||||||
Ogre::Entity *ent = mRenderer.getScene()->createEntity(mesh);
|
Ogre::Entity *ent = mRenderer.getScene()->createEntity(mesh);
|
||||||
|
|
||||||
/*
|
|
||||||
Ogre::Vector3 extents = ent->getBoundingBox().getSize();
|
Ogre::Vector3 extents = ent->getBoundingBox().getSize();
|
||||||
extents *= insert->getScale();
|
extents *= insert->getScale();
|
||||||
// float size = std::max(std::max(extents.x, extents.y), extents.z);
|
float size = std::max(std::max(extents.x, extents.y), extents.z);
|
||||||
|
|
||||||
bool small = (size < 250); /// \todo config value
|
bool small = (size < Settings::Manager::getInt("small object size", "Objects")) && Settings::Manager::getBool("limit small object distance", "Objects");
|
||||||
|
|
||||||
// do not fade out doors. that will cause holes and look stupid
|
// do not fade out doors. that will cause holes and look stupid
|
||||||
if (ptr.getTypeName().find("Door") != std::string::npos)
|
if (ptr.getTypeName().find("Door") != std::string::npos)
|
||||||
small = false;
|
small = false;
|
||||||
*/
|
|
||||||
const bool small = false;
|
|
||||||
|
|
||||||
if (mBounds.find(ptr.getCell()) == mBounds.end())
|
if (mBounds.find(ptr.getCell()) == mBounds.end())
|
||||||
mBounds[ptr.getCell()] = Ogre::AxisAlignedBox::BOX_NULL;
|
mBounds[ptr.getCell()] = Ogre::AxisAlignedBox::BOX_NULL;
|
||||||
|
@ -118,7 +116,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
{
|
{
|
||||||
insert->attachObject(ent);
|
insert->attachObject(ent);
|
||||||
|
|
||||||
ent->setRenderingDistance(small ? 2500 : 0); /// \todo config value
|
ent->setRenderingDistance(small ? Settings::Manager::getInt("small object distance", "Objects") : 0); /// \todo config value
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -132,7 +130,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
||||||
mStaticGeometrySmall[ptr.getCell()] = sg;
|
mStaticGeometrySmall[ptr.getCell()] = sg;
|
||||||
|
|
||||||
sg->setRenderingDistance(2500); /// \todo config value
|
sg->setRenderingDistance(Settings::Manager::getInt("small object distance", "Objects")); /// \todo config value
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sg = mStaticGeometrySmall[ptr.getCell()];
|
sg = mStaticGeometrySmall[ptr.getCell()];
|
||||||
|
|
|
@ -1,7 +1,24 @@
|
||||||
[Objects]
|
[Objects]
|
||||||
|
|
||||||
shaders = true
|
shaders = true
|
||||||
|
|
||||||
|
# Max. number of lights that affect objects. Setting to 1 will only reflect sunlight
|
||||||
|
# Note: has no effect when shaders are turned off
|
||||||
num lights = 8
|
num lights = 8
|
||||||
|
|
||||||
|
# Use static geometry for static objects. Improves rendering speed.
|
||||||
use static geometry = true
|
use static geometry = true
|
||||||
|
|
||||||
|
# Limit the rendering distance of small objects
|
||||||
|
limit small object distance = false
|
||||||
|
|
||||||
|
# Size below which an object is considered as small
|
||||||
|
small object size = 250
|
||||||
|
|
||||||
|
# Rendering distance for small objects
|
||||||
|
small object distance = 3500
|
||||||
|
|
||||||
[Terrain]
|
[Terrain]
|
||||||
|
|
||||||
|
# Max. number of lights that affect the terrain. Setting to 1 will only reflect sunlight
|
||||||
num lights = 8
|
num lights = 8
|
||||||
|
|
Loading…
Reference in a new issue