mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
allow client to set voxels MaxPPS in Preferences
This commit is contained in:
parent
d13ebf6095
commit
63a82af449
3 changed files with 23 additions and 3 deletions
|
@ -2643,15 +2643,16 @@ void Application::queryVoxels() {
|
||||||
int perServerPPS = 0;
|
int perServerPPS = 0;
|
||||||
const int SMALL_BUDGET = 10;
|
const int SMALL_BUDGET = 10;
|
||||||
int perUnknownServer = SMALL_BUDGET;
|
int perUnknownServer = SMALL_BUDGET;
|
||||||
|
int totalPPS = Menu::getInstance()->getMaxVoxelPacketsPerSecond();
|
||||||
|
|
||||||
// determine PPS based on number of servers
|
// determine PPS based on number of servers
|
||||||
if (inViewServers >= 1) {
|
if (inViewServers >= 1) {
|
||||||
// set our preferred PPS to be exactly evenly divided among all of the voxel servers... and allocate 1 PPS
|
// set our preferred PPS to be exactly evenly divided among all of the voxel servers... and allocate 1 PPS
|
||||||
// for each unknown jurisdiction server
|
// for each unknown jurisdiction server
|
||||||
perServerPPS = (DEFAULT_MAX_VOXEL_PPS / inViewServers) - (unknownJurisdictionServers * perUnknownServer);
|
perServerPPS = (totalPPS / inViewServers) - (unknownJurisdictionServers * perUnknownServer);
|
||||||
} else {
|
} else {
|
||||||
if (unknownJurisdictionServers > 0) {
|
if (unknownJurisdictionServers > 0) {
|
||||||
perUnknownServer = (DEFAULT_MAX_VOXEL_PPS / unknownJurisdictionServers);
|
perUnknownServer = (totalPPS / unknownJurisdictionServers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,8 @@ Menu::Menu() :
|
||||||
_lodToolsDialog(NULL),
|
_lodToolsDialog(NULL),
|
||||||
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
||||||
_voxelSizeScale(DEFAULT_VOXEL_SIZE_SCALE),
|
_voxelSizeScale(DEFAULT_VOXEL_SIZE_SCALE),
|
||||||
_boundaryLevelAdjust(0)
|
_boundaryLevelAdjust(0),
|
||||||
|
_maxVoxelPacketsPerSecond(DEFAULT_MAX_VOXEL_PPS)
|
||||||
{
|
{
|
||||||
Application *appInstance = Application::getInstance();
|
Application *appInstance = Application::getInstance();
|
||||||
|
|
||||||
|
@ -506,6 +507,7 @@ void Menu::loadSettings(QSettings* settings) {
|
||||||
_fieldOfView = loadSetting(settings, "fieldOfView", DEFAULT_FIELD_OF_VIEW_DEGREES);
|
_fieldOfView = loadSetting(settings, "fieldOfView", DEFAULT_FIELD_OF_VIEW_DEGREES);
|
||||||
_faceshiftEyeDeflection = loadSetting(settings, "faceshiftEyeDeflection", DEFAULT_FACESHIFT_EYE_DEFLECTION);
|
_faceshiftEyeDeflection = loadSetting(settings, "faceshiftEyeDeflection", DEFAULT_FACESHIFT_EYE_DEFLECTION);
|
||||||
_maxVoxels = loadSetting(settings, "maxVoxels", DEFAULT_MAX_VOXELS_PER_SYSTEM);
|
_maxVoxels = loadSetting(settings, "maxVoxels", DEFAULT_MAX_VOXELS_PER_SYSTEM);
|
||||||
|
_maxVoxelPacketsPerSecond = loadSetting(settings, "maxVoxelsPPS", DEFAULT_MAX_VOXEL_PPS);
|
||||||
_voxelSizeScale = loadSetting(settings, "voxelSizeScale", DEFAULT_VOXEL_SIZE_SCALE);
|
_voxelSizeScale = loadSetting(settings, "voxelSizeScale", DEFAULT_VOXEL_SIZE_SCALE);
|
||||||
_boundaryLevelAdjust = loadSetting(settings, "boundaryLevelAdjust", 0);
|
_boundaryLevelAdjust = loadSetting(settings, "boundaryLevelAdjust", 0);
|
||||||
|
|
||||||
|
@ -535,6 +537,7 @@ void Menu::saveSettings(QSettings* settings) {
|
||||||
settings->setValue("fieldOfView", _fieldOfView);
|
settings->setValue("fieldOfView", _fieldOfView);
|
||||||
settings->setValue("faceshiftEyeDeflection", _faceshiftEyeDeflection);
|
settings->setValue("faceshiftEyeDeflection", _faceshiftEyeDeflection);
|
||||||
settings->setValue("maxVoxels", _maxVoxels);
|
settings->setValue("maxVoxels", _maxVoxels);
|
||||||
|
settings->setValue("maxVoxelsPPS", _maxVoxelPacketsPerSecond);
|
||||||
settings->setValue("voxelSizeScale", _voxelSizeScale);
|
settings->setValue("voxelSizeScale", _voxelSizeScale);
|
||||||
settings->setValue("boundaryLevelAdjust", _boundaryLevelAdjust);
|
settings->setValue("boundaryLevelAdjust", _boundaryLevelAdjust);
|
||||||
settings->beginGroup("View Frustum Offset Camera");
|
settings->beginGroup("View Frustum Offset Camera");
|
||||||
|
@ -815,6 +818,16 @@ void Menu::editPreferences() {
|
||||||
maxVoxels->setSingleStep(STEP_MAX_VOXELS);
|
maxVoxels->setSingleStep(STEP_MAX_VOXELS);
|
||||||
maxVoxels->setValue(_maxVoxels);
|
maxVoxels->setValue(_maxVoxels);
|
||||||
form->addRow("Maximum Voxels:", maxVoxels);
|
form->addRow("Maximum Voxels:", maxVoxels);
|
||||||
|
|
||||||
|
QSpinBox* maxVoxelsPPS = new QSpinBox();
|
||||||
|
const int MAX_MAX_VOXELS_PPS = 6000;
|
||||||
|
const int MIN_MAX_VOXELS_PPS = 60;
|
||||||
|
const int STEP_MAX_VOXELS_PPS = 10;
|
||||||
|
maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS);
|
||||||
|
maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS);
|
||||||
|
maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS);
|
||||||
|
maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond);
|
||||||
|
form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS);
|
||||||
|
|
||||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept()));
|
dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept()));
|
||||||
|
@ -854,6 +867,8 @@ void Menu::editPreferences() {
|
||||||
|
|
||||||
_maxVoxels = maxVoxels->value();
|
_maxVoxels = maxVoxels->value();
|
||||||
applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels);
|
applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels);
|
||||||
|
|
||||||
|
_maxVoxelPacketsPerSecond = maxVoxelsPPS->value();
|
||||||
|
|
||||||
applicationInstance->getAvatar()->setLeanScale(leanScale->value());
|
applicationInstance->getAvatar()->setLeanScale(leanScale->value());
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,9 @@ public:
|
||||||
void setBoundaryLevelAdjust(int boundaryLevelAdjust);
|
void setBoundaryLevelAdjust(int boundaryLevelAdjust);
|
||||||
int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; }
|
int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; }
|
||||||
|
|
||||||
|
// User Tweakable PPS from Voxel Server
|
||||||
|
int getMaxVoxelPacketsPerSecond() const { return _maxVoxelPacketsPerSecond; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void bandwidthDetails();
|
void bandwidthDetails();
|
||||||
void voxelStatsDetails();
|
void voxelStatsDetails();
|
||||||
|
@ -137,6 +140,7 @@ private:
|
||||||
float _voxelSizeScale;
|
float _voxelSizeScale;
|
||||||
int _boundaryLevelAdjust;
|
int _boundaryLevelAdjust;
|
||||||
QAction* _useVoxelShader;
|
QAction* _useVoxelShader;
|
||||||
|
int _maxVoxelPacketsPerSecond;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace MenuOption {
|
namespace MenuOption {
|
||||||
|
|
Loading…
Reference in a new issue