Add vignette post-processing effect (#2743)

* Add a vignette post-processing effect

* Use numeric limits instead of hard coded values
This commit is contained in:
Romain Guy
2020-06-26 17:44:17 -07:00
committed by GitHub
parent f7f86a7c56
commit 132e94b3bb
16 changed files with 296 additions and 28 deletions

View File

@@ -16,6 +16,7 @@
#include <jni.h>
#include <filament/Color.h>
#include <filament/View.h>
#include <filament/Viewport.h>
@@ -258,3 +259,12 @@ Java_com_google_android_filament_View_nSetDepthOfFieldOptions(JNIEnv *, jclass ,
view->setDepthOfFieldOptions({.focusDistance = focusDistance, .blurScale = blurScale,
.maxApertureDiameter = maxApertureDiameter, .enabled = (bool)enabled});
}
extern "C"
JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetVignetteOptions(JNIEnv*, jclass, jlong nativeView, jfloat midPoint, jfloat roundness,
jfloat feather, jfloat r, jfloat g, jfloat b, jfloat a, jboolean enabled) {
View* view = (View*) nativeView;
view->setVignetteOptions({.midPoint = midPoint, .roundness = roundness, .feather = feather,
.color = LinearColorA{r, g, b, a}, .enabled = (bool)enabled});
}