Files
filament/android/samples
Mathias Agopian a8ee48c4b7 a series of CL to add RenderTarget support for external textures (#9504)
* add support for AHardwareBuffer to the java bindings

Texture.setEXternalIamge() now can take a AHArdwreBuffer Java object
as a parameter.

* add an API to set the priority of the Skybox

by default the skybox is always drawn last (priority 7) in order to
reduce overdraw. however, when depth culling is not enabled, it
needs to be drawn first. The new Builder::priority() allows to set
an arbitrary priority for the skybox.

* add rendertarget support for external textures

This was in fact mostly already supported, we just were artificially
preventing that usage. It is supported by the EGL_external_image
extension.

It's the responsibility of the caller/user to not attempt to use an
incompatible format, which has undefined behavior.

FIXES=[466395306]

* add a new android sample to test the AHardwareBuffer as render target

---------

Co-authored-by: Powei Feng <powei@google.com>
2025-12-12 14:15:58 -08:00
..
2023-04-21 15:53:59 -07:00
2023-04-21 15:53:59 -07:00
2023-04-21 15:53:59 -07:00
2023-04-21 15:53:59 -07:00
2023-04-21 15:53:59 -07:00

Filament sample Android apps

This directory contains several sample Android applications that demonstrate how to use the Filament APIs:

hello-triangle

Demonstrates how to setup a rendering surface for Filament:

Hello Triangle

lit-cube

Demonstrates how to create a light and a mesh with the attributes required for lighting:

Lit Cube

live-wallpaper

Demonstrates how to use Filament as renderer for an Android Live Wallpaper.

Live Wallpaper

image-based-lighting

Demonstrates how to create image-based lights and load complex meshes:

Image-based Lighting

textured-object

Demonstrates how to load and use textures for complex materials:

Textured Object

transparent-rendering

Demonstrates how to render into a transparent SurfaceView:

Transparent Rendering

texture-view

Demonstrates how to render into a TextureView instead of a SurfaceView:

Texture View

material-builder

Demonstrates how to programmatically generate Filament materials, as opposed to compiling them on the host machine:

Material Builder

gltf-viewer

Demonstrates how to load glTF models and use the camera manipulator:

glTF Viewer

hello-camera

Demonstrates how to use Stream with Android's Camera2 API:

Hello Camera

page-curl

Pure Java app that demonstrates custom vertex shader animation and two-sided texturing. Applies the deformation described in "Deforming Pages of Electronic Books" by Hong et al. Users can drag horizontally to turn the page.

Page Curl

stream-test

Tests the various ways to interact with Stream by drawing into an external texture using Canvas. See the following screenshot; if the two sets of stripes are perfectly aligned, then the Filament frame and the external texture are perfectly synchronized.

Stream Test

Building Samples

Before you start, make sure to read Filament's README. You need to be able to compile Filament's native library and Filament's AAR for this project. The easiest way to proceed is to install all the required dependencies and to run the following commands at the root of the source tree.

To build the samples, please follow the steps described in BUILDING.md