DoF: add a "filter" parameter to the DoF settings
Currently the only NONE and MEDIAN are available options, at some point we may add a "MAX" option which is cheaper. There is no real practical uses for this option with these only two choices, other than for debugging.
This commit is contained in:
committed by
Mathias Agopian
parent
abcf4010dd
commit
4de1b0de2d
@@ -300,10 +300,15 @@ 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 cocScale, jfloat maxApertureDiameter, jboolean enabled) {
|
||||
jlong nativeView, jfloat focusDistance, jfloat cocScale, jfloat maxApertureDiameter, jboolean enabled, jint filter) {
|
||||
View* view = (View*) nativeView;
|
||||
View::DepthOfFieldOptions::Filter eFilter{};
|
||||
if (filter == 1) {
|
||||
// View::DepthOfFieldOptions::Filter::MEDIAN value is actually 2
|
||||
eFilter = View::DepthOfFieldOptions::Filter::MEDIAN;
|
||||
}
|
||||
view->setDepthOfFieldOptions({.focusDistance = focusDistance, .cocScale = cocScale,
|
||||
.maxApertureDiameter = maxApertureDiameter, .enabled = (bool)enabled});
|
||||
.maxApertureDiameter = maxApertureDiameter, .enabled = (bool)enabled, .filter = eFilter});
|
||||
}
|
||||
|
||||
extern "C"
|
||||
|
||||
Reference in New Issue
Block a user