Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade To Latest Filament #6511

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c48647d
CMake changes/libraries/c++ standard to build against latest filament
errissa Nov 28, 2023
ea0a6a3
Compile materials for all platforms (OpenGL, Metal, Vulkan)
errissa Nov 28, 2023
2736006
Make GLFW/Filament initialization GLFW friendly
errissa Nov 28, 2023
5e488a5
Tweaks to deal with compilation errors
errissa Nov 28, 2023
9c773ff
Remove normalized floating point attribute types
errissa Nov 28, 2023
ba5d729
Temporary commit while deciding Vulkan v OpenGL
errissa Dec 10, 2023
74c4487
Merge branch 'main' into errissa/filament-1.46
errissa Dec 10, 2023
3c347da
Merge branch 'main' into errissa/filament-1.46
errissa Dec 28, 2023
37ad263
Update to Filament 1.49.1 on Linux
errissa Dec 28, 2023
836ed84
Don't flip Y since Vulkan uses upper left origin
errissa Dec 28, 2023
6ac80e0
Fix compilation issue on Apple Silicon
errissa Dec 28, 2023
3f0b87b
Update to latest Filament on Mac
errissa Dec 28, 2023
6216541
Update filament version on windows
errissa Dec 28, 2023
37a6de0
Remove references to old headless rendering flag/call
errissa Dec 28, 2023
451df37
Remove debug printout
errissa Dec 28, 2023
2fb6e46
Remove backend selection code
errissa Dec 28, 2023
0943e19
Apply style
errissa Dec 28, 2023
4def9e2
Unconditionally build c++17 and c++20 on windows
errissa Dec 29, 2023
f6e4ec7
Move header file to prevent compilation error
errissa Dec 29, 2023
189860f
Suppress deprecation warning on windows
errissa Dec 29, 2023
ef93713
Remove GLFW source
errissa Jan 8, 2024
9abd35f
Fix typo that caused link errors
errissa Jan 9, 2024
1d1dd2e
Fixes to find dependencies for GLFW
errissa Jan 9, 2024
ac7e57a
Fix crash on Mac
errissa Jan 10, 2024
a0d1fa9
Upgrade to GLFW 3.4
errissa Feb 29, 2024
4f17109
Merge branch 'main' of github.com:isl-org/Open3D into errissa/glfw-up…
ssheorey Aug 10, 2024
616a9e5
style fix, fix glfw init in glinfo for headless rendering (no display)
ssheorey Aug 14, 2024
b1335fc
Merge branch 'main' of github.com:isl-org/Open3D into errissa/filamen…
ssheorey Dec 12, 2024
2896a14
Merge branch 'main' of github.com:isl-org/Open3D into errissa/glfw-up…
ssheorey Dec 14, 2024
a8311fc
Merge branch 'errissa/glfw-upgrade' into errissa/filament-1.46
ssheorey Dec 14, 2024
aae0a05
Fix for DLL path for mac app
ssheorey Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions 3rdparty/filament/filament_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ endif()
set(filament_LIBRARIES
filameshio
filament
filamat_lite
filamat
filaflat
filabridge
geometry
backend
bluegl
bluevk
ibl
image
ktxreader
meshoptimizer
smol-v
utils
vkshaders
)

# Locate byproducts
Expand All @@ -52,8 +53,8 @@ endif()
ExternalProject_Add(
ext_filament
PREFIX filament
URL https://github.com/isl-org/filament/archive/d1d873d27f43ba0cee1674a555cc0f18daac3008.tar.gz
URL_HASH SHA256=00c3f41af0fcfb2df904e1f77934f2678d943ddac5eb889788a5e22590e497bd
URL https://github.com/google/filament/archive/refs/tags/v1.49.1.tar.gz
URL_HASH SHA256=f092aeb1d24d9d84a3cc2327fc3359a5e2893d16e7ac55aab9a56aaae64e121f
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/filament"
UPDATE_COMMAND ""
CMAKE_ARGS
Expand All @@ -69,7 +70,7 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${FILAMENT_ROOT}
-DUSE_STATIC_CRT=${STATIC_WINDOWS_RUNTIME}
-DUSE_STATIC_LIBCXX=ON
-DFILAMENT_SUPPORTS_VULKAN=OFF
-DFILAMENT_SKIP_SDL2=ON
-DFILAMENT_SKIP_SAMPLES=ON
-DFILAMENT_OPENGL_HANDLE_ARENA_SIZE_IN_MB=20 # to support many small entities
-DSPIRV_WERROR=OFF
Expand Down
40 changes: 14 additions & 26 deletions 3rdparty/filament/filament_download.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(FetchContent)

set(filament_LIBRARIES filameshio filament filamat_lite filaflat filabridge geometry backend bluegl bluevk ibl image meshoptimizer smol-v utils vkshaders)
set(filament_LIBRARIES filameshio filament filaflat filabridge geometry backend bluegl bluevk ibl image ktxreader meshoptimizer smol-v utils vkshaders)

if (FILAMENT_PRECOMPILED_ROOT)
if (EXISTS "${FILAMENT_PRECOMPILED_ROOT}")
Expand All @@ -13,51 +13,38 @@ else()
set(lib_dir lib)
# Setup download links
if(WIN32)
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.9.9/filament-v1.9.9-windows.tgz)
set(FILAMENT_SHA256 3a937a54a0c6b693c833737878761f8ba8ee02744be3c2f9ec33b1c6399ba31b)
# Required for filament v1.9.9
# Older versions of filament do not contain vkshaders.
# They also have a different directory structure.
# Remove vkshaders here so we can use newer versions with FILAMENT_PRECOMPILED_ROOT.
list(REMOVE_ITEM filament_LIBRARIES vkshaders)
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.49.1/filament-v1.49.1-windows.tgz)
set(FILAMENT_SHA256 afbd43c106f14065c6672923e51a6bfd7ea0d87d404df62b4b6c29c81d078d2d)
if (STATIC_WINDOWS_RUNTIME)
string(APPEND lib_dir /x86_64/mt)
else()
string(APPEND lib_dir /x86_64/md)
endif()
elseif(APPLE)
if (APPLE_AARCH64)
set(FILAMENT_URL https://github.com/isl-org/open3d_downloads/releases/download/filament/filament-v1.9.19-macos_arm64.tgz)
set(FILAMENT_SHA256 3422bdff451d90144fbb69e625d8dcaeaf3222dc2c28879536067937955bc362)
string(APPEND lib_dir /arm64)
# Our arm64 builds use FILAMENT_SUPPORTS_VULKAN=OFF
list(REMOVE_ITEM filament_LIBRARIES bluevk)
else()
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.9.19/filament-v1.9.19-mac.tgz)
set(FILAMENT_SHA256 2765d0ce60647fc17d1880c4618cf7d6b5343d8be4dad87978c3917d9c723b4e)
string(APPEND lib_dir /x86_64)
endif()
set(FILAMENT_URL https://github.com/google/filament/releases/download/v1.49.1/filament-v1.49.1-mac.tgz)
set(FILAMENT_SHA256 e7d02060d264f40b365251bebf6a4f4ed5602182cdae429b28ab419277ebc5e7)
else() # Linux: Check glibc version and use open3d filament binary if new (Ubuntu 20.04 and similar)
execute_process(COMMAND ldd --version OUTPUT_VARIABLE ldd_version)
string(REGEX MATCH "([0-9]+\.)+[0-9]+" glibc_version ${ldd_version})
if(${glibc_version} VERSION_LESS "2.31")
if(${glibc_version} VERSION_LESS "2.33")
set(FILAMENT_URL
https://github.com/isl-org/open3d_downloads/releases/download/filament/filament-v1.9.19-linux.tgz)
set(FILAMENT_SHA256 f0c0b05a543dd0c82b1cd571957a90f28e72cfeee36d19a527c17ac9de4733d5)
https://github.com/isl-org/open3d_downloads/releases/download/filament/filament-v1.49.1-ubuntu20.04.tgz)
set(FILAMENT_SHA256 f4ba020f0ca63540e2f86b36d1728a1ea063ddd5eb55b0ba6fc621ee815a60a7)
message(STATUS "GLIBC version ${glibc_version} found: Using "
"Google Filament binary.")
"Open3D built Filament binary for Ubuntu 20.04.")
else()
set(FILAMENT_URL
https://github.com/isl-org/open3d_downloads/releases/download/filament/filament-v1.9.19-linux-20.04.tgz)
set(FILAMENT_SHA256 c756fd76f5c6a40ca554f8c3cca424354a2a22ea6fce3c8ea893d4c4aa39514c)
https://github.com/google/filament/releases/download/v1.49.1/filament-v1.49.1-linux.tgz)
set(FILAMENT_SHA256 ddd086310d1ee650831e21f6a11f489cb385826fbeea446e7803bec8d6e7442b)
message(STATUS "GLIBC version ${glibc_version} found: Using "
"Open3D Filament binary.")
"Google Filament binary.")
endif()
endif()

set(lib_byproducts ${filament_LIBRARIES})
list(TRANSFORM lib_byproducts PREPEND <SOURCE_DIR>/${lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX})
list(TRANSFORM lib_byproducts APPEND ${CMAKE_STATIC_LIBRARY_SUFFIX})
message(STATUS "Filament byproducts: ${lib_byproducts}")

if(WIN32)
set(lib_byproducts_debug ${filament_LIBRARIES})
Expand All @@ -81,6 +68,7 @@ else()
BUILD_BYPRODUCTS ${lib_byproducts}
)
ExternalProject_Get_Property(ext_filament SOURCE_DIR)
message(STATUS "Filament source dir is ${SOURCE_DIR}")
set(FILAMENT_ROOT ${SOURCE_DIR})
endif()

Expand Down
15 changes: 9 additions & 6 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,15 @@ if(USE_SYSTEM_GLFW)
endif()
endif()
if(NOT USE_SYSTEM_GLFW)
message(STATUS "Building library 3rdparty_glfw from source")
add_subdirectory(${Open3D_3RDPARTY_DIR}/glfw)
include(${Open3D_3RDPARTY_DIR}/glfw/glfw.cmake)
open3d_import_3rdparty_library(3rdparty_glfw
HEADER
INCLUDE_DIRS ${Open3D_3RDPARTY_DIR}/glfw/include/
LIBRARIES glfw3
DEPENDS glfw
INCLUDE_DIRS ${GLFW_INCLUDE_DIRS}
LIB_DIR ${GLFW_LIB_DIR}
LIBRARIES ${GLFW_LIBRARIES}
DEPENDS ext_glfw
)

target_link_libraries(3rdparty_glfw INTERFACE Open3D::3rdparty_threads)
if(UNIX AND NOT APPLE)
find_library(RT_LIBRARY rt)
Expand Down Expand Up @@ -720,8 +721,9 @@ if(NOT USE_SYSTEM_GLFW)
target_link_libraries(3rdparty_glfw INTERFACE gdi32)
endif()
list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_CUSTOM Open3D::3rdparty_glfw)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_glfw)
else()
list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_SYSTEM Open3D::3rdparty_glfw)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_glfw)
endif()
if(TARGET Open3D::3rdparty_x11)
target_link_libraries(3rdparty_glfw INTERFACE Open3D::3rdparty_x11)
Expand Down Expand Up @@ -1310,6 +1312,7 @@ if(BUILD_GUI)
endif()
endif()
endif()
set(FILAMENT_RUNTIME_VER x86_64)
if (APPLE)
if (APPLE_AARCH64)
set(FILAMENT_RUNTIME_VER arm64)
Expand Down
75 changes: 0 additions & 75 deletions 3rdparty/glfw/.gitignore

This file was deleted.

33 changes: 0 additions & 33 deletions 3rdparty/glfw/CMake/GenerateMappings.cmake

This file was deleted.

38 changes: 0 additions & 38 deletions 3rdparty/glfw/CMake/MacOSXBundleInfo.plist.in

This file was deleted.

13 changes: 0 additions & 13 deletions 3rdparty/glfw/CMake/amd64-mingw32msvc.cmake

This file was deleted.

13 changes: 0 additions & 13 deletions 3rdparty/glfw/CMake/i586-mingw32msvc.cmake

This file was deleted.

13 changes: 0 additions & 13 deletions 3rdparty/glfw/CMake/i686-pc-mingw32.cmake

This file was deleted.

13 changes: 0 additions & 13 deletions 3rdparty/glfw/CMake/i686-w64-mingw32.cmake

This file was deleted.

Loading
Loading