mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:13:09 +02:00
wire up different culling options to debug menus
This commit is contained in:
parent
d238d06df5
commit
ffb7bcf9d3
3 changed files with 12 additions and 7 deletions
|
@ -424,10 +424,12 @@ Menu::Menu() :
|
|||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false);
|
||||
|
||||
QMenu* modelDebugMenu = developerMenu->addMenu("Models");
|
||||
addCheckableActionToQMenuAndActionHash(modelDebugMenu, MenuOption::DontCullMeshParts, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(modelDebugMenu, MenuOption::DisplayModelBounds, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(modelDebugMenu, MenuOption::DisplayModelElementProxy, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(modelDebugMenu, MenuOption::DisplayModelElementChildProxies, 0, false);
|
||||
QMenu* modelCullingMenu = modelDebugMenu->addMenu("Culling");
|
||||
addCheckableActionToQMenuAndActionHash(modelCullingMenu, MenuOption::DontCullOutOfViewMeshParts, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(modelCullingMenu, MenuOption::DontCullTooSmallMeshParts, 0, false);
|
||||
|
||||
QMenu* voxelOptionsMenu = developerMenu->addMenu("Voxels");
|
||||
addCheckableActionToQMenuAndActionHash(voxelOptionsMenu, MenuOption::VoxelTextures);
|
||||
|
|
|
@ -372,7 +372,8 @@ namespace MenuOption {
|
|||
const QString Collisions = "Collisions";
|
||||
const QString Console = "Console...";
|
||||
const QString ControlWithSpeech = "Control With Speech";
|
||||
const QString DontCullMeshParts = "Don't Cull Mesh Parts";
|
||||
const QString DontCullOutOfViewMeshParts = "Don't Cull Out Of View Mesh Parts";
|
||||
const QString DontCullTooSmallMeshParts = "Don't Cull Too Small Mesh Parts";
|
||||
const QString DecreaseAvatarSize = "Decrease Avatar Size";
|
||||
const QString DecreaseVoxelSize = "Decrease Voxel Size";
|
||||
const QString DisableActivityLogger = "Disable Activity Logger";
|
||||
|
|
|
@ -1390,8 +1390,6 @@ int Model::renderMeshes(RenderMode mode, bool translucent, float alphaThreshold,
|
|||
const FBXGeometry& geometry = _geometry->getFBXGeometry();
|
||||
const QVector<NetworkMesh>& networkMeshes = _geometry->getMeshes();
|
||||
|
||||
bool cullMeshParts = args && !Menu::getInstance()->isOptionChecked(MenuOption::DontCullMeshParts);
|
||||
|
||||
// depending on which parameters we were called with, pick the correct mesh group to render
|
||||
QVector<int>* whichList = NULL;
|
||||
if (translucent && !hasTangents && !hasSpecular && !isSkinned) {
|
||||
|
@ -1509,12 +1507,16 @@ int Model::renderMeshes(RenderMode mode, bool translucent, float alphaThreshold,
|
|||
|
||||
// if we got here, then check to see if this mesh is in view
|
||||
if (args) {
|
||||
bool dontCullOutOfViewMeshParts = Menu::getInstance()->isOptionChecked(MenuOption::DontCullOutOfViewMeshParts);
|
||||
bool cullTooSmallMeshParts = !Menu::getInstance()->isOptionChecked(MenuOption::DontCullTooSmallMeshParts);
|
||||
|
||||
bool shouldRender = true;
|
||||
args->_meshesConsidered++;
|
||||
|
||||
if (cullMeshParts && args->_viewFrustum) {
|
||||
shouldRender = args->_viewFrustum->boxInFrustum(_calculatedMeshBoxes.at(i)) != ViewFrustum::OUTSIDE;
|
||||
if (shouldRender) {
|
||||
if (args->_viewFrustum) {
|
||||
shouldRender = dontCullOutOfViewMeshParts ||
|
||||
args->_viewFrustum->boxInFrustum(_calculatedMeshBoxes.at(i)) != ViewFrustum::OUTSIDE;
|
||||
if (shouldRender && cullTooSmallMeshParts) {
|
||||
float distance = args->_viewFrustum->distanceToCamera(_calculatedMeshBoxes.at(i).calcCenter());
|
||||
shouldRender = Menu::getInstance()->shouldRenderMesh(_calculatedMeshBoxes.at(i).getLargestDimension(),
|
||||
distance);
|
||||
|
|
Loading…
Reference in a new issue