APIs to enable/disable screen space refraction

Just like with shadows, this is a toggle to entirely disable
screen space refraction.

Added missing getters, and minor refactoring.
This commit is contained in:
Pixelflinger
2020-09-21 15:03:26 -07:00
committed by Mathias Agopian
parent 6c8e134d01
commit c3975f2640
8 changed files with 171 additions and 67 deletions

View File

@@ -67,9 +67,9 @@ Java_com_google_android_filament_View_nSetVisibleLayers(JNIEnv*, jclass, jlong n
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetShadowsEnabled(JNIEnv*, jclass, jlong nativeView, jboolean enabled) {
Java_com_google_android_filament_View_nSetShadowingEnabled(JNIEnv*, jclass, jlong nativeView, jboolean enabled) {
View* view = (View*) nativeView;
view->setShadowsEnabled(enabled);
view->setShadowingEnabled(enabled);
}
extern "C" JNIEXPORT void JNICALL
@@ -286,3 +286,26 @@ Java_com_google_android_filament_View_nSetTemporalAntiAliasingOptions(JNIEnv *,
view->setTemporalAntiAliasingOptions({
.filterWidth = filterWidth, .feedback = feedback, .enabled = (bool) enabled});
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_View_nIsShadowingEnabled(JNIEnv *, jclass, jlong nativeView) {
View* view = (View*) nativeView;
return (jboolean)view->isShadowingEnabled();
}
extern "C"
JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetScreenSpaceRefractionEnabled(JNIEnv *, jclass,
jlong nativeView, jboolean enabled) {
View* view = (View*) nativeView;
view->setScreenSpaceRefractionEnabled((bool)enabled);
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_View_nIsScreenSpaceRefractionEnabled(JNIEnv *, jclass,
jlong nativeView) {
View* view = (View*) nativeView;
return (jboolean)view->isScreenSpaceRefractionEnabled();
}