improvements to DoF

- bokeh rotates with the aperture diameter
- match sample count on cpu and cpu sides which affects CoC calculation
- feather blur radius to avoid visible "steps" in bokeh size
This commit is contained in:
Pixelflinger
2020-05-04 12:10:09 -07:00
committed by Mathias Agopian
parent 3e5fe994b9
commit e80ea979a4
8 changed files with 40 additions and 22 deletions

View File

@@ -255,7 +255,8 @@ 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, jboolean enabled) {
jlong nativeView, jfloat focusDistance, jfloat blurScale, jfloat maxApertureDiameter, jboolean enabled) {
View* view = (View*) nativeView;
view->setDepthOfFieldOptions({ .focusDistance = focusDistance, .blurScale = blurScale, .enabled = (bool)enabled });
view->setDepthOfFieldOptions({.focusDistance = focusDistance, .blurScale = blurScale,
.maxApertureDiameter = maxApertureDiameter, .enabled = (bool)enabled});
}