sceneform-android icon indicating copy to clipboard operation
sceneform-android copied to clipboard

Disappearing model textures (only) on camera move

Open kustraslawomir opened this issue 3 years ago • 10 comments

Hello, how to prevent disappearing model from the scene on camera movement? https://youtu.be/MsX_vSy7YoM

kustraslawomir avatar Feb 22 '22 20:02 kustraslawomir

@ThomasGorisse I didn't find any issues like this in your samples. But it exists with my models, maybe You know what to do? Thank you mate

kustraslawomir avatar Feb 23 '22 08:02 kustraslawomir

Only textures are missing, the shadow is still visible, viewRenderables are still visible...

kustraslawomir avatar Feb 23 '22 08:02 kustraslawomir

Hmm, I have used my own model in Your samples and the behavior is the same, textures are not visible when moving the camera a little bit off the model. Glb: https://we.tl/t-qL66DAptRL I could provide you .blend project if You wish. If you don't have time for this - that is ok, I understood. Thank you <3

kustraslawomir avatar Feb 23 '22 09:02 kustraslawomir

https://youtube.com/shorts/inbFl2F_7Co?feature=share

kustraslawomir avatar Feb 23 '22 09:02 kustraslawomir

sample-ar-model-viewer-java

kustraslawomir avatar Feb 23 '22 09:02 kustraslawomir

 ModelRenderable.builder()
                .setSource(this, Uri.parse("models/VAMPIR3_optymized.glb"))
                .setIsFilamentGltf(true)
                .setAsyncLoadEnabled(true)
                .build()
                .thenAccept(model -> {
                    MainActivity activity = weakActivity.get();
                    if (activity != null) {
                        activity.model = model;
                    }
                })
                .exceptionally(throwable -> {
                    Toast.makeText(
                            this, "Unable to load model", Toast.LENGTH_LONG).show();
                    return null;
                });

kustraslawomir avatar Feb 23 '22 09:02 kustraslawomir

Also I have used fox.blend and pasted the .fbx on the scene from https://www.mixamo.com/, same results. :(

kustraslawomir avatar Feb 23 '22 09:02 kustraslawomir

Your issue comes from the view culling which doesn't render models when any part of its bounding box is within the camera view. There is actually a wrong bounding box calculation within Filament when the model is animated so the culling system thinks that parts of your models are not visible within the rendered view even if they currently are.

We had a culling setter at the RenderableInstance level (commit: bdc7ea9c0403e689ad5e915895c0ae6391f7303a)

For now, you have to call

renderableInstance.setCulling(false)

ThomasGorisse avatar Mar 03 '22 11:03 ThomasGorisse

@ThomasGorisse It worked! Thank you very very much <3

kustraslawomir avatar Mar 05 '22 11:03 kustraslawomir

You're welcome. You can think about sponsoring us if you appreciate our work.

ThomasGorisse avatar Mar 05 '22 11:03 ThomasGorisse

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 17 '23 05:08 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Aug 25 '23 05:08 github-actions[bot]