google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.78k stars 1.89k forks source link

update indirectLight dynamically in android app #7026

Open luoqii opened 1 year ago

luoqii commented 1 year ago

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):

romainguy commented 1 year ago

Do you have before/after screenshots? This won't change the background for instance, just the lighting.

luoqii commented 1 year ago

the lighting is same as before, but once i change any setting in https://google.github.io/filament/remote/, the new lighting will work. i can not upload d file, bcz of company network policy.