From cb65a6f640f89d1b037c0f2e4e288d8393f7df94 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 7 Dec 2015 15:21:45 -0800 Subject: [PATCH 1/5] fix cmake to build bullet-2.83 --- cmake/externals/bullet/CMakeLists.txt | 6 +++--- cmake/macros/TargetBullet.cmake | 2 +- cmake/modules/FindBullet.cmake | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt index ff0eb22241..6eca1b5b88 100644 --- a/cmake/externals/bullet/CMakeLists.txt +++ b/cmake/externals/bullet/CMakeLists.txt @@ -30,9 +30,9 @@ else () ExternalProject_Add( ${EXTERNAL_NAME} #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz - URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.82-ccd-fix.tgz - URL_MD5 fb140a4983b4109aa1c825a162aa8d64 - CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_DEMOS=0 -DUSE_GLUT=0 + URL http://localhost/~andrew/bullet-2.83-ccd-and-cmake-fixes.tgz + URL_MD5 03051bf112dcc78ddd296f9cab38fd68 + CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 diff --git a/cmake/macros/TargetBullet.cmake b/cmake/macros/TargetBullet.cmake index 600ae9e63b..207595d23f 100644 --- a/cmake/macros/TargetBullet.cmake +++ b/cmake/macros/TargetBullet.cmake @@ -15,4 +15,4 @@ macro(TARGET_BULLET) target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) endif() target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) -endmacro() \ No newline at end of file +endmacro() diff --git a/cmake/modules/FindBullet.cmake b/cmake/modules/FindBullet.cmake index 9ef25f7e1e..32af5ecd7a 100644 --- a/cmake/modules/FindBullet.cmake +++ b/cmake/modules/FindBullet.cmake @@ -88,4 +88,4 @@ find_package_handle_standard_args(Bullet "Could NOT find Bullet, try to set the BULLET_INCLUDE_DIRS BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY BULLET_LIBRARIES -) \ No newline at end of file +) From 9231692d231a801ba2e548f9d8641dfe996d5c90 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 7 Dec 2015 17:00:38 -0800 Subject: [PATCH 2/5] fix asset URL and windows cmake command for bullet --- cmake/externals/bullet/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt index 6eca1b5b88..046cc301b0 100644 --- a/cmake/externals/bullet/CMakeLists.txt +++ b/cmake/externals/bullet/CMakeLists.txt @@ -18,9 +18,9 @@ if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} # URL https://bullet.googlecode.com/files/bullet-2.82-r2704.zip - URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.82-ccd-fix.zip - URL_MD5 d95b07eb120de7dd7786361c0b5a8d9f - CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_DEMOS=0 -DUSE_GLUT=0 -DUSE_DX11=0 + URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz + URL_MD5 03051bf112dcc78ddd296f9cab38fd68 + CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 -DUSE_DX11=0 LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 @@ -30,7 +30,7 @@ else () ExternalProject_Add( ${EXTERNAL_NAME} #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz - URL http://localhost/~andrew/bullet-2.83-ccd-and-cmake-fixes.tgz + URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz URL_MD5 03051bf112dcc78ddd296f9cab38fd68 CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 LOG_DOWNLOAD 1 From 6d7597e9fc828e7827fa349dcc08607da2f88920 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 8 Dec 2015 10:21:42 -0800 Subject: [PATCH 3/5] remove comments and remove dangling whitespace --- cmake/externals/bullet/CMakeLists.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt index 046cc301b0..125432002c 100644 --- a/cmake/externals/bullet/CMakeLists.txt +++ b/cmake/externals/bullet/CMakeLists.txt @@ -4,7 +4,7 @@ if (WIN32) set(PLATFORM_CMAKE_ARGS "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=1") else () set(PLATFORM_CMAKE_ARGS "-DBUILD_SHARED_LIBS=1") - + if (ANDROID) list(APPEND PLATFORM_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "-DANDROID_NATIVE_API_LEVEL=19") elseif (APPLE) @@ -14,10 +14,9 @@ endif () include(ExternalProject) -if (WIN32) +if (WIN32) ExternalProject_Add( ${EXTERNAL_NAME} - # URL https://bullet.googlecode.com/files/bullet-2.82-r2704.zip URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz URL_MD5 03051bf112dcc78ddd296f9cab38fd68 CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 -DUSE_DX11=0 @@ -25,11 +24,10 @@ if (WIN32) LOG_CONFIGURE 1 LOG_BUILD 1 BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build - ) + ) else () ExternalProject_Add( ${EXTERNAL_NAME} - #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz URL_MD5 03051bf112dcc78ddd296f9cab38fd68 CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH= -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 @@ -37,7 +35,7 @@ else () LOG_CONFIGURE 1 LOG_BUILD 1 BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build - ) + ) endif () # Hide this external target (for ide users) @@ -55,7 +53,7 @@ if (APPLE OR UNIX OR ANDROID) else () set(BULLET_LIB_EXT "so") endif () - + set(LIB_PREFIX "lib") elseif (WIN32) set(BULLET_LIB_EXT "lib") @@ -63,13 +61,13 @@ endif () if (DEFINED BULLET_LIB_EXT) set(_BULLET_LIB_PAIRS "DYNAMICS_LIBRARY\;BulletDynamics" "COLLISION_LIBRARY\;BulletCollision" "MATH_LIBRARY\;LinearMath" "SOFTBODY_LIBRARY\;BulletSoftBody") - + foreach(_LIB_PAIR ${_BULLET_LIB_PAIRS}) list(GET _LIB_PAIR 0 _LIB_VAR_NAME) list(GET _LIB_PAIR 1 _LIB_NAME) - + set(${EXTERNAL_NAME_UPPER}_${_LIB_VAR_NAME}_RELEASE ${BULLET_LIB_DIR}/${LIB_PREFIX}${_LIB_NAME}.${BULLET_LIB_EXT} CACHE FILEPATH "${_LIB_NAME} release library location") - + if (WIN32) set(${EXTERNAL_NAME_UPPER}_${_LIB_VAR_NAME}_DEBUG ${BULLET_LIB_DIR}/${LIB_PREFIX}${_LIB_NAME}_Debug.${BULLET_LIB_EXT} CACHE FILEPATH "${_LIB_NAME} debug library location") else () From 67d6965f14d89a7c608d52cf796e9071b9b490ad Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Sun, 13 Dec 2015 16:14:38 -0800 Subject: [PATCH 4/5] Revert "Fix the broken skybox and simplify a bit the vertex shader used" This reverts commit 68134aafe5d22fe1efe19bbdc65fac32f9dfa4bc. --- .../procedural/src/procedural/ProceduralSkybox.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.cpp b/libraries/procedural/src/procedural/ProceduralSkybox.cpp index 68645045b4..bd61de7338 100644 --- a/libraries/procedural/src/procedural/ProceduralSkybox.cpp +++ b/libraries/procedural/src/procedural/ProceduralSkybox.cpp @@ -51,6 +51,14 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, static gpu::Stream::FormatPointer theFormat; if (skybox._procedural && skybox._procedural->_enabled && skybox._procedural->ready()) { + if (!theBuffer) { + const float CLIP = 1.0f; + const glm::vec2 vertices[4] = { { -CLIP, -CLIP }, { CLIP, -CLIP }, { -CLIP, CLIP }, { CLIP, CLIP } }; + theBuffer = std::make_shared(sizeof(vertices), (const gpu::Byte*) vertices); + theFormat = std::make_shared(); + theFormat->setAttribute(gpu::Stream::POSITION, gpu::Stream::POSITION, gpu::Element(gpu::VEC2, gpu::FLOAT, gpu::XYZ)); + } + glm::mat4 projMat; viewFrustum.evalProjectionMatrix(projMat); @@ -59,6 +67,8 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, batch.setProjectionTransform(projMat); batch.setViewTransform(viewTransform); batch.setModelTransform(Transform()); // only for Mac + batch.setInputBuffer(gpu::Stream::POSITION, theBuffer, 0, 8); + batch.setInputFormat(theFormat); if (skybox.getCubemap() && skybox.getCubemap()->isDefined()) { batch.setResourceTexture(0, skybox.getCubemap()); From 7190c26c40aa776de182adbfe219590e5381edf1 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 14 Dec 2015 15:37:10 +1300 Subject: [PATCH 5/5] Update Windows build instructions for 64-bit builds --- BUILD_WIN.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/BUILD_WIN.md b/BUILD_WIN.md index 48781ca34a..671fed5a97 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -1,5 +1,7 @@ Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Windows specific instructions are found in this file. +Interface can be built as 32 or 64 bit. + ###Visual Studio 2013 You can use the Community or Professional editions of Visual Studio 2013. @@ -25,25 +27,26 @@ We expect nmake.exe to be located at the following path. ###Qt You can use the online installer or the offline installer. If you use the offline installer, be sure to select the "OpenGL" version. -NOTE: Qt does not support 64-bit builds on Windows 7, so you must use the 32-bit version of libraries for interface.exe to run. The 32-bit version of the static library is the one linked by our CMake find modules. - * [Download the online installer](http://qt-project.org/downloads) - * When it asks you to select components, ONLY select the following: + * When it asks you to select components, ONLY select one of the following, 32- or 64-bit to match your build preference: * Qt > Qt 5.5.1 > **msvc2013 32-bit** + * Qt > Qt 5.5.1 > **msvc2013 64-bit** -* [Download the offline installer](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013-5.5.1.exe) +* Download the offline installer, 32- or 64-bit to match your build preference: + * [32-bit](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013-5.5.1.exe) + * [64-bit](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013_64-5.5.1.exe) Once Qt is installed, you need to manually configure the following: -* Set the QT_CMAKE_PREFIX_PATH environment variable to your `Qt\5.5.1\msvc2013\lib\cmake` directory. +* Set the QT_CMAKE_PREFIX_PATH environment variable to your `Qt\5.5.1\msvc2013\lib\cmake` or `Qt\5.5.1\msvc2013_64\lib\cmake` directory. * You can set an environment variable from Control Panel > System > Advanced System Settings > Environment Variables > New ###External Libraries -As it stands, Hifi/Interface is a 32-bit application, so all libraries should also be 32-bit. +All libraries should be 32- or 64-bit to match your build preference. CMake will need to know where the headers and libraries for required external dependencies are. -We use CMake's `fixup_bundle` to find the DLLs all of our exectuable targets require, and then copy them beside the executable in a post-build step. If `fixup_bundle` is having problems finding a DLL, you can fix it manually on your end by adding the folder containing that DLL to your path. Let us know which DLL CMake had trouble finding, as it is possible a tweak to our CMake files is required. +We use CMake's `fixup_bundle` to find the DLLs all of our executable targets require, and then copy them beside the executable in a post-build step. If `fixup_bundle` is having problems finding a DLL, you can fix it manually on your end by adding the folder containing that DLL to your path. Let us know which DLL CMake had trouble finding, as it is possible a tweak to our CMake files is required. The recommended route for CMake to find the external dependencies is to place all of the dependencies in one folder and set one ENV variable - HIFI_LIB_DIR. That ENV variable should point to a directory with the following structure: @@ -69,17 +72,23 @@ Your system may already have several versions of the OpenSSL DLL's (ssleay32.dll QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb QSslSocket: cannot resolve SSL_get0_next_proto_negotiated -To prevent these problems, install OpenSSL yourself. Download the following binary packages [from this website](http://slproweb.com/products/Win32OpenSSL.html): -* Visual C++ 2008 Redistributables -* Win32 OpenSSL v1.0.1p +To prevent these problems, install OpenSSL yourself. Download one of the following binary packages [from this website](http://slproweb.com/products/Win32OpenSSL.html): +* Win32 OpenSSL v1.0.1q +* Win64 OpenSSL v1.0.1q Install OpenSSL into the Windows system directory, to make sure that Qt uses the version that you've just installed, and not some other version. ###Build High Fidelity using Visual Studio Follow the same build steps from the CMake section of [BUILD.md](BUILD.md), but pass a different generator to CMake. +For 32-bit builds: + cmake .. -G "Visual Studio 12" +For 64-bit builds: + + cmake .. -G "Visual Studio 12 Win64" + Open %HIFI_DIR%\build\hifi.sln and compile. ###Running Interface