History

Merge branch 'master' of https://github.com/highfidelity/hifi into OculusSDK

barnold1953 committed 12 years ago

Commit 6e92bee2 parents 8147f2c af6704a50 files · +873 −253Browse files

Showing the changes to interface/src/Application.cpp (1 of 50 files). Show all

Unified · Split

interface/src/Application.cpp+82−81
@@ -354,6 +354,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 353 unmodified lines
354 354
355 // Set the sixense filtering355 // Set the sixense filtering
356 _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));356 _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
357
358 // Set hand controller velocity filtering
359 _sixenseManager.setLowVelocityFilter(Menu::getInstance()->isOptionChecked(MenuOption::LowVelocityFilter));
357 360
358 checkVersion();361 checkVersion();
359 362
@@ -601,9 +604,19 @@ void Application::paintGL() { · 241 unmodified lines
601 604
602 } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {605 } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
603 _myCamera.setTightness(0.0f);606 _myCamera.setTightness(0.0f);
604 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);607 //Only behave like a true mirror when in the OR
605 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));608 if (OculusManager::isConnected()) {
606 _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0));609 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
610 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));
611 _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0));
612 } else {
613 _myCamera.setTightness(0.0f);
614 glm::vec3 eyePosition = _myAvatar->getHead()->calculateAverageEyePosition();
615 float headHeight = eyePosition.y - _myAvatar->getPosition().y;
616 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
617 _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0));
618 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));
619 }
607 }620 }
608 621
609 // Update camera position622 // Update camera position
@@ -682,13 +695,10 @@ void Application::paintGL() { · 72 unmodified lines
682 }695 }
683 696
684 {697 {
685 PerformanceTimer perfTimer("paintGL/renderOverlay");698 PerformanceTimer perfTimer("renderOverlay");
686 //If alpha is 1, we can render directly to the screen.699 // PrioVR will only work if renderOverlay is called, calibration is connected to Application::renderingOverlay()
687 if (_applicationOverlay.getAlpha() == 1.0f) {700 _applicationOverlay.renderOverlay(true);
688 _applicationOverlay.renderOverlay();701 if (Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) {
689 } else {
690 //Render to to texture so we can fade it
691 _applicationOverlay.renderOverlay(true);
692 _applicationOverlay.displayOverlayTexture();702 _applicationOverlay.displayOverlayTexture();
693 }703 }
694 }704 }
@@ -713,6 +723,7 @@ void Application::resizeGL(int width, int height) { · 18 unmodified lines
713 resetCamerasOnResizeGL(_myCamera, width, height);723 resetCamerasOnResizeGL(_myCamera, width, height);
714 724
715 glViewport(0, 0, width, height); // shouldn't this account for the menu???725 glViewport(0, 0, width, height); // shouldn't this account for the menu???
726 _applicationOverlay.resize();
716 727
717 updateProjectionMatrix();728 updateProjectionMatrix();
718 glLoadIdentity();729 glLoadIdentity();
@@ -1010,6 +1021,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 291 unmodified lines
1010 Menu::getInstance()->triggerOption(MenuOption::FullscreenMirror);1021 Menu::getInstance()->triggerOption(MenuOption::FullscreenMirror);
1011 }1022 }
1012 break;1023 break;
1024 case Qt::Key_Slash:
1025 Menu::getInstance()->triggerOption(MenuOption::UserInterface);
1026 break;
1013 case Qt::Key_F:1027 case Qt::Key_F:
1014 if (isShifted) {1028 if (isShifted) {
1015 Menu::getInstance()->triggerOption(MenuOption::DisplayFrustum);1029 Menu::getInstance()->triggerOption(MenuOption::DisplayFrustum);
@@ -1029,7 +1043,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 13 unmodified lines
1029 }1043 }
1030 break;1044 break;
1031 break;1045 break;
1032 case Qt::Key_Slash:1046 case Qt::Key_Percent:
1033 Menu::getInstance()->triggerOption(MenuOption::Stats);1047 Menu::getInstance()->triggerOption(MenuOption::Stats);
1034 break;1048 break;
1035 case Qt::Key_Plus:1049 case Qt::Key_Plus:
@@ -1355,18 +1369,18 @@ void Application::idle() { · 319 unmodified lines
1355 if (timeSinceLastUpdate > IDLE_SIMULATE_MSECS) {1369 if (timeSinceLastUpdate > IDLE_SIMULATE_MSECS) {
1356 _lastTimeUpdated.start();1370 _lastTimeUpdated.start();
1357 {1371 {
1358 PerformanceTimer perfTimer("idle/update");1372 PerformanceTimer perfTimer("update");
1359 PerformanceWarning warn(showWarnings, "Application::idle()... update()");1373 PerformanceWarning warn(showWarnings, "Application::idle()... update()");
1360 const float BIGGEST_DELTA_TIME_SECS = 0.25f;1374 const float BIGGEST_DELTA_TIME_SECS = 0.25f;
1361 update(glm::clamp((float)timeSinceLastUpdate / 1000.f, 0.f, BIGGEST_DELTA_TIME_SECS));1375 update(glm::clamp((float)timeSinceLastUpdate / 1000.f, 0.f, BIGGEST_DELTA_TIME_SECS));
1362 }1376 }
1363 {1377 {
1364 PerformanceTimer perfTimer("idle/updateGL");1378 PerformanceTimer perfTimer("updateGL");
1365 PerformanceWarning warn(showWarnings, "Application::idle()... updateGL()");1379 PerformanceWarning warn(showWarnings, "Application::idle()... updateGL()");
1366 _glWidget->updateGL();1380 _glWidget->updateGL();
1367 }1381 }
1368 {1382 {
1369 PerformanceTimer perfTimer("idle/rest");1383 PerformanceTimer perfTimer("rest");
1370 PerformanceWarning warn(showWarnings, "Application::idle()... rest of it");1384 PerformanceWarning warn(showWarnings, "Application::idle()... rest of it");
1371 _idleLoopStdev.addValue(timeSinceLastUpdate);1385 _idleLoopStdev.addValue(timeSinceLastUpdate);
1372 1386
@@ -1378,7 +1392,7 @@ void Application::idle() { · 5 unmodified lines
1378 }1392 }
1379 1393
1380 if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) {1394 if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) {
1381 PerformanceTimer perfTimer("idle/rest/_buckyBalls");1395 PerformanceTimer perfTimer("buckyBalls");
1382 _buckyBalls.simulate(timeSinceLastUpdate / 1000.f, Application::getInstance()->getAvatar()->getHandData());1396 _buckyBalls.simulate(timeSinceLastUpdate / 1000.f, Application::getInstance()->getAvatar()->getHandData());
1383 }1397 }
1384 1398
@@ -1426,6 +1440,10 @@ void Application::setRenderVoxels(bool voxelRender) { · 41 unmodified lines
1426 }1440 }
1427}1441}
1428 1442
1443void Application::setLowVelocityFilter(bool lowVelocityFilter) {
1444 getSixenseManager()->setLowVelocityFilter(lowVelocityFilter);
1445}
1446
1429void Application::doKillLocalVoxels() {1447void Application::doKillLocalVoxels() {
1430 _wantToKillLocalVoxels = true;1448 _wantToKillLocalVoxels = true;
1431}1449}
@@ -1792,7 +1810,7 @@ bool Application::isLookingAtMyAvatar(Avatar* avatar) { · 360 unmodified lines
1792}1810}
1793 1811
1794void Application::updateLOD() {1812void Application::updateLOD() {
1795 PerformanceTimer perfTimer("idle/update/updateLOD");1813 PerformanceTimer perfTimer("LOD");
1796 // adjust it unless we were asked to disable this feature, or if we're currently in throttleRendering mode1814 // adjust it unless we were asked to disable this feature, or if we're currently in throttleRendering mode
1797 if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableAutoAdjustLOD) && !isThrottleRendering()) {1815 if (!Menu::getInstance()->isOptionChecked(MenuOption::DisableAutoAdjustLOD) && !isThrottleRendering()) {
1798 Menu::getInstance()->autoAdjustLOD(_fps);1816 Menu::getInstance()->autoAdjustLOD(_fps);
@@ -1802,7 +1820,7 @@ void Application::updateLOD() { · 3 unmodified lines
1802}1820}
1803 1821
1804void Application::updateMouseRay() {1822void Application::updateMouseRay() {
1805 PerformanceTimer perfTimer("idle/update/updateMouseRay");1823 PerformanceTimer perfTimer("mouseRay");
1806 1824
1807 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1825 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1808 PerformanceWarning warn(showWarnings, "Application::updateMouseRay()");1826 PerformanceWarning warn(showWarnings, "Application::updateMouseRay()");
@@ -1835,8 +1853,6 @@ void Application::updateMouseRay() { · 26 unmodified lines
1835}1853}
1836 1854
1837void Application::updateFaceshift() {1855void Application::updateFaceshift() {
1838 PerformanceTimer perfTimer("idle/update/updateFaceshift");
1839
1840 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1856 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1841 PerformanceWarning warn(showWarnings, "Application::updateFaceshift()");1857 PerformanceWarning warn(showWarnings, "Application::updateFaceshift()");
1842 1858
@@ -1850,8 +1866,6 @@ void Application::updateFaceshift() { · 7 unmodified lines
1850}1866}
1851 1867
1852void Application::updateVisage() {1868void Application::updateVisage() {
1853 PerformanceTimer perfTimer("idle/update/updateVisage");
1854
1855 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1869 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1856 PerformanceWarning warn(showWarnings, "Application::updateVisage()");1870 PerformanceWarning warn(showWarnings, "Application::updateVisage()");
1857 1871
@@ -1860,11 +1874,11 @@ void Application::updateVisage() { · 2 unmodified lines
1860}1874}
1861 1875
1862void Application::updateMyAvatarLookAtPosition() {1876void Application::updateMyAvatarLookAtPosition() {
1863 PerformanceTimer perfTimer("idle/update/updateMyAvatarLookAtPosition");1877 PerformanceTimer perfTimer("lookAt");
1864
1865 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1878 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1866 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");1879 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
1867 1880
1881 _myAvatar->updateLookAtTargetAvatar();
1868 FaceTracker* tracker = getActiveFaceTracker();1882 FaceTracker* tracker = getActiveFaceTracker();
1869 1883
1870 bool isLookingAtSomeone = false;1884 bool isLookingAtSomeone = false;
@@ -1927,7 +1941,7 @@ void Application::updateMyAvatarLookAtPosition() { · 56 unmodified lines
1927}1941}
1928 1942
1929void Application::updateThreads(float deltaTime) {1943void Application::updateThreads(float deltaTime) {
1930 PerformanceTimer perfTimer("idle/update/updateThreads");1944 PerformanceTimer perfTimer("updateThreads");
1931 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1945 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1932 PerformanceWarning warn(showWarnings, "Application::updateThreads()");1946 PerformanceWarning warn(showWarnings, "Application::updateThreads()");
1933 1947
@@ -1942,7 +1956,7 @@ void Application::updateThreads(float deltaTime) { · 8 unmodified lines
1942}1956}
1943 1957
1944void Application::updateMetavoxels(float deltaTime) {1958void Application::updateMetavoxels(float deltaTime) {
1945 PerformanceTimer perfTimer("idle/update/updateMetavoxels");1959 PerformanceTimer perfTimer("updateMetavoxels");
1946 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1960 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1947 PerformanceWarning warn(showWarnings, "Application::updateMetavoxels()");1961 PerformanceWarning warn(showWarnings, "Application::updateMetavoxels()");
1948 1962
@@ -1972,7 +1986,7 @@ void Application::cameraMenuChanged() { · 23 unmodified lines
1972}1986}
1973 1987
1974void Application::updateCamera(float deltaTime) {1988void Application::updateCamera(float deltaTime) {
1975 PerformanceTimer perfTimer("idle/update/updateCamera");1989 PerformanceTimer perfTimer("updateCamera");
1976 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1990 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1977 PerformanceWarning warn(showWarnings, "Application::updateCamera()");1991 PerformanceWarning warn(showWarnings, "Application::updateCamera()");
1978 1992
@@ -1990,7 +2004,7 @@ void Application::updateCamera(float deltaTime) { · 11 unmodified lines
1990}2004}
1991 2005
1992void Application::updateDialogs(float deltaTime) {2006void Application::updateDialogs(float deltaTime) {
1993 PerformanceTimer perfTimer("idle/update/updateDialogs");2007 PerformanceTimer perfTimer("updateDialogs");
1994 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2008 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1995 PerformanceWarning warn(showWarnings, "Application::updateDialogs()");2009 PerformanceWarning warn(showWarnings, "Application::updateDialogs()");
1996 2010
@@ -2007,7 +2021,7 @@ void Application::updateDialogs(float deltaTime) { · 10 unmodified lines
2007}2021}
2008 2022
2009void Application::updateCursor(float deltaTime) {2023void Application::updateCursor(float deltaTime) {
2010 PerformanceTimer perfTimer("idle/update/updateCursor");2024 PerformanceTimer perfTimer("updateCursor");
2011 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2025 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2012 PerformanceWarning warn(showWarnings, "Application::updateCursor()");2026 PerformanceWarning warn(showWarnings, "Application::updateCursor()");
2013 2027
@@ -2032,83 +2046,69 @@ void Application::updateCursor(float deltaTime) { · 18 unmodified lines
2032}2046}
2033 2047
2034void Application::update(float deltaTime) {2048void Application::update(float deltaTime) {
2035 //PerformanceTimer perfTimer("idle/update"); // NOTE: we track this above in Application::idle()
2036
2037 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2049 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2038 PerformanceWarning warn(showWarnings, "Application::update()");2050 PerformanceWarning warn(showWarnings, "Application::update()");
2039 2051
2040 updateLOD();2052 updateLOD();
2041 updateMouseRay(); // check what's under the mouse and update the mouse voxel2053 updateMouseRay(); // check what's under the mouse and update the mouse voxel
2042 updateFaceshift();
2043 updateVisage();
2044
2045 {
2046 PerformanceTimer perfTimer("idle/update/updateLookAtTargetAvatar");
2047 _myAvatar->updateLookAtTargetAvatar();
2048 }
2049 updateMyAvatarLookAtPosition();
2050 {2054 {
2051 PerformanceTimer perfTimer("idle/update/sixense,joystick,prioVR");2055 PerformanceTimer perfTimer("devices");
2056 updateFaceshift();
2057 updateVisage();
2052 _sixenseManager.update(deltaTime);2058 _sixenseManager.update(deltaTime);
2053 _joystickManager.update();2059 _joystickManager.update();
2054 _prioVR.update(deltaTime);2060 _prioVR.update(deltaTime);
2055 }2061 }
2056
2057 {2062 {
2058 PerformanceTimer perfTimer("idle/update/updateMyAvatar");2063 PerformanceTimer perfTimer("myAvatar");
2064 updateMyAvatarLookAtPosition();
2059 updateMyAvatar(deltaTime); // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes2065 updateMyAvatar(deltaTime); // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes
2060 }2066 }
2061 2067
2062 updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process...2068 updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process...
2063 2069
2064 {2070 _avatarManager.updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them...
2065 PerformanceTimer perfTimer("idle/update/_avatarManager");2071
2066 _avatarManager.updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them...
2067 }
2068 updateMetavoxels(deltaTime); // update metavoxels2072 updateMetavoxels(deltaTime); // update metavoxels
2069 updateCamera(deltaTime); // handle various camera tweaks like off axis projection2073 updateCamera(deltaTime); // handle various camera tweaks like off axis projection
2070 updateDialogs(deltaTime); // update various stats dialogs if present2074 updateDialogs(deltaTime); // update various stats dialogs if present
2071 updateCursor(deltaTime); // Handle cursor updates2075 updateCursor(deltaTime); // Handle cursor updates
2072 2076
2073 {2077 {
2074 PerformanceTimer perfTimer("idle/update/_particles");2078 PerformanceTimer perfTimer("particles");
2075 _particles.update(); // update the particles...2079 _particles.update(); // update the particles...
2076 }2080 {
2077 {2081 PerformanceTimer perfTimer("collisions");
2078 PerformanceTimer perfTimer("idle/update/_particleCollisionSystem");2082 _particleCollisionSystem.update(); // collide the particles...
2079 _particleCollisionSystem.update(); // collide the particles...2083 }
2080 }2084 }
2081 2085
2082 {2086 {
2083 PerformanceTimer perfTimer("idle/update/_models");2087 PerformanceTimer perfTimer("models");
2084 _models.update(); // update the models...2088 _models.update(); // update the models...
2085 }2089 }
2086 2090
2087 {2091 {
2088 PerformanceTimer perfTimer("idle/update/_overlays");2092 PerformanceTimer perfTimer("overlays");
2089 _overlays.update(deltaTime);2093 _overlays.update(deltaTime);
2090 }2094 }
2091 2095
2092 {2096 {
2093 PerformanceTimer perfTimer("idle/update/emit simulating");2097 PerformanceTimer perfTimer("emitSimulating");
2094 // let external parties know we're updating2098 // let external parties know we're updating
2095 emit simulating(deltaTime);2099 emit simulating(deltaTime);
2096 }2100 }
2097}2101}
2098 2102
2099void Application::updateMyAvatar(float deltaTime) {2103void Application::updateMyAvatar(float deltaTime) {
2100 PerformanceTimer perfTimer("updateMyAvatar");
2101 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2104 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2102 PerformanceWarning warn(showWarnings, "Application::updateMyAvatar()");2105 PerformanceWarning warn(showWarnings, "Application::updateMyAvatar()");
2103 2106
2104 {2107 _myAvatar->update(deltaTime);
2105 PerformanceTimer perfTimer("updateMyAvatar/_myAvatar->update()");
2106 _myAvatar->update(deltaTime);
2107 }
2108 2108
2109 {2109 {
2110 // send head/hand data to the avatar mixer and voxel server2110 // send head/hand data to the avatar mixer and voxel server
2111 PerformanceTimer perfTimer("updateMyAvatar/sendToAvatarMixer");2111 PerformanceTimer perfTimer("send");
2112 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);2112 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);
2113 packet.append(_myAvatar->toByteArray());2113 packet.append(_myAvatar->toByteArray());
2114 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);2114 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);
@@ -2121,13 +2121,13 @@ void Application::updateMyAvatar(float deltaTime) { · 6 unmodified lines
2121 // actually need to calculate the view frustum planes to send these details2121 // actually need to calculate the view frustum planes to send these details
2122 // to the server.2122 // to the server.
2123 {2123 {
2124 PerformanceTimer perfTimer("updateMyAvatar/loadViewFrustum");2124 PerformanceTimer perfTimer("loadViewFrustum");
2125 loadViewFrustum(_myCamera, _viewFrustum);2125 loadViewFrustum(_myCamera, _viewFrustum);
2126 }2126 }
2127 2127
2128 // Update my voxel servers with my current voxel query...2128 // Update my voxel servers with my current voxel query...
2129 {2129 {
2130 PerformanceTimer perfTimer("updateMyAvatar/queryOctree");2130 PerformanceTimer perfTimer("queryOctree");
2131 quint64 now = usecTimestampNow();2131 quint64 now = usecTimestampNow();
2132 quint64 sinceLastQuery = now - _lastQueriedTime;2132 quint64 sinceLastQuery = now - _lastQueriedTime;
2133 const quint64 TOO_LONG_SINCE_LAST_QUERY = 3 * USECS_PER_SECOND;2133 const quint64 TOO_LONG_SINCE_LAST_QUERY = 3 * USECS_PER_SECOND;
@@ -2460,7 +2460,7 @@ glm::vec3 Application::getSunDirection() { · 326 unmodified lines
2460}2460}
2461 2461
2462void Application::updateShadowMap() {2462void Application::updateShadowMap() {
2463 PerformanceTimer perfTimer("paintGL/updateShadowMap");2463 PerformanceTimer perfTimer("shadowMap");
2464 QOpenGLFramebufferObject* fbo = _textureCache.getShadowFramebufferObject();2464 QOpenGLFramebufferObject* fbo = _textureCache.getShadowFramebufferObject();
2465 fbo->bind();2465 fbo->bind();
2466 glEnable(GL_DEPTH_TEST);2466 glEnable(GL_DEPTH_TEST);
@@ -2622,7 +2622,7 @@ QImage Application::renderAvatarBillboard() { · 155 unmodified lines
2622}2622}
2623 2623
2624void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) {2624void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) {
2625 PerformanceTimer perfTimer("paintGL/displaySide");2625 PerformanceTimer perfTimer("display");
2626 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "Application::displaySide()");2626 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "Application::displaySide()");
2627 // transform by eye offset2627 // transform by eye offset
2628 2628
@@ -2656,7 +2656,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 27 unmodified lines
2656 2656
2657 // Setup 3D lights (after the camera transform, so that they are positioned in world space)2657 // Setup 3D lights (after the camera transform, so that they are positioned in world space)
2658 {2658 {
2659 PerformanceTimer perfTimer("paintGL/displaySide/setupWorldLight");2659 PerformanceTimer perfTimer("lights");
2660 setupWorldLight();2660 setupWorldLight();
2661 }2661 }
2662 2662
@@ -2675,7 +2675,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 12 unmodified lines
2675 }2675 }
2676 2676
2677 if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Stars)) {2677 if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Stars)) {
2678 PerformanceTimer perfTimer("paintGL/displaySide/stars");2678 PerformanceTimer perfTimer("stars");
2679 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2679 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2680 "Application::displaySide() ... stars...");2680 "Application::displaySide() ... stars...");
2681 if (!_stars.isStarsLoaded()) {2681 if (!_stars.isStarsLoaded()) {
@@ -2704,7 +2704,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 22 unmodified lines
2704 2704
2705 // draw the sky dome2705 // draw the sky dome
2706 if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Atmosphere)) {2706 if (!selfAvatarOnly && Menu::getInstance()->isOptionChecked(MenuOption::Atmosphere)) {
2707 PerformanceTimer perfTimer("paintGL/displaySide/atmosphere");2707 PerformanceTimer perfTimer("atmosphere");
2708 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2708 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2709 "Application::displaySide() ... atmosphere...");2709 "Application::displaySide() ... atmosphere...");
2710 _environment.renderAtmospheres(whichCamera);2710 _environment.renderAtmospheres(whichCamera);
@@ -2725,13 +2725,13 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 14 unmodified lines
2725 2725
2726 // draw the audio reflector overlay2726 // draw the audio reflector overlay
2727 {2727 {
2728 PerformanceTimer perfTimer("paintGL/displaySide/audioReflector");2728 PerformanceTimer perfTimer("audio");
2729 _audioReflector.render();2729 _audioReflector.render();
2730 }2730 }
2731 2731
2732 // Draw voxels2732 // Draw voxels
2733 if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) {2733 if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) {
2734 PerformanceTimer perfTimer("paintGL/displaySide/voxels");2734 PerformanceTimer perfTimer("voxels");
2735 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2735 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2736 "Application::displaySide() ... voxels...");2736 "Application::displaySide() ... voxels...");
2737 _voxels.render();2737 _voxels.render();
@@ -2739,14 +2739,14 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 1 unmodified line
2739 2739
2740 // also, metavoxels2740 // also, metavoxels
2741 if (Menu::getInstance()->isOptionChecked(MenuOption::Metavoxels)) {2741 if (Menu::getInstance()->isOptionChecked(MenuOption::Metavoxels)) {
2742 PerformanceTimer perfTimer("paintGL/displaySide/metavoxels");2742 PerformanceTimer perfTimer("metavoxels");
2743 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2743 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2744 "Application::displaySide() ... metavoxels...");2744 "Application::displaySide() ... metavoxels...");
2745 _metavoxels.render();2745 _metavoxels.render();
2746 }2746 }
2747 2747
2748 if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) {2748 if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) {
2749 PerformanceTimer perfTimer("paintGL/displaySide/buckyBalls");2749 PerformanceTimer perfTimer("buckyBalls");
2750 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2750 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2751 "Application::displaySide() ... bucky balls...");2751 "Application::displaySide() ... bucky balls...");
2752 _buckyBalls.render();2752 _buckyBalls.render();
@@ -2754,7 +2754,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 1 unmodified line
2754 2754
2755 // render particles...2755 // render particles...
2756 if (Menu::getInstance()->isOptionChecked(MenuOption::Particles)) {2756 if (Menu::getInstance()->isOptionChecked(MenuOption::Particles)) {
2757 PerformanceTimer perfTimer("paintGL/displaySide/particles");2757 PerformanceTimer perfTimer("particles");
2758 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2758 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2759 "Application::displaySide() ... particles...");2759 "Application::displaySide() ... particles...");
2760 _particles.render();2760 _particles.render();
@@ -2762,7 +2762,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 1 unmodified line
2762 2762
2763 // render models...2763 // render models...
2764 if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) {2764 if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) {
2765 PerformanceTimer perfTimer("paintGL/displaySide/models");2765 PerformanceTimer perfTimer("models");
2766 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2766 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2767 "Application::displaySide() ... models...");2767 "Application::displaySide() ... models...");
2768 _models.render();2768 _models.render();
@@ -2770,7 +2770,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 1 unmodified line
2770 2770
2771 // render the ambient occlusion effect if enabled2771 // render the ambient occlusion effect if enabled
2772 if (Menu::getInstance()->isOptionChecked(MenuOption::AmbientOcclusion)) {2772 if (Menu::getInstance()->isOptionChecked(MenuOption::AmbientOcclusion)) {
2773 PerformanceTimer perfTimer("paintGL/displaySide/AmbientOcclusion");2773 PerformanceTimer perfTimer("ambientOcclusion");
2774 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2774 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2775 "Application::displaySide() ... AmbientOcclusion...");2775 "Application::displaySide() ... AmbientOcclusion...");
2776 _ambientOcclusionEffect.render();2776 _ambientOcclusionEffect.render();
@@ -2785,9 +2785,9 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 8 unmodified lines
2785 2785
2786 bool mirrorMode = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR);2786 bool mirrorMode = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR);
2787 {2787 {
2788 PerformanceTimer perfTimer("paintGL/displaySide/renderAvatars");2788 PerformanceTimer perfTimer("avatars");
2789 2789
2790 if (1 || OculusManager::isConnected()) {2790 if (OculusManager::isConnected()) {
2791 OculusManager::renderLaserPointer();2791 OculusManager::renderLaserPointer();
2792 }2792 }
2793 2793
@@ -2796,14 +2796,15 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines
2796 2796
2797 if (!selfAvatarOnly) {2797 if (!selfAvatarOnly) {
2798 // Render the world box2798 // Render the world box
2799 if (whichCamera.getMode() != CAMERA_MODE_MIRROR && Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {2799 if (whichCamera.getMode() != CAMERA_MODE_MIRROR && Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
2800 PerformanceTimer perfTimer("paintGL/displaySide/renderWorldBox");2800 Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) {
2801 PerformanceTimer perfTimer("worldBox");
2801 renderWorldBox();2802 renderWorldBox();
2802 }2803 }
2803 2804
2804 // view frustum for debugging2805 // view frustum for debugging
2805 if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum) && whichCamera.getMode() != CAMERA_MODE_MIRROR) {2806 if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayFrustum) && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
2806 PerformanceTimer perfTimer("paintGL/displaySide/ViewFrustum");2807 PerformanceTimer perfTimer("viewFrustum");
2807 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2808 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2808 "Application::displaySide() ... renderViewFrustum...");2809 "Application::displaySide() ... renderViewFrustum...");
2809 renderViewFrustum(_viewFrustum);2810 renderViewFrustum(_viewFrustum);
@@ -2811,7 +2812,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 1 unmodified line
2811 2812
2812 // render voxel fades if they exist2813 // render voxel fades if they exist
2813 if (_voxelFades.size() > 0) {2814 if (_voxelFades.size() > 0) {
2814 PerformanceTimer perfTimer("paintGL/displaySide/voxel fades");2815 PerformanceTimer perfTimer("voxelFades");
2815 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2816 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2816 "Application::displaySide() ... voxel fades...");2817 "Application::displaySide() ... voxel fades...");
2817 _voxelFadesLock.lockForWrite();2818 _voxelFadesLock.lockForWrite();
@@ -2828,13 +2829,13 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 10 unmodified lines
2828 2829
2829 // give external parties a change to hook in2830 // give external parties a change to hook in
2830 {2831 {
2831 PerformanceTimer perfTimer("paintGL/displaySide/inWorldInterface");2832 PerformanceTimer perfTimer("inWorldInterface");
2832 emit renderingInWorldInterface();2833 emit renderingInWorldInterface();
2833 }2834 }
2834 2835
2835 // render JS/scriptable overlays2836 // render JS/scriptable overlays
2836 {2837 {
2837 PerformanceTimer perfTimer("paintGL/displaySide/3dOverlays");2838 PerformanceTimer perfTimer("3dOverlays");
2838 _overlays.render3D();2839 _overlays.render3D();
2839 }2840 }
2840 }2841 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t