Add basic support for instanced renderables
We can now specify an "instance count" per renderable during creation. This instance count applies to all render primitives in the Renderable. This will simply draw the renderable "instance count" times. A new method available to vertex shaders, getInstanceIndex(), allows the material to discriminate the instances and adjust the position/transform accordingly. Typically this is used for particle systems.
This commit is contained in:
committed by
Mathias Agopian
parent
d13ccd1c26
commit
1d6aeb5de1
@@ -221,6 +221,13 @@ Java_com_google_android_filament_RenderableManager_nBuilderLightChannel(JNIEnv*,
|
||||
builder->lightChannel(channel, (bool)enable);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_google_android_filament_RenderableManager_nBuilderInstances(JNIEnv*, jclass,
|
||||
jlong nativeBuilder, jint instanceCount) {
|
||||
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
|
||||
builder->instances(instanceCount);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
|
||||
Reference in New Issue
Block a user