Allow dynamic doubleSided and materialThreshold. (#1072)
* MaterialInstance now has setMaskThreshold for convenience. * Materials now support dynamic doubleSided property. This does not change the format of material packages because they already have both getDoubleSided() and getDoubleSidedSet(). The only way in which this change could impact existing applications is that materials that explicity set doubleSided to "false" will now respect the material's culling mode, rather than forcing it to NONE. Fixes gltf_viewer with littlest_tokyo in ubershader mode. Fixes #963. * JNI for dynamic material properties. * Add underscore prefix to internal material params. * Remove un-needed mat info field.
This commit is contained in:
@@ -217,3 +217,19 @@ Java_com_google_android_filament_MaterialInstance_nSetPolygonOffset(JNIEnv*,
|
||||
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||
instance->setPolygonOffset(scale, constant);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_MaterialInstance_nSetMaskThreshold(JNIEnv*,
|
||||
jclass, jlong nativeMaterialInstance, jfloat threshold) {
|
||||
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||
instance->setMaskThreshold(threshold);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_MaterialInstance_nSetDoubleSided(JNIEnv*,
|
||||
jclass, jlong nativeMaterialInstance, jboolean doubleSided) {
|
||||
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||
instance->setDoubleSided(doubleSided);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user