Improve AO buffer upsampling
Since AO is computed at 1/4 resolution, it is necessary to upsample the AO buffer. Until now this was done with a bilinear tap, which is less than ideal as it can creates jaggies at edges. High quality upsampling can now be enabled and uses a bilateral filter. The cost is about 2.0 ms at 250MHz on Pixel 4. ES3.1 is required.
This commit is contained in:
committed by
Mathias Agopian
parent
d1ed4f837c
commit
62ff7b7d0a
@@ -192,7 +192,7 @@ Java_com_google_android_filament_View_nGetAmbientOcclusion(JNIEnv*, jclass, jlon
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_View_nSetAmbientOcclusionOptions(JNIEnv*, jclass,
|
||||
jlong nativeView, jfloat radius, jfloat bias, jfloat power, jfloat resolution, jfloat intensity,
|
||||
jint quality) {
|
||||
jint quality, jint upsampling) {
|
||||
View* view = (View*) nativeView;
|
||||
View::AmbientOcclusionOptions options = {
|
||||
.radius = radius,
|
||||
@@ -200,7 +200,8 @@ Java_com_google_android_filament_View_nSetAmbientOcclusionOptions(JNIEnv*, jclas
|
||||
.bias = bias,
|
||||
.resolution = resolution,
|
||||
.intensity = intensity,
|
||||
.quality = (View::QualityLevel)quality
|
||||
.quality = (View::QualityLevel)quality,
|
||||
.upsampling = (View::QualityLevel)upsampling
|
||||
};
|
||||
view->setAmbientOcclusionOptions(options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user