Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

import blend shapes from gltf 2.0 file #1938

Closed sushantojal closed 6 years ago

sushantojal commented 6 years ago

The vertex data (position, normal, tangents) of all the blend shapes of a mesh are being imported from the gltf file and being saved in a GVRVertexBuffer List in the corresponding GVRMesh. The changes in the native assimp code are in a pull request here

GearVRf DCO signed off by: Sahithi Podila s.pod@samsung.com Nola Donato nola.donato@samsung.com Sushant Ojal sushant.o@samsung.com

sushantojal commented 6 years ago

Still having some issues building the 64 bit libassimp.so. Will commit that as soon as I figure it out (along with compressed prebuilt .so with symbols)

liaxim commented 6 years ago

Not seeing side-effects. We could merge after the 64bit binary is included.

NolaDonato commented 6 years ago

If you made API changes to assimp, please put the new include files in framework/src/main/jni/contrib/assimp.include.assimp

sushantojal commented 6 years ago

I enabled the mesh morph component to be attached to the scene object at the time of object import. Also, no API changes were made to assimp. The only header files changed were gltf2asset.h and gltf2importer.h

sushantojal commented 6 years ago

Merged changes belonging to @NolaDonato and @spodila1 as well.

liaxim commented 6 years ago

Needs rebase. Is it ready for review and verification?

sushantojal commented 6 years ago

yes this is ready for review, should be tested with the PR for the gvr-morph demo.

liaxim commented 6 years ago

Have you tried S9? I get a black screen and FPS of about 10fps nevertheless (on my eng build S9+). No obvious errors in logcat.

Note8, S8 - ~60fps, works as expected Note5 - 45-50fps, works as expected

liaxim commented 6 years ago

@apjagdale Please review the shader updates. Thanks.

liaxim commented 6 years ago

@NolaDonato Should JOIN_IDENTICAL_VERTICES be included in the getRecommendedMorphSettings? The demo doesn't work as expected otherwise: https://github.com/gearvrf/GearVRf-Demos/pull/627.

NolaDonato commented 6 years ago

No, if JOIN_IDENTICAL_VERTICES is included the blend shapes will not have the same topology.

liaxim commented 6 years ago

Ok, then why https://github.com/gearvrf/GearVRf-Demos/pull/627 doesn't work with the existing morph settings?

sushantojal commented 6 years ago

@liaxim didnt find any issues in the CPU profiler when using S9 yet, still looking into it.

liaxim commented 6 years ago

@sushantojal Does the app run as expected on your S9?

sushantojal commented 6 years ago

no it doesnt, its similar to what you described, black screen ~10 fps, there is no obvious issue on the cpu side

liaxim commented 6 years ago

getRecommendedMorphSettings now works.

On S9 frames are rendered at close to 60fps but then vrapi_SubmitFrame blocks for about 100ms. Not that many reasons why it would block, especially for that long. Maybe this:

/// This will block until the textures from the previous vrapi_SubmitFrame() have been
/// consumed by the background thread, to allow one frame of overlap for maximum
/// GPU utilization, while preventing multiple frames from piling up variable latency.

Interestingly enough, all other backend adapters work but monoscopic. Maybe it would be easier to diagnose with monoscopic since it is simpler?

sushantojal commented 6 years ago

@liaxim will take a look. This seems to be an issue only with prod builds. Works fine on user builds. Also, I tried running simplesample on the S9 I have (prod build, adreno) and ran into the same issue.

thomasflynn commented 6 years ago

ok, tested on my S9+. works fine. the issue with the prod build we should still investigate internally, but i don't think we need to hold up this check-in for that. anyone disagrees, you can tackle me tomorrow to discuss it.

liaxim commented 6 years ago

One todo for me - the 64bit assimp binary.