From d13ebf6095e076d9c78af05e644bf7ab22844a84 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 25 Nov 2013 14:44:34 -0800 Subject: [PATCH] more menu cleanup removing developer options that are now defunct --- interface/src/Application.cpp | 4 +-- interface/src/Menu.cpp | 44 --------------------------- interface/src/Menu.h | 8 ----- interface/src/VoxelSystem.cpp | 11 ++++--- libraries/voxels/src/VoxelConstants.h | 2 +- 5 files changed, 10 insertions(+), 59 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f3917a6b8e..79488e5f04 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1771,7 +1771,7 @@ void Application::init() { _voxels.setMaxVoxels(Menu::getInstance()->getMaxVoxels()); _voxels.setUseVoxelShader(Menu::getInstance()->isOptionChecked(MenuOption::UseVoxelShader)); _voxels.setVoxelsAsPoints(Menu::getInstance()->isOptionChecked(MenuOption::VoxelsAsPoints)); - _voxels.setDisableFastVoxelPipeline(Menu::getInstance()->isOptionChecked(MenuOption::DisableFastVoxelPipeline)); + _voxels.setDisableFastVoxelPipeline(false); _voxels.init(); @@ -3609,7 +3609,7 @@ void Application::displayStats() { // Voxel Rendering voxelStats.str(""); voxelStats.precision(4); - voxelStats << "Voxel Rendering Slots" << + voxelStats << "Voxel Rendering Slots " << "Max: " << _voxels.getMaxVoxels() / 1000.f << "K " << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index d5bdff3d8a..0913858fc1 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -305,23 +305,6 @@ Menu::Menu() : addCheckableActionToQMenuAndActionHash(voxelProtoOptionsMenu, MenuOption::EnableOcclusionCulling); addCheckableActionToQMenuAndActionHash(voxelProtoOptionsMenu, MenuOption::DestructiveAddVoxel); - QMenu* cullingOptionsMenu = voxelOptionsMenu->addMenu("Culling Options"); - addDisabledActionAndSeparator(cullingOptionsMenu, "Standard Settings"); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::OldVoxelCullingMode, 0, - false, this, SLOT(setOldVoxelCullingMode(bool))); - - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::NewVoxelCullingMode, 0, - false, this, SLOT(setNewVoxelCullingMode(bool))); - - addDisabledActionAndSeparator(cullingOptionsMenu, "Individual Option Settings"); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableFastVoxelPipeline, 0, - false, appInstance->getVoxels(), SLOT(setDisableFastVoxelPipeline(bool))); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableHideOutOfView); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::RemoveOutOfView); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::UseFullFrustumInHide); - addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableConstantCulling); - - QMenu* avatarOptionsMenu = developerMenu->addMenu("Avatar Options"); addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::Avatars, 0, true); @@ -1138,30 +1121,3 @@ void Menu::updateFrustumRenderModeAction() { } } -void Menu::setOldVoxelCullingMode(bool oldMode) { - setVoxelCullingMode(oldMode); -} - -void Menu::setNewVoxelCullingMode(bool newMode) { - setVoxelCullingMode(!newMode); -} - -/// This will switch on or off several different individual settings options all at once based on choosing with Old or New -/// voxel culling mode. -void Menu::setVoxelCullingMode(bool oldMode) { - const QString menus[] = { MenuOption::DisableFastVoxelPipeline, MenuOption::RemoveOutOfView, MenuOption::DisableHideOutOfView, - MenuOption::UseFullFrustumInHide, MenuOption::DisableConstantCulling}; - bool oldModeValue[] = { true, true, true, true, true }; - bool newModeValue[] = { false, false, false, false, false }; - - for (int i = 0; i < sizeof(menus) / sizeof(menus[0]); i++) { - bool desiredValue = oldMode ? oldModeValue[i] : newModeValue[i]; - if (isOptionChecked(menus[i]) != desiredValue) { - triggerOption(menus[i]); - } - } - - // set the checkmarks accordingly... - _actionHash.value(MenuOption::OldVoxelCullingMode)->setChecked(oldMode); - _actionHash.value(MenuOption::NewVoxelCullingMode)->setChecked(!oldMode); -} diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 8b832d7bbd..6f5978be8a 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -93,8 +93,6 @@ private slots: void chooseVoxelPaintColor(); void runTests(); void resetSwatchColors(); - void setOldVoxelCullingMode(bool oldMode); - void setNewVoxelCullingMode(bool newMode); private: static Menu* _instance; @@ -124,7 +122,6 @@ private: const char* member = NULL); void updateFrustumRenderModeAction(); - void setVoxelCullingMode(bool oldMode); QHash _actionHash; int _audioJitterBufferSamples; /// number of extra samples to wait before starting audio playback @@ -162,9 +159,7 @@ namespace MenuOption { const QString DeleteVoxels = "Delete"; const QString DestructiveAddVoxel = "Create Voxel is Destructive"; const QString DisableColorVoxels = "Disable Colored Voxels"; - const QString DisableConstantCulling = "Disable Constant Culling"; const QString DisableDeltaSending = "Disable Delta Sending"; - const QString DisableFastVoxelPipeline = "Disable Fast Voxel Pipeline"; const QString DisableLowRes = "Disable Lower Resolution While Moving"; const QString DisplayFrustum = "Display Frustum"; const QString DisplayLeapHands = "Display Leap Hands"; @@ -193,7 +188,6 @@ namespace MenuOption { const QString GlowMode = "Cycle Glow Mode"; const QString GoToDomain = "Go To Domain..."; const QString GoToLocation = "Go To Location..."; - const QString DisableHideOutOfView = "Disable Hide Out of View Voxels"; const QString GoToUser = "Go To User..."; const QString ImportVoxels = "Import Voxels"; const QString ImportVoxelsClipboard = "Import Voxels to Clipboard"; @@ -224,7 +218,6 @@ namespace MenuOption { const QString PipelineWarnings = "Show Render Pipeline Warnings"; const QString Preferences = "Preferences..."; const QString RandomizeVoxelColors = "Randomize Voxel TRUE Colors"; - const QString RemoveOutOfView = "Instead of Hide Remove Out of View Voxels"; const QString ResetAvatarSize = "Reset Avatar Size"; const QString ResetSwatchColors = "Reset Swatch Colors"; const QString RunTimingTests = "Run Timing Tests"; @@ -244,7 +237,6 @@ namespace MenuOption { const QString TreeStats = "Calculate Tree Stats"; const QString TransmitterDrive = "Transmitter Drive"; const QString Quit = "Quit"; - const QString UseFullFrustumInHide = "Use Full View Frustums when Culling"; const QString UseVoxelShader = "Use Voxel Shader"; const QString VoxelsAsPoints = "Draw Voxels as Points"; const QString Voxels = "Voxels"; diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 627c86ef93..9e82c61351 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -774,7 +774,10 @@ void VoxelSystem::checkForCulling() { uint64_t start = usecTimestampNow(); uint64_t sinceLastViewCulling = (start - _lastViewCulling) / 1000; - bool constantCulling = !Menu::getInstance()->isOptionChecked(MenuOption::DisableConstantCulling); + // These items used to be menu options, we are not defaulting to and only supporting these modes. + bool constantCulling = true; + bool performHideOutOfViewLogic = true; + bool performRemoveOutOfViewLogic = false; // If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view if (constantCulling || ( @@ -785,7 +788,7 @@ void VoxelSystem::checkForCulling() { // When we call removeOutOfView() voxels, we don't actually remove the voxels from the VBOs, but we do remove // them from tree, this makes our tree caclulations faster, but doesn't require us to fully rebuild the VBOs (which // can be expensive). - if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableHideOutOfView)) { + if (performHideOutOfViewLogic) { // track how long its been since we were last moving. If we have recently moved then only use delta frustums, if // it's been a long time since we last moved, then go ahead and do a full frustum cull. @@ -819,7 +822,7 @@ void VoxelSystem::checkForCulling() { _lastViewCullingElapsed = (endViewCulling - start) / 1000; } - } else if (Menu::getInstance()->isOptionChecked(MenuOption::RemoveOutOfView)) { + } else if (performRemoveOutOfViewLogic) { _lastViewCulling = start; removeOutOfView(); uint64_t endViewCulling = usecTimestampNow(); @@ -1943,7 +1946,7 @@ void VoxelSystem::hideOutOfView(bool forceFullFrustum) { // Both these problems are solved by intermittently calling this with forceFullFrustum set // to true. This will essentially clean up the improperly hidden or shown voxels. // - bool wantDeltaFrustums = !forceFullFrustum && !Menu::getInstance()->isOptionChecked(MenuOption::UseFullFrustumInHide); + bool wantDeltaFrustums = !forceFullFrustum; hideOutOfViewArgs args(this, this->_tree, _culledOnce, widenFrustum, wantDeltaFrustums); const bool wantViewFrustumDebugging = false; // change to true for additional debugging diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h index 3a66f6f564..e9bc48f9b5 100644 --- a/libraries/voxels/src/VoxelConstants.h +++ b/libraries/voxels/src/VoxelConstants.h @@ -36,7 +36,7 @@ const float MAX_LOD_SIZE_MULTIPLIER = 2000.0f; const int NUMBER_OF_CHILDREN = 8; const int MAX_TREE_SLICE_BYTES = 26; -const int DEFAULT_MAX_VOXELS_PER_SYSTEM = 200000; +const int DEFAULT_MAX_VOXELS_PER_SYSTEM = 500000; const int VERTICES_PER_VOXEL = 24; // 6 sides * 4 corners per side const int VERTEX_POINTS_PER_VOXEL = 3 * VERTICES_PER_VOXEL; // xyz for each VERTICE_PER_VOXEL const int INDICES_PER_VOXEL = 3 * 12; // 6 sides * 2 triangles per size * 3 vertices per triangle