Skip to content

Commit 88f4f3d

Browse files
committed
Merge branch 'rc/1.68.4' into release
2 parents f88d3ed + c03276f commit 88f4f3d

File tree

212 files changed

+11875
-6790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+11875
-6790
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ endif()
473473
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_SANITIZE_OPTIONS}")
474474

475475
if (FILAMENT_ENABLE_COVERAGE)
476-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-instr-generate -fcoverage-mapping")
476+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping -Wno-pass-failed")
477477
endif()
478478

479479
# Disable the stack check for macOS to workaround a known issue in clang 11.0.0.
@@ -563,6 +563,10 @@ if (FILAMENT_SUPPORTS_WEBGPU)
563563
add_definitions(-DFILAMENT_SUPPORTS_WEBGPU)
564564
endif()
565565

566+
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
567+
add_definitions(-DFILAMENT_SUPPORTS_WEBP_TEXTURES)
568+
endif()
569+
566570
# Build with Metal support on non-WebGL Apple platforms.
567571
if (APPLE AND NOT WEBGL)
568572
option(FILAMENT_SUPPORTS_METAL "Include the Metal backend" ON)
@@ -915,7 +919,6 @@ endif()
915919

916920
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
917921
add_subdirectory(${EXTERNAL}/libwebp/tnt)
918-
add_definitions(-DFILAMENT_SUPPORTS_WEBP_TEXTURES)
919922
endif()
920923

921924
if (FILAMENT_SUPPORTS_VULKAN)
@@ -973,6 +976,7 @@ if (IS_HOST_PLATFORM)
973976
add_subdirectory(${TOOLS}/roughness-prefilter)
974977
add_subdirectory(${TOOLS}/specular-color)
975978
add_subdirectory(${TOOLS}/uberz)
979+
add_subdirectory(${TOOLS}/specgen)
976980
endif()
977981

978982
# Generate exported executables for cross-compiled builds (Android, WebGL, and iOS)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repositories {
3131
}
3232
3333
dependencies {
34-
implementation 'com.google.android.filament:filament-android:1.68.3'
34+
implementation 'com.google.android.filament:filament-android:1.68.4'
3535
}
3636
```
3737

@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
5151
iOS projects can use CocoaPods to install the latest release:
5252

5353
```shell
54-
pod 'Filament', '~> 1.68.3'
54+
pod 'Filament', '~> 1.68.4'
5555
```
5656

5757
## Documentation

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ A new header is inserted each time a *tag* is created.
77
Instead, if you are authoring a PR for the main branch, add your release note to
88
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
99

10+
## v1.68.4
11+
12+
- gltfio: Add optional support for webp textures (EXT_texture_webp), controlled via FILAMENT_SUPPORTS_WEBP_TEXTURES cmake option
13+
1014
## v1.68.3
1115

1216
- materials: added support for the glTF `KHR_materials_dispersion` extension, which adds dispersion for refractive objects

android/filamat-android/src/main/cpp/MaterialBuilder.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ Java_com_google_android_filament_filamat_MaterialBuilder_nMaterialBuilderRefract
335335
builder->refractionMode((MaterialBuilder::RefractionMode) mode);
336336
}
337337

338+
extern "C" JNIEXPORT void JNICALL
339+
Java_com_google_android_filament_filamat_MaterialBuilder_nMaterialBuilderReflectionMode(JNIEnv* env,
340+
jclass, jlong nativeBuilder, jint mode) {
341+
auto builder = (MaterialBuilder*) nativeBuilder;
342+
builder->reflectionMode((MaterialBuilder::ReflectionMode) mode);
343+
}
344+
338345
extern "C" JNIEXPORT void JNICALL
339346
Java_com_google_android_filament_filamat_MaterialBuilder_nMaterialBuilderRefractionType(JNIEnv* env,
340347
jclass, jlong nativeBuilder, jint type) {

android/filamat-android/src/main/java/com/google/android/filament/filamat/MaterialBuilder.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ public enum RefractionMode {
177177
SCREEN_SPACE
178178
}
179179

180+
public enum ReflectionMode {
181+
DEFAULT,
182+
SCREEN_SPACE
183+
}
184+
180185
public enum RefractionType {
181186
SOLID,
182187
THIN
@@ -403,6 +408,12 @@ public MaterialBuilder refractionMode(RefractionMode mode) {
403408
return this;
404409
}
405410

411+
@NonNull
412+
public MaterialBuilder reflectionMode(ReflectionMode mode) {
413+
nMaterialBuilderReflectionMode(mNativeObject, mode.ordinal());
414+
return this;
415+
}
416+
406417
@NonNull
407418
public MaterialBuilder refractionType(RefractionType type) {
408419
nMaterialBuilderRefractionType(mNativeObject, type.ordinal());
@@ -604,6 +615,7 @@ private static native void nMaterialBuilderSpecularAntiAliasingVariance(long mNa
604615
private static native void nMaterialBuilderSpecularAntiAliasingThreshold(long mNativeObject,
605616
float threshold);
606617
private static native void nMaterialBuilderRefractionMode(long nativeBuilder, int mode);
618+
private static native void nMaterialBuilderReflectionMode(long nativeBuilder, int mode);
607619
private static native void nMaterialBuilderRefractionType(long nativeBuilder, int type);
608620
private static native void nMaterialBuilderClearCoatIorChange(long mNativeObject,
609621
boolean clearCoatIorChange);

android/filament-android/src/main/java/com/google/android/filament/View.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,10 +2041,6 @@ public enum BoxType {
20412041
* use an AABB neighborhood
20422042
*/
20432043
AABB,
2044-
/**
2045-
* use the variance of the neighborhood (not recommended)
2046-
*/
2047-
VARIANCE,
20482044
/**
20492045
* use both AABB and variance
20502046
*/
@@ -2075,7 +2071,7 @@ public enum JitterPattern {
20752071
}
20762072

20772073
/**
2078-
* reconstruction filter width typically between 1 (sharper) and 2 (smoother)
2074+
* @deprecated has no effect.
20792075
*/
20802076
public float filterWidth = 1.0f;
20812077
/**
@@ -2095,9 +2091,9 @@ public enum JitterPattern {
20952091
*/
20962092
public boolean enabled = false;
20972093
/**
2098-
* 4x TAA upscaling. Disables Dynamic Resolution. [BETA]
2094+
* Upscaling factor. Disables Dynamic Resolution. [BETA]
20992095
*/
2100-
public boolean upscaling = false;
2096+
public float upscaling = 1.0f;
21012097
/**
21022098
* whether to filter the history buffer
21032099
*/
@@ -2110,6 +2106,10 @@ public enum JitterPattern {
21102106
* whether to use the YcoCg color-space for history rejection
21112107
*/
21122108
public boolean useYCoCg = false;
2109+
/**
2110+
* set to true for HDR content
2111+
*/
2112+
public boolean hdr = true;
21132113
/**
21142114
* type of color gamut box
21152115
*/

android/gltfio-android/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ option(FILAMENT_ENABLE_FGVIEWER "Enables Frame Graph Viewer" OFF)
66
option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF)
77
option(FILAMENT_DISABLE_MATOPT "Disables material optimizations" OFF)
88
option(FILAMENT_SUPPORTS_WEBGPU "Enables WebGPU on Android" OFF)
9+
option(FILAMENT_SUPPORTS_WEBP_TEXTURES "Enable webp texture support on Android" OFF)
910

1011
set(CMAKE_CXX_STANDARD 20)
1112

@@ -30,6 +31,12 @@ add_library(stb STATIC IMPORTED)
3031
set_target_properties(stb PROPERTIES IMPORTED_LOCATION
3132
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libstb.a)
3233

34+
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
35+
add_library(webpdecoder STATIC IMPORTED)
36+
set_target_properties(webpdecoder PROPERTIES IMPORTED_LOCATION
37+
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libwebpdecoder.a)
38+
endif()
39+
3340
add_library(basis_transcoder STATIC IMPORTED)
3441
set_target_properties(basis_transcoder PROPERTIES IMPORTED_LOCATION
3542
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libbasis_transcoder.a)
@@ -81,6 +88,10 @@ set(GLTFIO_INCLUDE_DIRS
8188
../../libs/ktxreader/include
8289
)
8390

91+
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
92+
list(APPEND GLTFIO_INCLUDE_DIRS ../../third_party/libwebp/src)
93+
endif()
94+
8495
add_library(gltfio-jni SHARED ${GLTFIO_SRCS})
8596

8697
target_compile_definitions(gltfio-jni PUBLIC GLTFIO_DRACO_SUPPORTED=1)
@@ -107,3 +118,6 @@ target_link_libraries(gltfio-jni
107118
PRIVATE perfetto # needed only when FILAMENT_ENABLE_PERFETTO is defined
108119
PRIVATE log # needed only when perfetto above is used
109120
)
121+
if (FILAMENT_SUPPORTS_WEBP_TEXTURES)
122+
target_link_libraries(gltfio-jni PRIVATE webpdecoder)
123+
endif()

android/gltfio-android/src/main/cpp/ResourceLoader.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ Java_com_google_android_filament_gltfio_ResourceLoader_nCreateKtx2Provider(JNIEn
128128
return (jlong) createKtx2Provider(engine);
129129
}
130130

131+
extern "C" JNIEXPORT jboolean JNICALL
132+
Java_com_google_android_filament_gltfio_ResourceLoader_nIsWebpSupported(JNIEnv*, jclass) {
133+
return (jboolean) isWebpSupported();
134+
}
135+
136+
extern "C" JNIEXPORT jlong JNICALL
137+
Java_com_google_android_filament_gltfio_ResourceLoader_nCreateWebpProvider(JNIEnv*, jclass,
138+
jlong nativeEngine) {
139+
Engine* engine = (Engine*) nativeEngine;
140+
return (jlong) createWebpProvider(engine);
141+
}
142+
131143
extern "C" JNIEXPORT void JNICALL
132144
Java_com_google_android_filament_gltfio_ResourceLoader_nDestroyTextureProvider(JNIEnv*, jclass,
133145
jlong nativeProvider) {

android/gltfio-android/src/main/java/com/google/android/filament/gltfio/ResourceLoader.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class ResourceLoader {
3737
private final long mNativeObject;
3838
private final long mNativeStbProvider;
3939
private final long mNativeKtx2Provider;
40+
private final long mNativeWebpProvider;
4041

4142
/**
4243
* Constructs a resource loader tied to the given Filament engine.
@@ -50,9 +51,17 @@ public ResourceLoader(@NonNull Engine engine) {
5051
mNativeObject = nCreateResourceLoader(nativeEngine, false);
5152
mNativeStbProvider = nCreateStbProvider(nativeEngine);
5253
mNativeKtx2Provider = nCreateKtx2Provider(nativeEngine);
54+
5355
nAddTextureProvider(mNativeObject, "image/jpeg", mNativeStbProvider);
5456
nAddTextureProvider(mNativeObject, "image/png", mNativeStbProvider);
5557
nAddTextureProvider(mNativeObject, "image/ktx2", mNativeKtx2Provider);
58+
if (nIsWebpSupported()) {
59+
mNativeWebpProvider = nCreateWebpProvider(nativeEngine);
60+
nAddTextureProvider(mNativeObject, "image/webp", mNativeWebpProvider);
61+
}
62+
else {
63+
mNativeWebpProvider = 0;
64+
}
5665
}
5766

5867
/**
@@ -68,9 +77,17 @@ public ResourceLoader(@NonNull Engine engine, boolean normalizeSkinningWeights)
6877
mNativeObject = nCreateResourceLoader(nativeEngine, normalizeSkinningWeights);
6978
mNativeStbProvider = nCreateStbProvider(nativeEngine);
7079
mNativeKtx2Provider = nCreateKtx2Provider(nativeEngine);
80+
7181
nAddTextureProvider(mNativeObject, "image/jpeg", mNativeStbProvider);
7282
nAddTextureProvider(mNativeObject, "image/png", mNativeStbProvider);
7383
nAddTextureProvider(mNativeObject, "image/ktx2", mNativeKtx2Provider);
84+
if (nIsWebpSupported()) {
85+
mNativeWebpProvider = nCreateWebpProvider(nativeEngine);
86+
nAddTextureProvider(mNativeObject, "image/webp", mNativeWebpProvider);
87+
}
88+
else {
89+
mNativeWebpProvider = 0;
90+
}
7491
}
7592

7693
/**
@@ -80,6 +97,9 @@ public void destroy() {
8097
nDestroyResourceLoader(mNativeObject);
8198
nDestroyTextureProvider(mNativeStbProvider);
8299
nDestroyTextureProvider(mNativeKtx2Provider);
100+
if (nIsWebpSupported()) {
101+
nDestroyTextureProvider(mNativeWebpProvider);
102+
}
83103
}
84104

85105
/**
@@ -191,6 +211,9 @@ private static native void nAddResourceData(long nativeLoader, String url, Buffe
191211

192212
private static native long nCreateStbProvider(long nativeEngine);
193213
private static native long nCreateKtx2Provider(long nativeEngine);
214+
private static native boolean nIsWebpSupported();
215+
private static native long nCreateWebpProvider(long nativeEngine);
216+
194217
private static native void nAddTextureProvider(long nativeLoader, String url, long nativeProvider);
195218
private static native void nDestroyTextureProvider(long nativeProvider);
196219
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.google.android.filament
2-
VERSION_NAME=1.68.3
2+
VERSION_NAME=1.68.4
33

44
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
55

0 commit comments

Comments
 (0)