Files
filament/android/samples/sample-material-builder
Pixelflinger b2dd6683be Add a way to query and set Display information
Renderer can now be given a DisplayInfo that contains some
important information about the current display. This will be used
for frame-pacing and dynamic-resolution.

This is most relevant on Android, where we can accurately query these
parameters. Added support for that in our samples.


This also sets the minSDK to 19 (including gltf viewer's), since this is
the version we support. We were cheating before by under-reporting our
minSdk.
2020-04-06 16:55:24 -07:00
..

Android material-builder Sample

The material-builder sample shows how to generate materials programatically on the device as opposed to with the matc tool on the host machine. The cost is a binary size increase of your app due to the relatively larger size of the filamat library.

The buildMaterial method inside MainActivity.kt uses a MaterialBuilder() instance to compile a material package whose payload is sent to the engine where it is applied towards the Renderable.

Before building

The filamat static library is needed to fascilitate material building on the device. Compiling the library is slower and thus it is not built by the default build.sh command. To build, add the -l flag to the build.sh command:

./build.sh -i -p android release

Explanation of flags:

  • The -i flag installs the libraries to out/android-release/, so this sample can find them.
  • The -p flag and android argument choose Android as the platform to build for.