Add a quality option to dynamic-scaling

It controls the quality of the upsampling filter. This can help a lot
if heavy scaling is needed to maintain performance, it also helps if
MSAA is not enabled.

There are 3 quality levels, low, medium and high. 1, 4 and 9 bilinear
taps are used for each level respectively. The high quality setting
employs a tent filter.
This commit is contained in:
Pixelflinger
2020-03-07 23:40:47 -08:00
committed by Mathias Agopian
parent d016e0f443
commit 8866e2829f
10 changed files with 149 additions and 28 deletions

View File

@@ -162,17 +162,18 @@ extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetDynamicResolutionOptions(JNIEnv*,
jclass, jlong nativeView, jboolean enabled, jboolean homogeneousScaling,
jfloat targetFrameTimeMilli, jfloat headRoomRatio, jfloat scaleRate,
jfloat minScale, jfloat maxScale, jint history) {
View* view = (View*) nativeView;
jfloat minScale, jfloat maxScale, jint history, jint quality) {
View* view = (View*)nativeView;
View::DynamicResolutionOptions options;
options.enabled = enabled;
options.homogeneousScaling = homogeneousScaling;
options.targetFrameTimeMilli = targetFrameTimeMilli;
options.headRoomRatio = headRoomRatio;
options.scaleRate = scaleRate;
options.minScale = filament::math::float2{minScale};
options.maxScale = filament::math::float2{maxScale};
options.history = (uint8_t) history;
options.minScale = filament::math::float2{ minScale };
options.maxScale = filament::math::float2{ maxScale };
options.history = (uint8_t)history;
options.quality = (View::QualityLevel)quality;
view->setDynamicResolutionOptions(options);
}