Skip to content

Commit

Permalink
Merge branch 'rc/1.38.0' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Jun 7, 2023
2 parents 676a2be + a33eada commit 753aa9c
Show file tree
Hide file tree
Showing 142 changed files with 3,647 additions and 2,050 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-android:
name: build-android
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-ios:
name: build-ios
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-mac:
name: build-mac
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
os: [macos-latest-xl, ubuntu-22.04-16core]
os: [macos-latest, ubuntu-22.04]

steps:
- uses: actions/checkout@v3.3.0
Expand All @@ -40,7 +40,7 @@ jobs:

build-android:
name: build-android
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand All @@ -54,7 +54,7 @@ jobs:
build-ios:
name: build-iOS
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand All @@ -67,7 +67,7 @@ jobs:
build-web:
name: build-web
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
os: [macos-latest-xl, ubuntu-22.04-16core]
os: [macos-latest, ubuntu-22.04]

steps:
- name: Decide Git ref
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
build-web:
name: build-web
runs-on: macos-latest-xl
runs-on: macos-latest
if: github.event_name == 'release' || github.event.inputs.platform == 'web'

steps:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
build-android:
name: build-android
runs-on: macos-latest-xl
runs-on: macos-latest
if: github.event_name == 'release' || github.event.inputs.platform == 'android'

steps:
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
build-ios:
name: build-ios
runs-on: macos-latest-xl
runs-on: macos-latest
if: github.event_name == 'release' || github.event.inputs.platform == 'ios'

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-web:
name: build-web
runs-on: macos-latest-xl
runs-on: macos-latest

steps:
- uses: actions/checkout@v3.3.0
Expand Down
1 change: 0 additions & 1 deletion NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ for next branch cut* header.
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).

## Release notes for next branch cut

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.37.0'
implementation 'com.google.android.filament:filament-android:1.38.0'
}
```

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

```
pod 'Filament', '~> 1.37.0'
pod 'Filament', '~> 1.38.0'
```

### Snapshots
Expand Down
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ 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.38.0

- engine: a new feature to set a transform on the global-scale fog [⚠️ **Recompile materials**]
- engine: large-scale fog can now be opted-out on a per-renderable basis
- engine: improve froxelizer resource efficiency [⚠️ **Recompile materials**]
- matc: better accounting and validation of used samplers in user materials
- engine: add support for sampling fog color from a custom texture [⚠️ **Recompile materials**]
- vulkan: introduce new custom swapchain API
- vulkan: new context sharing API

## v1.37.0

- backend: added `Platform` blob cache APIs, typically used to cache programs [⚠️ **Recompile materials**]
Expand Down
23 changes: 22 additions & 1 deletion android/filament-android/src/main/cpp/RenderableManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,19 @@ Java_com_google_android_filament_RenderableManager_nBuilderSkinning(JNIEnv*, jcl
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nEnableSkinningBuffers(JNIEnv*, jclass,
Java_com_google_android_filament_RenderableManager_nBuilderEnableSkinningBuffers(JNIEnv*, jclass,
jlong nativeBuilder, jboolean enabled) {
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
builder->enableSkinningBuffers(enabled);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nBuilderFog(JNIEnv*, jclass,
jlong nativeBuilder, jboolean enabled) {
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
builder->fog(enabled);
}

extern "C" JNIEXPORT jint JNICALL
Java_com_google_android_filament_RenderableManager_nBuilderSkinningBones(JNIEnv* env, jclass,
jlong nativeBuilder, jint boneCount, jobject bones, jint remaining) {
Expand Down Expand Up @@ -360,6 +367,20 @@ Java_com_google_android_filament_RenderableManager_nSetCulling(JNIEnv*, jclass,
rm->setCulling((RenderableManager::Instance) i, enabled);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nSetFogEnabled(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jboolean enabled) {
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
rm->setFogEnabled((RenderableManager::Instance) i, enabled);
}

extern "C" JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_RenderableManager_nGetFogEnabled(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i) {
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
return (jboolean)rm->getFogEnabled((RenderableManager::Instance) i);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderableManager_nSetCastShadows(JNIEnv*, jclass,
jlong nativeRenderableManager, jint i, jboolean enabled) {
Expand Down
12 changes: 11 additions & 1 deletion android/filament-android/src/main/cpp/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetFogOptions(JNIEnv *, jclass , jlong nativeView,
jfloat distance, jfloat maximumOpacity, jfloat height, jfloat heightFalloff, jfloat cutOffDistance,
jfloat r, jfloat g, jfloat b, jfloat density, jfloat inScatteringStart,
jfloat inScatteringSize, jboolean fogColorFromIbl, jboolean enabled) {
jfloat inScatteringSize, jboolean fogColorFromIbl, jlong skyColorNativeObject, jboolean enabled) {
View* view = (View*) nativeView;
Texture* skyColor = (Texture*) skyColorNativeObject;
View::FogOptions options = {
.distance = distance,
.cutOffDistance = cutOffDistance,
Expand All @@ -330,6 +331,7 @@ Java_com_google_android_filament_View_nSetFogOptions(JNIEnv *, jclass , jlong na
.inScatteringStart = inScatteringStart,
.inScatteringSize = inScatteringSize,
.fogColorFromIbl = (bool)fogColorFromIbl,
.skyColor = skyColor,
.enabled = (bool)enabled
};
view->setFogOptions(options);
Expand Down Expand Up @@ -505,3 +507,11 @@ Java_com_google_android_filament_View_nGetMaterialGlobal(JNIEnv *env, jclass cla
std::copy_n(result.v, 4, out);
env->ReleaseFloatArrayElements(out_, out, 0);
}

extern "C"
JNIEXPORT int JNICALL
Java_com_google_android_filament_View_nGetFogEntity(JNIEnv *env, jclass clazz,
jlong nativeView) {
View *view = (View *) nativeView;
return (jint)view->getFogEntity().getId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,19 @@ public Builder screenSpaceContactShadows(boolean enabled) {
*/
@NonNull
public Builder enableSkinningBuffers(boolean enabled) {
nEnableSkinningBuffers(mNativeBuilder, enabled);
nBuilderEnableSkinningBuffers(mNativeBuilder, enabled);
return this;
}

/**
* Controls if this renderable is affected by the large-scale fog.
* @param enabled If true, enables large-scale fog on this object. Disables it otherwise.
* True by default.
* @return this <code>Builder</code> object for chaining calls
*/
@NonNull
public Builder fog(boolean enabled) {
nBuilderFog(mNativeBuilder, enabled);
return this;
}

Expand Down Expand Up @@ -729,6 +741,23 @@ public void setCulling(@EntityInstance int i, boolean enabled) {
nSetCulling(mNativeObject, i, enabled);
}

/**
* Changes whether or not the large-scale fog is applied to this renderable
* @see Builder#fog
*/
public void setFogEnabled(@EntityInstance int i, boolean enabled) {
nSetFogEnabled(mNativeObject, i, enabled);
}

/**
* Returns whether large-scale fog is enabled for this renderable.
* @return True if fog is enabled for this renderable.
* @see Builder#fog
*/
public boolean getFogEnabled(@EntityInstance int i) {
return nGetFogEnabled(mNativeObject, i);
}

/**
* Enables or disables a light channel.
* Light channel 0 is enabled by default.
Expand Down Expand Up @@ -951,7 +980,8 @@ public long getNativeObject() {
private static native void nBuilderSkinningBuffer(long nativeBuilder, long nativeSkinningBuffer, int boneCount, int offset);
private static native void nBuilderMorphing(long nativeBuilder, int targetCount);
private static native void nBuilderSetMorphTargetBufferAt(long nativeBuilder, int level, int primitiveIndex, long nativeMorphTargetBuffer, int offset, int count);
private static native void nEnableSkinningBuffers(long nativeBuilder, boolean enabled);
private static native void nBuilderEnableSkinningBuffers(long nativeBuilder, boolean enabled);
private static native void nBuilderFog(long nativeBuilder, boolean enabled);
private static native void nBuilderLightChannel(long nativeRenderableManager, int channel, boolean enable);
private static native void nBuilderInstances(long nativeRenderableManager, int instances);

Expand All @@ -966,6 +996,8 @@ public long getNativeObject() {
private static native void nSetPriority(long nativeRenderableManager, int i, int priority);
private static native void nSetChannel(long nativeRenderableManager, int i, int channel);
private static native void nSetCulling(long nativeRenderableManager, int i, boolean enabled);
private static native void nSetFogEnabled(long nativeRenderableManager, int i, boolean enabled);
private static native boolean nGetFogEnabled(long nativeRenderableManager, int i);
private static native void nSetLightChannel(long nativeRenderableManager, int i, int channel, boolean enable);
private static native boolean nGetLightChannel(long nativeRenderableManager, int i, int channel);
private static native void nSetCastShadows(long nativeRenderableManager, int i, boolean enabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ public void setFogOptions(@NonNull FogOptions options) {
options.heightFalloff, options.cutOffDistance,
options.color[0], options.color[1], options.color[2],
options.density, options.inScatteringStart, options.inScatteringSize,
options.fogColorFromIbl,
options.fogColorFromIbl, options.skyColor.getNativeObject(),
options.enabled);
}

Expand Down Expand Up @@ -1148,6 +1148,20 @@ public float[] getMaterialGlobal(int index, @Nullable @Size(min = 4) float[] out
return out;
}

/**
* Get an Entity representing the large scale fog object.
* This entity is always inherited by the View's Scene.
*
* It is for example possible to create a TransformManager component with this
* Entity and apply a transformation globally on the fog.
*
* @return an Entity representing the large scale fog object.
*/
@Entity
public int getFogEntity() {
return nGetFogEntity(getNativeObject());
}

public long getNativeObject() {
if (mNativeObject == 0) {
throw new IllegalStateException("Calling method on destroyed View");
Expand Down Expand Up @@ -1189,7 +1203,7 @@ void clearNativeObject() {
private static native void nSetSSCTOptions(long nativeView, float ssctLightConeRad, float ssctStartTraceDistance, float ssctContactDistanceMax, float ssctIntensity, float v, float v1, float v2, float ssctDepthBias, float ssctDepthSlopeBias, int ssctSampleCount, int ssctRayCount, boolean ssctEnabled);
private static native void nSetBloomOptions(long nativeView, long dirtNativeObject, float dirtStrength, float strength, int resolution, float anamorphism, int levels, int blendMode, boolean threshold, boolean enabled, float highlight,
boolean lensFlare, boolean starburst, float chromaticAberration, int ghostCount, float ghostSpacing, float ghostThreshold, float haloThickness, float haloRadius, float haloThreshold);
private static native void nSetFogOptions(long nativeView, float distance, float maximumOpacity, float height, float heightFalloff, float cutOffDistance, float v, float v1, float v2, float density, float inScatteringStart, float inScatteringSize, boolean fogColorFromIbl, boolean enabled);
private static native void nSetFogOptions(long nativeView, float distance, float maximumOpacity, float height, float heightFalloff, float cutOffDistance, float v, float v1, float v2, float density, float inScatteringStart, float inScatteringSize, boolean fogColorFromIbl, long skyColorNativeObject, boolean enabled);
private static native void nSetBlendMode(long nativeView, int blendMode);
private static native void nSetDepthOfFieldOptions(long nativeView, float cocScale, float maxApertureDiameter, boolean enabled, int filter,
boolean nativeResolution, int foregroundRingCount, int backgroundRingCount, int fastGatherRingCount, int maxForegroundCOC, int maxBackgroundCOC);
Expand All @@ -1206,6 +1220,7 @@ private static native void nSetDepthOfFieldOptions(long nativeView, float cocSca
private static native boolean nIsStencilBufferEnabled(long nativeView);
private static native void nSetMaterialGlobal(long nativeView, int index, float x, float y, float z, float w);
private static native void nGetMaterialGlobal(long nativeView, int index, float[] out);
private static native int nGetFogEntity(long nativeView);


/**
Expand Down Expand Up @@ -1503,9 +1518,31 @@ public static class FogOptions {
/**
* The fog color will be sampled from the IBL in the view direction and tinted by `color`.
* Depending on the scene this can produce very convincing results.
* This simulate a more anisotropic phase-function.
*
* This simulates a more anisotropic phase-function.
*
* `fogColorFromIbl` is ignored when skyTexture is specified.
*
* @see skyColor
*/
public boolean fogColorFromIbl = false;
/**
* skyTexture must be a mipmapped cubemap. When provided, the fog color will be sampled from
* this texture, higher resolution mip levels will be used for objects at the far clip plane,
* and lower resolution mip levels for objects closer to the camera. The skyTexture should
* typically be heavily blurred; a typical way to produce this texture is to blur the base
* level with a strong gaussian filter or even an irradiance filter and then generate mip
* levels as usual. How blurred the base level is somewhat of an artistic decision.
*
* This simulates a more anisotropic phase-function.
*
* `fogColorFromIbl` is ignored when skyTexture is specified.
*
* @see Texture
* @see fogColorFromIbl
*/
@Nullable
public Texture skyColor = null;
/**
* Enable or disable large-scale fog
*/
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.37.0
VERSION_NAME=1.38.0

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

Expand Down
3 changes: 1 addition & 2 deletions build/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION:-$(cat `dirname $0`/ndk.version)}

# Install the required NDK version specifically (if not present)
if [[ ! -d "${ANDROID_HOME}/ndk/$FILAMENT_NDK_VERSION" ]]; then
# NOTE: We MUST use Java 1.8 to run sdkmanager currently, it fails starting with Java 11
JAVA_HOME=${JAVA_HOME_8_X64} ${ANDROID_HOME}/tools/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION" > /dev/null
${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION" > /dev/null
fi

# Only build 1 64 bit target during presubmit to cut down build times during presubmit
Expand Down
Loading

0 comments on commit 753aa9c

Please sign in to comment.