Shivamdhuria/filament_3d_viewer_android

A sample Android application built with Jetpack Compose and Filament that enables interactive viewing of 3D models with real-time rendering, smooth animations, and gesture controls.

★ 1Forks 0KotlinGitHub ↗Compare

Project website ↗

README

3D Model Viewer (Filament)

Small sample project showing how to render GLB models with Filament + SceneView in a Jetpack Compose UI.

Demo video

Screen 1 Screen 2 Screen 3

Filament integration (quick steps)

  1. Add dependencies (SceneView + Filament/GLTFIO) in gradle/libs.versions.toml and use them in app/build.gradle.kts.
  2. Create Filament engine and loaders:
    • rememberEngine()
    • rememberModelLoader(engine)
    • rememberEnvironmentLoader(engine)
  3. Load a model and environment:
    • modelLoader.createModelInstance("models/<name>.glb")
    • environmentLoader.createHDREnvironment("envs/sky_2k.hdr")
  4. Render using Scene(...) from SceneView and update nodes in onFrame.

Minimal code path

  • Entry point: app/src/main/java/com/app/a3d_app/MainActivity.kt
    • Calls FilamentScreen().
  • Rendering: app/src/main/java/com/app/a3d_app/ui/FilamentScreen.kt
    • Holds engine/loader setup, model loading, environment lighting, and frame updates.

Use your own model

  1. Drop your .glb file into app/src/main/assets/models/.
  2. Update the path in FilamentScreen:
modelLoader.createModelInstance("models/your_model.glb")

Assets layout

  • app/src/main/assets/models/ contains GLB/GLTF model files.
  • app/src/main/assets/envs/ contains HDR environments and KTX files.

Build and run

./gradlew :app:assembleDebug

Notes

  • SceneView is pulled from JitPack (see settings.gradle.kts).
  • Filament / GLTFIO dependencies are defined in gradle/libs.versions.toml.

Contributors

hamidovmurad

Issues