diff --git a/README.md b/README.md index 5928aeac6df..d3c1dc1b2b5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation 'com.google.android.filament:filament-android:1.56.4' + implementation 'com.google.android.filament:filament-android:1.56.5' } ``` @@ -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.56.4' +pod 'Filament', '~> 1.56.5' ``` ## Documentation diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2500ee1c212..a57b43591f4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,9 @@ 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.56.5 + + ## v1.56.4 diff --git a/android/filament-android/src/main/cpp/Material.cpp b/android/filament-android/src/main/cpp/Material.cpp index e923d210b01..027627128e7 100644 --- a/android/filament-android/src/main/cpp/Material.cpp +++ b/android/filament-android/src/main/cpp/Material.cpp @@ -25,13 +25,14 @@ using namespace filament; extern "C" JNIEXPORT jlong JNICALL Java_com_google_android_filament_Material_nBuilderBuild(JNIEnv *env, jclass, - jlong nativeEngine, jobject buffer_, jint size, jint shBandCount) { + jlong nativeEngine, jobject buffer_, jint size, jint shBandCount, jint shadowQuality) { Engine* engine = (Engine*) nativeEngine; AutoBuffer buffer(env, buffer_, size); auto builder = Material::Builder(); if (shBandCount) { builder.sphericalHarmonicsBandCount(shBandCount); } + builder.shadowSamplingQuality((Material::Builder::ShadowSamplingQuality)shadowQuality); Material* material = builder .package(buffer.getData(), buffer.getSize()) .build(*engine); diff --git a/android/filament-android/src/main/java/com/google/android/filament/Material.java b/android/filament-android/src/main/java/com/google/android/filament/Material.java index cd71bbae736..b304f8a6ab7 100644 --- a/android/filament-android/src/main/java/com/google/android/filament/Material.java +++ b/android/filament-android/src/main/java/com/google/android/filament/Material.java @@ -344,9 +344,18 @@ public Material(long nativeMaterial) { } public static class Builder { + public enum ShadowSamplingQuality { + /** 2x2 PCF */ + HARD, + /** 3x3 gaussian filter */ + LOW, + } + private Buffer mBuffer; private int mSize; private int mShBandCount = 0; + private ShadowSamplingQuality mShadowSamplingQuality = ShadowSamplingQuality.LOW; + /** * Specifies the material data. The material data is a binary blob produced by @@ -378,6 +387,18 @@ public Builder sphericalHarmonicsBandCount(@IntRange(from = 0) int shBandCount) return this; } + /** + * Set the quality of shadow sampling. This is only taken into account + * if this material is lit and in the surface domain. + * @param quality + * @return Reference to this Builder for chaining calls. + */ + @NonNull + public Builder shadowSamplingQuality(ShadowSamplingQuality quality) { + mShadowSamplingQuality = quality; + return this; + } + /** * Creates and returns the Material object. * @@ -390,7 +411,7 @@ public Builder sphericalHarmonicsBandCount(@IntRange(from = 0) int shBandCount) @NonNull public Material build(@NonNull Engine engine) { long nativeMaterial = nBuilderBuild(engine.getNativeObject(), - mBuffer, mSize, mShBandCount); + mBuffer, mSize, mShBandCount, mShadowSamplingQuality.ordinal()); if (nativeMaterial == 0) throw new IllegalStateException("Couldn't create Material"); return new Material(nativeMaterial); } @@ -1041,7 +1062,7 @@ void clearNativeObject() { mNativeObject = 0; } - private static native long nBuilderBuild(long nativeEngine, @NonNull Buffer buffer, int size, int shBandCount); + private static native long nBuilderBuild(long nativeEngine, @NonNull Buffer buffer, int size, int shBandCount, int shadowQuality); private static native long nCreateInstance(long nativeMaterial); private static native long nCreateInstanceWithName(long nativeMaterial, @NonNull String name); private static native long nGetDefaultInstance(long nativeMaterial); diff --git a/android/gradle.properties b/android/gradle.properties index bc0e5cf72b0..7082c1eab1a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.google.android.filament -VERSION_NAME=1.56.4 +VERSION_NAME=1.56.5 POM_DESCRIPTION=Real-time physically based rendering engine for Android. diff --git a/docs/Filament.html b/docs/Filament.html index c3608ee6331..cf6f9e71949 100644 --- a/docs/Filament.html +++ b/docs/Filament.html @@ -2,7 +2,7 @@ -