Merge pull request #1101 from ZappoMan/keep_local_voxels

Make Keep Local Voxels the Default
This commit is contained in:
Philip Rosedale 2013-10-23 07:13:57 -07:00
commit 5a7561978c
5 changed files with 25 additions and 25 deletions

View file

@ -1643,7 +1643,7 @@ void Application::init() {
_voxels.setMaxVoxels(Menu::getInstance()->getMaxVoxels());
_voxels.setUseVoxelShader(Menu::getInstance()->isOptionChecked(MenuOption::UseVoxelShader));
_voxels.setVoxelsAsPoints(Menu::getInstance()->isOptionChecked(MenuOption::VoxelsAsPoints));
_voxels.setUseFastVoxelPipeline(Menu::getInstance()->isOptionChecked(MenuOption::FastVoxelPipeline));
_voxels.setDisableFastVoxelPipeline(Menu::getInstance()->isOptionChecked(MenuOption::DisableFastVoxelPipeline));
_voxels.init();

View file

@ -287,12 +287,12 @@ Menu::Menu() :
false, this, SLOT(setNewVoxelCullingMode(bool)));
addDisabledActionAndSeparator(cullingOptionsMenu, "Individual Option Settings");
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::FastVoxelPipeline, 0,
false, appInstance->getVoxels(), SLOT(setUseFastVoxelPipeline(bool)));
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DontRemoveOutOfView);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::HideOutOfView);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::UseDeltaFrustumInHide);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::ConstantCulling);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableFastVoxelPipeline, 0,
false, appInstance->getVoxels(), SLOT(setDisableFastVoxelPipeline(bool)));
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::RemoveOutOfView);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableHideOutOfView);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::UseFullFrustumInHide);
addCheckableActionToQMenuAndActionHash(cullingOptionsMenu, MenuOption::DisableConstantCulling);
QMenu* avatarOptionsMenu = developerMenu->addMenu("Avatar Options");
@ -1114,10 +1114,10 @@ void Menu::setNewVoxelCullingMode(bool 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::FastVoxelPipeline, MenuOption::DontRemoveOutOfView, MenuOption::HideOutOfView,
MenuOption::UseDeltaFrustumInHide, MenuOption::ConstantCulling};
bool oldModeValue[] = { false, false, false, false, false };
bool newModeValue[] = { true, true, true, true, true };
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];

View file

@ -134,7 +134,6 @@ namespace MenuOption {
const QString Bandwidth = "Bandwidth Display";
const QString BandwidthDetails = "Bandwidth Details";
const QString Collisions = "Collisions";
const QString ConstantCulling = "Constant Culling";
const QString CopyVoxels = "Copy";
const QString CoverageMap = "Render Coverage Map";
const QString CoverageMapV2 = "Render Coverage Map V2";
@ -144,10 +143,11 @@ namespace MenuOption {
const QString DeleteVoxels = "Delete";
const QString DestructiveAddVoxel = "Create Voxel is Destructive";
const QString DeltaSending = "Delta Sending";
const QString DisableConstantCulling = "Disable Constant Culling";
const QString DisableFastVoxelPipeline = "Disable Fast Voxel Pipeline";
const QString DisplayFrustum = "Display Frustum";
const QString DontRenderVoxels = "Don't call _voxels.render()";
const QString DontCallOpenGLForVoxels = "Don't call glDrawElements()/glDrawRangeElementsEXT() for Voxels";
const QString DontRemoveOutOfView = "Don't Remove Out of View Voxels";
const QString EchoAudio = "Echo Audio";
const QString ExportVoxels = "Export Voxels";
const QString HeadMouse = "Head Mouse";
@ -160,7 +160,6 @@ namespace MenuOption {
const QString FalseColorOccludedV2 = "FALSE Color Occluded V2 Voxels";
const QString FalseColorOutOfView = "FALSE Color Voxel Out of View";
const QString FalseColorRandomly = "FALSE Color Voxels Randomly";
const QString FastVoxelPipeline = "Fast Voxel Pipeline";
const QString FirstPerson = "First Person";
const QString FrameTimer = "Show Timer";
const QString FrustumRenderMode = "Render Mode";
@ -168,7 +167,7 @@ namespace MenuOption {
const QString GlowMode = "Cycle Glow Mode";
const QString GoToDomain = "Go To Domain...";
const QString GoToLocation = "Go To Location...";
const QString HideOutOfView = "Hide Out of View Voxels";
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";
@ -197,6 +196,7 @@ namespace MenuOption {
const QString PipelineWarnings = "Show Render Pipeline Warnings";
const QString Preferences = "Preferences...";
const QString RandomizeVoxelColors = "Randomize Voxel TRUE Colors";
const QString RemoveOutOfView = "Remove Out of View Voxels";
const QString ResetAvatarSize = "Reset Avatar Size";
const QString ResetSwatchColors = "Reset Swatch Colors";
const QString RunTimingTests = "Run Timing Tests";
@ -216,7 +216,7 @@ namespace MenuOption {
const QString TreeStats = "Calculate Tree Stats";
const QString TransmitterDrive = "Transmitter Drive";
const QString Quit = "Quit";
const QString UseDeltaFrustumInHide = "Use Delta View Frustums when Culling";
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";

View file

@ -123,9 +123,10 @@ void VoxelSystem::voxelDeleted(VoxelNode* node) {
}
}
void VoxelSystem::setUseFastVoxelPipeline(bool useFastVoxelPipeline) {
_useFastVoxelPipeline = useFastVoxelPipeline;
printf("setUseFastVoxelPipeline() _useFastVoxelPipeline=%s\n", debug::valueOf(_useFastVoxelPipeline));
void VoxelSystem::setDisableFastVoxelPipeline(bool disableFastVoxelPipeline) {
_useFastVoxelPipeline = !disableFastVoxelPipeline;
printf("setDisableFastVoxelPipeline() disableFastVoxelPipeline=%s _useFastVoxelPipeline=%s\n",
debug::valueOf(disableFastVoxelPipeline), debug::valueOf(_useFastVoxelPipeline));
setupNewVoxelsForDrawing();
}
@ -744,7 +745,7 @@ void VoxelSystem::checkForCulling() {
uint64_t start = usecTimestampNow();
uint64_t sinceLastViewCulling = (start - _lastViewCulling) / 1000;
bool constantCulling = Menu::getInstance()->isOptionChecked(MenuOption::ConstantCulling);
bool constantCulling = !Menu::getInstance()->isOptionChecked(MenuOption::DisableConstantCulling);
// If the view frustum is no longer changing, but has changed, since last time, then remove nodes that are out of view
if (constantCulling || (
@ -757,10 +758,10 @@ 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::HideOutOfView)) {
if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableHideOutOfView)) {
hideOutOfView();
}
if (!Menu::getInstance()->isOptionChecked(MenuOption::DontRemoveOutOfView)) {
if (Menu::getInstance()->isOptionChecked(MenuOption::RemoveOutOfView)) {
removeOutOfView();
}
@ -1810,7 +1811,7 @@ void VoxelSystem::hideOutOfView() {
bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
PerformanceWarning warn(showDebugDetails, "hideOutOfView()", showDebugDetails);
bool widenFrustum = true;
bool wantDeltaFrustums = Menu::getInstance()->isOptionChecked(MenuOption::UseDeltaFrustumInHide);
bool wantDeltaFrustums = !Menu::getInstance()->isOptionChecked(MenuOption::UseFullFrustumInHide);
hideOutOfViewArgs args(this, this->_tree, _culledOnce, widenFrustum, wantDeltaFrustums);
const bool wantViewFrustumDebugging = false; // change to true for additional debugging

View file

@ -141,7 +141,7 @@ public slots:
void cancelImport();
void setUseFastVoxelPipeline(bool useFastVoxelPipeline);
void setDisableFastVoxelPipeline(bool disableFastVoxelPipeline);
void setUseVoxelShader(bool useVoxelShader);
void setVoxelsAsPoints(bool voxelsAsPoints);
@ -193,7 +193,6 @@ private:
static bool forceRedrawEntireTreeOperation(VoxelNode* node, void* extraData);
static bool clearAllNodesBufferIndexOperation(VoxelNode* node, void* extraData);
static bool hideOutOfViewOperation(VoxelNode* node, void* extraData);
static bool hideOutOfViewUnrollOperation(VoxelNode* node, void* extraData);
static bool hideAllSubTreeOperation(VoxelNode* node, void* extraData);
static bool showAllSubTreeOperation(VoxelNode* node, void* extraData);
static bool showAllLocalVoxelsOperation(VoxelNode* node, void* extraData);