Add IndirectLight::radiance()

This allows to specify the irradiance by providing only the radiance
as SH, which might be easier in some case.
This commit is contained in:
Mathias Agopian
2019-06-12 18:30:14 -07:00
committed by Mathias Agopian
parent 4e4f7fd4ac
commit 6620edebb3
4 changed files with 80 additions and 0 deletions

View File

@@ -57,6 +57,15 @@ Java_com_google_android_filament_IndirectLight_nIrradiance(JNIEnv* env, jclass,
env->ReleaseFloatArrayElements(sh_, sh, JNI_ABORT);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_IndirectLight_nRadiance(JNIEnv* env, jclass,
jlong nativeBuilder, jint bands, jfloatArray sh_) {
IndirectLight::Builder* builder = (IndirectLight::Builder*) nativeBuilder;
jfloat* sh = env->GetFloatArrayElements(sh_, NULL);
builder->radiance((uint8_t) bands, (const filament::math::float3*) sh);
env->ReleaseFloatArrayElements(sh_, sh, JNI_ABORT);
}
extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_IndirectLight_nIrradianceAsTexture(JNIEnv*, jclass,
jlong nativeBuilder, jlong nativeTexture) {