Skip to content

Commit

Permalink
Merge branch 'rc/1.9.2' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Sep 28, 2020
2 parents 39f323f + 9560318 commit defee76
Show file tree
Hide file tree
Showing 95 changed files with 974 additions and 634 deletions.
81 changes: 81 additions & 0 deletions BRANCHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
![Filament branching strategy](art/diagrams/branching.png)

## Which branch do I open my PR against?

For normal development, open PRs against main. Once they're merged, no further action is necessary.

If you discover a bug with the latest *release candidate*, open a bug fix PR against the release
candidate branch (rc/1.9.0, for example). Once the PR is merged, decide whether it makes sense for
the fix to also go into main. If it was a temporary fix, simply make the _correct_ fix in main as
you would any other change. If the fix is good for main as well, use `git cherry-pick <sha>` to
cherry-pick it into main.

If an immediate hotfix is needed on the *release* branch, open a PR against the release branch. Once
the PR is merged, decide whether the fix is temporary or permanent. If the fix was temporary, make
the _correct_ fix in both the next release candidate branch _and_ main. If the fix is good, use `git
cherry-pick <sha>` to cherry-pick it into the relase candidate branch and main.

## What consitutes a bug?

Only bug fix PRs should be opened against the *release candidate* branch.

Bugs are defined as one of the following _introduced since the prior release_:

- crashes
- rendering issues
- unintentional binary size increases
- unintentional public API changes

For example, a long-standing crash just recently discovered would not necessitate a bug fix PR.

## Creating a GitHub Release

Be sure to choose the *release* branch when drafting a GitHub release.

## Git Commands

These commands assume a release candidate branch called *rc/1.9.0*.

### Creating a Release Candidate Branch

```
$ git checkout main
$ git pull
$ git branch rc/1.9.0
$ git push origin rc/1.9.0
```

### Merging the Release Candidate Branch Into Release

There may be temporary hotfixes in the release branch that should be overriden by the new release
candidate. To accomplish this, we first merge release into rc using the _ours_ strategy. Then we
merge rc into release.

```
$ git checkout rc/1.9.0
$ git pull
$ git fetch origin release:release
$ git merge -s ours release
$ git checkout release
$ git merge --no-ff rc/1.9.0
$ git push origin release
```

### Deleting the Release Candidate Branch

```
$ git branch -d rc/1.9.0
$ git push origin --delete rc/1.9.0
```

### See a History of the Release Branch

```
$ git log --oneline --first-parent
442b061 (HEAD -> release) Merge branch 'rc/1.9.2' into release
ac50d21 Hotfix
94dc2f7 Hotfix
b34ed5b Merge branch 'rc/1.9.1' into release
aeef498 Merge branch 'rc/1.9.0' into release
```
6 changes: 4 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.9.1'
implementation 'com.google.android.filament:filament-android:1.9.2'
}
```

Expand Down Expand Up @@ -63,7 +63,7 @@ A much smaller alternative to `filamat-android` that can only generate OpenGL sh
iOS projects can use CocoaPods to install the latest release:

```
pod 'Filament', '~> 1.9.1'
pod 'Filament', '~> 1.9.2'
```

### Snapshots
Expand Down Expand Up @@ -143,6 +143,8 @@ Here are a few screenshots of applications that use Filament in production:
- Physical light units
- Point lights, spot lights and directional light
- Spot and directional light shadows
- Cascaded shadows
- VSM or PCF shadows
- Contact shadows
- Screen-space ambient occlusion
- Screen-space refraction
Expand Down
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
This file contains one line summaries of commits that are worthy of mentioning in release notes.
A new header is inserted each time a *tag* is created.

## v1.9.2

- Fixes / improvements for contact shadows, fog, and DOF
- Reduce SSAO creases caused by geometry tessellation
- Fix compilation warnings and issue with Clang 12
- Fix JNI crashes
- Rename .blurScale to .cocScale in DOF options

## v1.9.1

- Improvements to SSAO quality
Expand Down
8 changes: 4 additions & 4 deletions android/common/CallbackUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

struct CallbackJni {
#ifdef ANDROID
jclass handlerClass;
jmethodID post;
jclass handlerClass = nullptr;
jmethodID post = nullptr;
#endif
jclass executorClass;
jmethodID execute;
jclass executorClass = nullptr;
jmethodID execute = nullptr;
};

void acquireCallbackJni(JNIEnv* env, CallbackJni& callbackUtils);
Expand Down
9 changes: 5 additions & 4 deletions android/filament-android/src/main/cpp/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Java_com_google_android_filament_View_nGetAmbientOcclusion(JNIEnv*, jclass, jlon
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetAmbientOcclusionOptions(JNIEnv*, jclass,
jlong nativeView, jfloat radius, jfloat bias, jfloat power, jfloat resolution, jfloat intensity,
jint quality, jint upsampling, jboolean enabled) {
jint quality, jint upsampling, jboolean enabled, jfloat minHorizonAngleRad) {
View* view = (View*) nativeView;
View::AmbientOcclusionOptions options = {
.radius = radius,
Expand All @@ -206,7 +206,8 @@ Java_com_google_android_filament_View_nSetAmbientOcclusionOptions(JNIEnv*, jclas
.intensity = intensity,
.quality = (View::QualityLevel)quality,
.upsampling = (View::QualityLevel)upsampling,
.enabled = (bool)enabled
.enabled = (bool)enabled,
.minHorizonAngleRad = minHorizonAngleRad
};
view->setAmbientOcclusionOptions(options);
}
Expand Down Expand Up @@ -262,9 +263,9 @@ Java_com_google_android_filament_View_nSetBlendMode(JNIEnv *, jclass , jlong nat

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetDepthOfFieldOptions(JNIEnv *, jclass ,
jlong nativeView, jfloat focusDistance, jfloat blurScale, jfloat maxApertureDiameter, jboolean enabled) {
jlong nativeView, jfloat focusDistance, jfloat cocScale, jfloat maxApertureDiameter, jboolean enabled) {
View* view = (View*) nativeView;
view->setDepthOfFieldOptions({.focusDistance = focusDistance, .blurScale = blurScale,
view->setDepthOfFieldOptions({.focusDistance = focusDistance, .cocScale = cocScale,
.maxApertureDiameter = maxApertureDiameter, .enabled = (bool)enabled});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ public static class AmbientOcclusionOptions {
* enable or disable screen space ambient occlusion
*/
public boolean enabled = false;

/**
* Minimal angle to consider in radian. This is used to reduce the creases that can
* appear due to insufficiently tessellated geometry.
* For e.g. a good values to try could be around 0.2.
*/
public float minHorizonAngleRad = 0.0f;
}

/**
Expand Down Expand Up @@ -335,9 +342,9 @@ public static class FogOptions {
public float inScatteringStart = 0.0f;

/**
* size of in-scattering (>=0 to activate). Good values are >> 1 (e.g. ~10 - 100)
* size of in-scattering (>0 to activate). Good values are >> 1 (e.g. ~10 - 100)
*/
public float inScatteringSize = 0.0f;
public float inScatteringSize = -1.0f;

/**
* fog color will be modulated by the IBL color in the view direction
Expand All @@ -360,8 +367,17 @@ public static class DepthOfFieldOptions {
/** focus distance in world units */
public float focusDistance = 10.0f;

/** scale factor controlling the amount of blur (values other than 1.0 are not physically correct)*/
public float blurScale = 1.0f;
/**
* circle of confusion scale factor (amount of blur)
*
* <p>cocScale can be used to set the depth of field blur independently from the camera
* aperture, e.g. for artistic reasons. This can be achieved by setting:</p>
* <code>
* cocScale = cameraAperture / desiredDoFAperture
* </code>
*
*/
public float cocScale = 1.0f;

/** maximum aperture diameter in meters (zero to disable bokeh rotation) */
public float maxApertureDiameter = 0.01f;
Expand Down Expand Up @@ -1061,7 +1077,7 @@ public void setAmbientOcclusionOptions(@NonNull AmbientOcclusionOptions options)
mAmbientOcclusionOptions = options;
nSetAmbientOcclusionOptions(getNativeObject(), options.radius, options.bias, options.power,
options.resolution, options.intensity, options.quality.ordinal(), options.upsampling.ordinal(),
options.enabled);
options.enabled, options.minHorizonAngleRad);
}

/**
Expand Down Expand Up @@ -1173,7 +1189,7 @@ public FogOptions getFogOptions() {
*/
public void setDepthOfFieldOptions(@NonNull DepthOfFieldOptions options) {
mDepthOfFieldOptions = options;
nSetDepthOfFieldOptions(getNativeObject(), options.focusDistance, options.blurScale, options.maxApertureDiameter, options.enabled);
nSetDepthOfFieldOptions(getNativeObject(), options.focusDistance, options.cocScale, options.maxApertureDiameter, options.enabled);
}

/**
Expand Down Expand Up @@ -1225,11 +1241,11 @@ void clearNativeObject() {
private static native boolean nIsFrontFaceWindingInverted(long nativeView);
private static native void nSetAmbientOcclusion(long nativeView, int ordinal);
private static native int nGetAmbientOcclusion(long nativeView);
private static native void nSetAmbientOcclusionOptions(long nativeView, float radius, float bias, float power, float resolution, float intensity, int quality, int upsampling, boolean enabled);
private static native void nSetAmbientOcclusionOptions(long nativeView, float radius, float bias, float power, float resolution, float intensity, int quality, int upsampling, boolean enabled, float minHorizonAngleRad);
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);
private static native void nSetFogOptions(long nativeView, float distance, float maximumOpacity, float height, float heightFalloff, float v, float v1, float v2, float density, float inScatteringStart, float inScatteringSize, boolean fogColorFromIbl, boolean enabled);
private static native void nSetBlendMode(long nativeView, int blendMode);
private static native void nSetDepthOfFieldOptions(long nativeView, float focusDistance, float blurScale, float maxApertureDiameter, boolean enabled);
private static native void nSetDepthOfFieldOptions(long nativeView, float focusDistance, float cocScale, float maxApertureDiameter, boolean enabled);
private static native void nSetVignetteOptions(long nativeView, float midPoint, float roundness, float feather, float r, float g, float b, float a, boolean enabled);
private static native void nSetTemporalAntiAliasingOptions(long nativeView, float feedback, float filterWidth, boolean enabled);
}
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.9.1
VERSION_NAME=1.9.2

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

Expand Down
1 change: 1 addition & 0 deletions art/diagrams/branching.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2020-09-14T19:00:14.695Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36" etag="dN_ZQ720OjeZq7fcsGJR" version="13.6.6" type="device"><diagram id="0Au-6x1pa8pepmiu9SBl" name="Page-1">7V1tc6M4Ev41rr3dqqR4N/44yUxmt+7m6mozV7vzUQbZaAOIA9lO9tefJN4lYWMC2JNMqqbGNCBEq5+nW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XsFc0P9r10VceXLCMqppRMCWKTciDioAyD4x7sgyTFpGKbozDOnXVSINmLFX2QHeNqXhGLhr9pUJbBL0AxCiLGJRYx6lCOZwO8CfedGlS7QpQ/kL8vI8yD6R+hZIkhXuEd1kLJPeNhrkxHwKOKPJTxoGV0NARxMVGHx7kpFDhFZtu2qvsOrfegghg9l05tilMTheq4x2FCbqq1U0xou1hgfSw/sW2PCisf/jO/PR/</diagram></mxfile>
Binary file added art/diagrams/branching.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/webgl/filament.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion filament/backend/src/opengl/CocoaTouchExternalImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void main() {
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);

CHECK_GL_ERROR(utils::slog.e)
CHECK_GL_FRAMEBUFFER_STATUS(utils::slog.e)
CHECK_GL_FRAMEBUFFER_STATUS(utils::slog.e, GL_FRAMEBUFFER)

// geometry
glBindVertexArray(0);
Expand Down
4 changes: 2 additions & 2 deletions filament/backend/src/opengl/GLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void checkGLError(io::ostream& out, const char* function, size_t line) noexcept
debug_trap();
}

void checkFramebufferStatus(io::ostream& out, const char* function, size_t line) noexcept {
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
void checkFramebufferStatus(io::ostream& out, GLenum target, const char* function, size_t line) noexcept {
GLenum status = glCheckFramebufferStatus(target);
const char* error = "unknown";
switch (status) {
case GL_FRAMEBUFFER_COMPLETE:
Expand Down
6 changes: 3 additions & 3 deletions filament/backend/src/opengl/GLUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ namespace filament {
namespace GLUtils {

void checkGLError(utils::io::ostream& out, const char* function, size_t line) noexcept;
void checkFramebufferStatus(utils::io::ostream& out, const char* function, size_t line) noexcept;
void checkFramebufferStatus(utils::io::ostream& out, GLenum target, const char* function, size_t line) noexcept;

#ifdef NDEBUG
#define CHECK_GL_ERROR(out)
#define CHECK_GL_FRAMEBUFFER_STATUS(out)
#define CHECK_GL_FRAMEBUFFER_STATUS(out, target)
#else
#ifdef _MSC_VER
#define __PRETTY_FUNCTION__ __FUNCSIG__
#endif
#define CHECK_GL_ERROR(out) { GLUtils::checkGLError(out, __PRETTY_FUNCTION__, __LINE__); }
#define CHECK_GL_FRAMEBUFFER_STATUS(out) { GLUtils::checkFramebufferStatus(out, __PRETTY_FUNCTION__, __LINE__); }
#define CHECK_GL_FRAMEBUFFER_STATUS(out, target) { GLUtils::checkFramebufferStatus(out, target, __PRETTY_FUNCTION__, __LINE__); }
#endif

constexpr inline GLuint getComponentCount(backend::ElementType type) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion filament/backend/src/opengl/OpenGLBlitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void OpenGLBlitter::blit(GLuint srcTextureExternal, GLuint dstTexture2d, GLuint
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, dstTexture2d, 0);
CHECK_GL_ERROR(utils::slog.e)
CHECK_GL_FRAMEBUFFER_STATUS(utils::slog.e)
CHECK_GL_FRAMEBUFFER_STATUS(utils::slog.e, GL_FRAMEBUFFER)

// geometry
glBindBuffer(GL_ARRAY_BUFFER, 0);
Expand Down
Loading

0 comments on commit defee76

Please sign in to comment.