Showing the changes to interface/src/Application.cpp (1 of 91 files). Show all
Unified · Split
| @@ -698,8 +698,6 @@ void Application::paintGL() { · 697 unmodified lines | |||
| 698 | displaySide(whichCamera); | 698 | displaySide(whichCamera); |
| 699 | glPopMatrix(); | 699 | glPopMatrix(); |
| 700 | 700 | ||
| 701 | _glowEffect.render(); | ||
| 702 | |||
| 703 | if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) { | 701 | if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) { |
| 704 | renderRearViewMirror(_mirrorViewRect); | 702 | renderRearViewMirror(_mirrorViewRect); |
| 705 | 703 | ||
| @@ -707,6 +705,8 @@ void Application::paintGL() { · 1 unmodified line | |||
| 707 | _rearMirrorTools->render(true); | 705 | _rearMirrorTools->render(true); |
| 708 | } | 706 | } |
| 709 | 707 | ||
| 708 | _glowEffect.render(); | ||
| 709 | |||
| 710 | { | 710 | { |
| 711 | PerformanceTimer perfTimer("renderOverlay"); | 711 | PerformanceTimer perfTimer("renderOverlay"); |
| 712 | // PrioVR will only work if renderOverlay is called, calibration is connected to Application::renderingOverlay() | 712 | // PrioVR will only work if renderOverlay is called, calibration is connected to Application::renderingOverlay() |
| @@ -1753,6 +1753,7 @@ void Application::init() { · 1040 unmodified lines | |||
| 1753 | 1753 | ||
| 1754 | _environment.init(); | 1754 | _environment.init(); |
| 1755 | 1755 | ||
| 1756 | _deferredLightingEffect.init(); | ||
| 1756 | _glowEffect.init(); | 1757 | _glowEffect.init(); |
| 1757 | _ambientOcclusionEffect.init(); | 1758 | _ambientOcclusionEffect.init(); |
| 1758 | _voxelShader.init(); | 1759 | _voxelShader.init(); |
| @@ -2708,7 +2709,6 @@ void Application::updateShadowMap() { · 949 unmodified lines | |||
| 2708 | const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; | 2709 | const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f }; |
| 2709 | const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f }; | 2710 | const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f }; |
| 2710 | const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f }; | 2711 | const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f }; |
| 2711 | const GLfloat NO_SPECULAR_COLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f }; | ||
| 2712 | 2712 | ||
| 2713 | void Application::setupWorldLight() { | 2713 | void Application::setupWorldLight() { |
| 2714 | 2714 | ||
| @@ -2842,6 +2842,8 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 127 unmodified lines | |||
| 2842 | glEnable(GL_LIGHTING); | 2842 | glEnable(GL_LIGHTING); |
| 2843 | glEnable(GL_DEPTH_TEST); | 2843 | glEnable(GL_DEPTH_TEST); |
| 2844 | 2844 | ||
| 2845 | _deferredLightingEffect.prepare(); | ||
| 2846 | |||
| 2845 | if (!selfAvatarOnly) { | 2847 | if (!selfAvatarOnly) { |
| 2846 | // draw a red sphere | 2848 | // draw a red sphere |
| 2847 | float originSphereRadius = 0.05f; | 2849 | float originSphereRadius = 0.05f; |
| @@ -2850,15 +2852,19 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines | |||
| 2850 | glutSolidSphere(originSphereRadius, 15, 15); | 2852 | glutSolidSphere(originSphereRadius, 15, 15); |
| 2851 | glPopMatrix(); | 2853 | glPopMatrix(); |
| 2852 | 2854 | ||
| 2853 | // disable specular lighting for ground and voxels | ||
| 2854 | glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); | ||
| 2855 | |||
| 2856 | // draw the audio reflector overlay | 2855 | // draw the audio reflector overlay |
| 2857 | { | 2856 | { |
| 2858 | PerformanceTimer perfTimer("audio"); | 2857 | PerformanceTimer perfTimer("audio"); |
| 2859 | _audioReflector.render(); | 2858 | _audioReflector.render(); |
| 2860 | } | 2859 | } |
| 2861 | 2860 | ||
| 2861 | if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) { | ||
| 2862 | PerformanceTimer perfTimer("buckyBalls"); | ||
| 2863 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | ||
| 2864 | "Application::displaySide() ... bucky balls..."); | ||
| 2865 | _buckyBalls.render(); | ||
| 2866 | } | ||
| 2867 | |||
| 2862 | // Draw voxels | 2868 | // Draw voxels |
| 2863 | if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | 2869 | if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { |
| 2864 | PerformanceTimer perfTimer("voxels"); | 2870 | PerformanceTimer perfTimer("voxels"); |
| @@ -2875,13 +2881,6 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 10 unmodified lines | |||
| 2875 | _metavoxels.render(); | 2881 | _metavoxels.render(); |
| 2876 | } | 2882 | } |
| 2877 | 2883 | ||
| 2878 | if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) { | ||
| 2879 | PerformanceTimer perfTimer("buckyBalls"); | ||
| 2880 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | ||
| 2881 | "Application::displaySide() ... bucky balls..."); | ||
| 2882 | _buckyBalls.render(); | ||
| 2883 | } | ||
| 2884 | |||
| 2885 | // render particles... | 2884 | // render particles... |
| 2886 | if (Menu::getInstance()->isOptionChecked(MenuOption::Particles)) { | 2885 | if (Menu::getInstance()->isOptionChecked(MenuOption::Particles)) { |
| 2887 | PerformanceTimer perfTimer("particles"); | 2886 | PerformanceTimer perfTimer("particles"); |
| @@ -2905,27 +2904,34 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 17 unmodified lines | |||
| 2905 | "Application::displaySide() ... AmbientOcclusion..."); | 2904 | "Application::displaySide() ... AmbientOcclusion..."); |
| 2906 | _ambientOcclusionEffect.render(); | 2905 | _ambientOcclusionEffect.render(); |
| 2907 | } | 2906 | } |
| 2908 | |||
| 2909 | // restore default, white specular | ||
| 2910 | glMaterialfv(GL_FRONT, GL_SPECULAR, WORLD_SPECULAR_COLOR); | ||
| 2911 | |||
| 2912 | _nodeBoundsDisplay.draw(); | ||
| 2913 | |||
| 2914 | } | 2907 | } |
| 2915 | 2908 | ||
| 2916 | bool mirrorMode = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR); | 2909 | bool mirrorMode = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR); |
| 2917 | { | 2910 | { |
| 2918 | PerformanceTimer perfTimer("avatars"); | 2911 | PerformanceTimer perfTimer("avatars"); |
| 2919 | 2912 | _avatarManager.renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, | |
| 2920 | _avatarManager.renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, selfAvatarOnly); | 2913 | false, selfAvatarOnly); |
| 2914 | } | ||
| 2915 | |||
| 2916 | { | ||
| 2917 | PerformanceTimer perfTimer("lighting"); | ||
| 2918 | _deferredLightingEffect.render(); | ||
| 2919 | } | ||
| 2921 | 2920 | ||
| 2922 | //Render the sixense lasers | 2921 | { |
| 2923 | if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseLasers)) { | 2922 | PerformanceTimer perfTimer("avatarsPostLighting"); |
| 2924 | _myAvatar->renderLaserPointers(); | 2923 | _avatarManager.renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE, |
| 2925 | } | 2924 | true, selfAvatarOnly); |
| 2925 | } | ||
| 2926 | |||
| 2927 | //Render the sixense lasers | ||
| 2928 | if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseLasers)) { | ||
| 2929 | _myAvatar->renderLaserPointers(); | ||
| 2926 | } | 2930 | } |
| 2927 | 2931 | ||
| 2928 | if (!selfAvatarOnly) { | 2932 | if (!selfAvatarOnly) { |
| 2933 | _nodeBoundsDisplay.draw(); | ||
| 2934 | |||
| 2929 | // Render the world box | 2935 | // Render the world box |
| 2930 | if (whichCamera.getMode() != CAMERA_MODE_MIRROR && Menu::getInstance()->isOptionChecked(MenuOption::Stats) && | 2936 | if (whichCamera.getMode() != CAMERA_MODE_MIRROR && Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2931 | Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) { | 2937 | Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) { |
| @@ -3000,7 +3006,7 @@ void Application::computeOffAxisFrustum(float& left, float& right, float& bottom · 68 unmodified lines | |||
| 3000 | float& farVal, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const { | 3006 | float& farVal, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const { |
| 3001 | 3007 | ||
| 3002 | // allow 3DTV/Oculus to override parameters from camera | 3008 | // allow 3DTV/Oculus to override parameters from camera |
| 3003 | _viewFrustum.computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); | 3009 | _displayViewFrustum.computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); |
| 3004 | if (OculusManager::isConnected()) { | 3010 | if (OculusManager::isConnected()) { |
| 3005 | OculusManager::overrideOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); | 3011 | OculusManager::overrideOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); |
| 3006 | 3012 | ||
| @@ -3799,8 +3805,8 @@ ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUser · 792 unmodified lines | |||
| 3799 | scriptEngine->getEntityScriptingInterface()->setPacketSender(&_entityEditSender); | 3805 | scriptEngine->getEntityScriptingInterface()->setPacketSender(&_entityEditSender); |
| 3800 | scriptEngine->getEntityScriptingInterface()->setEntityTree(_entities.getTree()); | 3806 | scriptEngine->getEntityScriptingInterface()->setEntityTree(_entities.getTree()); |
| 3801 | 3807 | ||
| 3802 | // model has some custom types | 3808 | // AvatarManager has some custom types |
| 3803 | Model::registerMetaTypes(scriptEngine); | 3809 | AvatarManager::registerMetaTypes(scriptEngine); |
| 3804 | 3810 | ||
| 3805 | // hook our avatar object into this script engine | 3811 | // hook our avatar object into this script engine |
| 3806 | scriptEngine->setAvatarData(_myAvatar, "MyAvatar"); // leave it as a MyAvatar class to expose thrust features | 3812 | scriptEngine->setAvatarData(_myAvatar, "MyAvatar"); // leave it as a MyAvatar class to expose thrust features |