google / google/filament

update indirectLight dynamically in android app

Open
#7,026 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 14h
Merged PRs (30d)
83

Description

**Describe the bug**
in my demo, i load indirectLight from ktx file whick generated from cmgen util. it work perfectly.
but when i want change a different indirectLight at some later time, AFTER call loadIblKtx() there is
no any change.
by the way, i see a same solution in androd sample glft-viewer.
this is my code:
```
private fun loadIblKtx(buff: Buffer) {
Log.d(TAG, "load ibl ktx")
val engine = modelViewer.engine
engine.destroyIndirectLight(modelViewer.scene.indirectLight!!)
KTX1Loader.createIndirectLight(modelViewer.engine, buff)
.apply {
intensity = 100f
modelViewer.scene.indirectLight = this
viewerContent.indirectLight = this
}
}
```

the sample gltfview has ability to support dragging hdr file to https://google.github.io/filament/remote/
can U give me a avaiable hdr file to try? all hdr file i try will crash the android app.

**Smartphone (please complete the following information):**
- Device: xiaomi red note
- OS: android 11

Contributor guide

Open the contributing guide

Research direction

Start at the loadIblKtx() entry point and KTX1Loader.createIndirectLight call, then compare the replacement flow with the gltf-viewer sample mentioned in the issue. Reproduce changing indirectLight after the initial load and test an HDR file that triggers the Android crash; done means the replacement takes effect and HDR loading no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.