google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Sceneform 1.15 occlusion #925

Open bobekos opened 4 years ago

bobekos commented 4 years ago

Hello,

like i already mentioned in the ticket #167 the occlusion is not working on android 10 devices. But now i have also noticed that this is not a Android 10 problem. I have also the same bad results on One Plus 6T. On all other devices that i have tested the occlusion is working.

I am using this material for the occlusion:

material {
    name : "Occlusion material",
    shadingModel : unlit,
    colorWrite : false,
    depthWrite : true
}

fragment {
    void material(inout MaterialInputs material) {
        prepareMaterial(material);
        material.baseColor = vec4(0.0);
    }
}

I have modified the example project so far to be able to show what happens (sceneform version 1.13). What i have done is to place a plane with the occlusion material in front of the andy object. In Addition i set the camera render priority to:

arFragment.getArSceneView().setCameraStreamRenderPriority(Renderable.RENDER_PRIORITY_FIRST);

The render priority of the plane (with the occlusion material) is set to:

occluder.setRenderPriority(ModelRenderable.RENDER_PRIORITY_DEFAULT - 1)

This is the result on all other devices that i have tested (Samsung S7, Nokia 7.1, Huawei P20): working

And this is look like on pixel and on plus: not_working

It would be nice if someone from the people in charge (or someone who has an idea) would post something. I have the feeling that this repo is no longer noticed. That would be a damn shame because the framework works fine otherwise.

Ps. The augmented face demo is working fine also on the pixel. There is also an occluder material used. I also tested it by getting the material from the SFB (sceneform_face_mesh_occluder.sfb) but the result was the same like posted above.

bobekos commented 4 years ago

It seems to be a 1.13 issue because the same code is working on the version 1.12

bobekos commented 4 years ago

@nvictornvictor @tpsiaki Still not working on Scenefrom 1.14 ... c'mon guys :(

bobekos commented 4 years ago

After some tests i can say this happen only if you try to occlude gltf's. Thats why the AugmentedFaces example is working. The faceFox mesh is a FXB File.

In 1.13 you mention this BugFix: Fixed masked materials when using Sceneform assets package to load a glTF.

Does it have something to do with this problem here? I thought you just adjusted the mapping from "MASKED" to "MASK".

bobekos commented 4 years ago

@nvictornvictor @tpsiaki Guys any news?

bobekos commented 4 years ago

@nvictornvictor @tpsiaki Still the same error also on 1.15 ... wow

bobekos commented 4 years ago

@nvictornvictor @tpsiaki The bug must be in this module -> com.google.ar.sceneform:filament-android:1.12.0 This seems to be the filament dependency. But according to the ticket from the filament repo it is a sceneform bug. Please take a look on.

//For those who want to use the rest as 1.15.0 I recommend the following gradle config:
implementation "com.google.ar:core:1.15.0"
implementation ("com.google.ar.sceneform:core:1.15.0") {
        exclude group: 'com.google.ar.sceneform', module: 'filament-android'
}
implementation "com.google.ar.sceneform:assets:1.15.0"
implementation group: 'com.google.ar.sceneform', name: 'filament-android', version: '1.12.0'

//for those who use the ux dependency
implementation ("com.google.ar.sceneform.ux:sceneform-ux:1.15.0") {
        exclude group: 'com.google.ar.sceneform', module: 'core'
}
AntonClaesson commented 4 years ago

Do you still have this problem? I am also looking to create an occluding material

AntonClaesson commented 4 years ago

How would one go about making an occluding material in 1.16? Now that support for SFB & the SFB Sceneform Android Studio plugin is deprecated