diff --git a/CMakeLists.txt b/CMakeLists.txt index 348815f54cd..533abf6a49c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,15 +173,6 @@ if (NOT ANDROID AND NOT WEBGL AND NOT IOS AND NOT FILAMENT_LINUX_IS_MOBILE) set(IS_HOST_PLATFORM TRUE) endif() -if (IOS) - # Remove the headerpad_max_install_names linker flag on iOS. It causes warnings when linking - # executables with bitcode. - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}) - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) -endif() - if (WIN32) # Link statically against c/c++ lib to avoid missing redistriburable such as # "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users @@ -393,8 +384,9 @@ endif() if (NOT MSVC AND NOT IOS) # Omitting stack frame pointers prevents the generation of readable stack traces in crash reports on iOS set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer") +endif() - # These aren't compatible with -fembed-bitcode (and seem to have no effect on Apple platforms anyway) +if (NOT MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections") endif() diff --git a/NEW_RELEASE_NOTES.md b/NEW_RELEASE_NOTES.md index e4728cb677a..4a1a9c7fa7e 100644 --- a/NEW_RELEASE_NOTES.md +++ b/NEW_RELEASE_NOTES.md @@ -7,6 +7,3 @@ for next branch cut* header. appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md). ## Release notes for next branch cut - -- filagui: Fix regression which broke WebGL -- Add a new Engine::Config setting to control preferred shader language diff --git a/README.md b/README.md index f571123d1aa..d554705c90c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation 'com.google.android.filament:filament-android:1.51.7' + implementation 'com.google.android.filament:filament-android:1.51.8' } ``` @@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`: iOS projects can use CocoaPods to install the latest release: ```shell -pod 'Filament', '~> 1.51.7' +pod 'Filament', '~> 1.51.8' ``` ### Snapshots diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e09d514005a..90f172e638b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,13 @@ A new header is inserted each time a *tag* is created. Instead, if you are authoring a PR for the main branch, add your release note to [NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md). +## v1.51.8 + +- filagui: Fix regression which broke WebGL +- Add a new Engine::Config setting to control preferred shader language +- Add `getEyeIndex` vertex API +- ios: Remove bitcode from iOS builds + ## v1.51.7 - Add new matedit tool diff --git a/android/filament-android/src/main/cpp/Engine.cpp b/android/filament-android/src/main/cpp/Engine.cpp index ef67358079d..482d54834b3 100644 --- a/android/filament-android/src/main/cpp/Engine.cpp +++ b/android/filament-android/src/main/cpp/Engine.cpp @@ -517,7 +517,8 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu jlong textureUseAfterFreePoolSize, jboolean disableParallelShaderCompile, jint stereoscopicType, jlong stereoscopicEyeCount, jlong resourceAllocatorCacheSizeMB, jlong resourceAllocatorCacheMaxAge, - jboolean disableHandleUseAfterFreeCheck) { + jboolean disableHandleUseAfterFreeCheck, + jboolean forceGLES2Context) { Engine::Builder* builder = (Engine::Builder*) nativeBuilder; Engine::Config config = { .commandBufferSizeMB = (uint32_t) commandBufferSizeMB, @@ -533,6 +534,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu .resourceAllocatorCacheSizeMB = (uint32_t) resourceAllocatorCacheSizeMB, .resourceAllocatorCacheMaxAge = (uint8_t) resourceAllocatorCacheMaxAge, .disableHandleUseAfterFreeCheck = (bool) disableHandleUseAfterFreeCheck, + .forceGLES2Context = (bool) forceGLES2Context }; builder->config(&config); } diff --git a/android/filament-android/src/main/java/com/google/android/filament/Engine.java b/android/filament-android/src/main/java/com/google/android/filament/Engine.java index 9f8f478009e..bfb17aa5ae4 100644 --- a/android/filament-android/src/main/java/com/google/android/filament/Engine.java +++ b/android/filament-android/src/main/java/com/google/android/filament/Engine.java @@ -225,7 +225,8 @@ public Builder config(Config config) { config.textureUseAfterFreePoolSize, config.disableParallelShaderCompile, config.stereoscopicType.ordinal(), config.stereoscopicEyeCount, config.resourceAllocatorCacheSizeMB, config.resourceAllocatorCacheMaxAge, - config.disableHandleUseAfterFreeCheck); + config.disableHandleUseAfterFreeCheck, + config.forceGLES2Context); return this; } @@ -428,6 +429,13 @@ public static class Config { * Disable backend handles use-after-free checks. */ public boolean disableHandleUseAfterFreeCheck = false; + + /* + * When the OpenGL ES backend is used, setting this value to true will force a GLES2.0 + * context if supported by the Platform, or if not, will have the backend pretend + * it's a GLES2 context. Ignored on other backends. + */ + public boolean forceGLES2Context = false; } private Engine(long nativeEngine, Config config) { @@ -1353,7 +1361,8 @@ private static native void nSetBuilderConfig(long nativeBuilder, long commandBuf long textureUseAfterFreePoolSize, boolean disableParallelShaderCompile, int stereoscopicType, long stereoscopicEyeCount, long resourceAllocatorCacheSizeMB, long resourceAllocatorCacheMaxAge, - boolean disableHandleUseAfterFreeCheck); + boolean disableHandleUseAfterFreeCheck, + boolean forceGLES2Context); private static native void nSetBuilderFeatureLevel(long nativeBuilder, int ordinal); private static native void nSetBuilderSharedContext(long nativeBuilder, long sharedContext); private static native void nSetBuilderPaused(long nativeBuilder, boolean paused); diff --git a/android/gradle.properties b/android/gradle.properties index fd04602ea9c..dec17d0ce52 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.google.android.filament -VERSION_NAME=1.51.7 +VERSION_NAME=1.51.8 POM_DESCRIPTION=Real-time physically based rendering engine for Android. diff --git a/docs/Filament.html b/docs/Filament.html index 1b316e293f4..c3608ee6331 100644 --- a/docs/Filament.html +++ b/docs/Filament.html @@ -476,7 +476,7 @@

-For the specular term, \(f_m\) is a mirror BRDF that can be modeled with the Fresnel law, noted \(F\) in the Cook-Torrance approximation of the microfacet model integration: +For the specular term, \(f_r\) is a mirror BRDF that can be modeled with the Fresnel law, noted \(F\) in the Cook-Torrance approximation of the microfacet model integration:

@@ -857,7 +857,7 @@ // perceptually linear roughness to roughness (see parameterization) float roughness = perceptualRoughness * perceptualRoughness; - float D = D_GGX(NoH, a); + float D = D_GGX(NoH, roughness); vec3 F = F_Schlick(LoH, f0); float V = V_SmithGGXCorrelated(NoV, NoL, roughness); diff --git a/docs/Materials.html b/docs/Materials.html index 019b407c1ba..1a0ea246db4 100644 --- a/docs/Materials.html +++ b/docs/Materials.html @@ -2,7 +2,7 @@ -