Add a threshold option (enabled by default) for bloom.

Threshold can be either on or off, and only thresholds at 1.0 when 
activated (in pre-exposed mode).

This allows to use very high strengths values for the bloom without
softening the rest of the image, and is useful for artistic considerations.
This commit is contained in:
Mathias Agopian
2020-02-11 12:12:07 -08:00
committed by Mathias Agopian
parent 34dcc90ac7
commit b17c51e340
5 changed files with 50 additions and 11 deletions

View File

@@ -250,7 +250,7 @@ Java_com_google_android_filament_View_nSetAmbientOcclusionOptions(JNIEnv*, jclas
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetBloomOptions(JNIEnv*, jclass,
jlong nativeView, jfloat strength, jint resolution, jfloat anamorphism, jint levels,
jint blendMode, jboolean enabled) {
jint blendMode, jboolean threshold, jboolean enabled) {
View* view = (View*) nativeView;
View::BloomOptions options = {
.strength = strength,
@@ -258,6 +258,7 @@ Java_com_google_android_filament_View_nSetBloomOptions(JNIEnv*, jclass,
.anamorphism = anamorphism,
.levels = (uint8_t)levels,
.blendMode = (View::BloomOptions::BlendMode)blendMode,
.threshold = (bool)threshold,
.enabled = (bool)enabled
};
view->setBloomOptions(options);